From 8e5d5f89c2233a0c2ff62e6ebd9b191eef37135f Mon Sep 17 00:00:00 2001 From: MikiZX1 <161243635+MikiZX1@users.noreply.github.com> Date: Fri, 1 Nov 2024 22:35:35 +0100 Subject: [PATCH 001/194] Update rmodels.c - 'fix' for GenMeshSphere artifact (#4460) When creating a new sphere mesh with high number of slices/rings the top and bottom parts of the generated sphere are removed. This happens because the triangles in those parts, due to high resolution, end up being very small and are removed as part of the 'par_shapes' library's optimization. Adding par_shapes_set_epsilon_degenerate_sphere(0.0); before generating the sphere mesh sets the threshold for removal of small triangles is removed and the sphere is returned to raylib correctly. --- src/rmodels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rmodels.c b/src/rmodels.c index ed15d9658..40e0182ad 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2820,6 +2820,7 @@ Mesh GenMeshSphere(float radius, int rings, int slices) if ((rings >= 3) && (slices >= 3)) { + par_shapes_set_epsilon_degenerate_sphere(0.0); par_shapes_mesh *sphere = par_shapes_create_parametric_sphere(slices, rings); par_shapes_scale(sphere, radius, radius, radius); // NOTE: Soft normals are computed internally From 24724d33bbb0dba1871bbcbde4e21ff7cf562e9d Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 3 Nov 2024 12:30:02 +0100 Subject: [PATCH 002/194] Added last week commits info --- CHANGELOG | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7ec73066f..1f68fc46f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,7 +15,7 @@ KEY CHANGES: Detailed changes: -WIP: Last update with commit from 21-Oct-2024 +WIP: Last update with commit from 02-Nov-2024 [rcore] ADDED: Working directory info at initialization by @Ray [rcore] ADDED: `MakeDirectory()`, supporting recursive directory creation by @Ray @@ -48,6 +48,10 @@ WIP: Last update with commit from 21-Oct-2024 [rcore] REVIEWED: Fix typos in src/platforms/rcore_*.c (#3581) by @RadsammyT [rcore] REVIEWED: `ExportDataAsCode()`, change sanitization check (#3837) by @Laurentino Luna [rcore] REVIEWED: `ExportDataAsCode()`, add little sanitization to indentifier names (#3832) by @4rk +[rcore] REVIEWED: `GetScreenWidth()`/`GetScreenHeight()` align with all platforms (#4451) by @Arche Washi +[rcore] REVIEWED: `SetGamepadVibration()`, added duration parameter (#4410) by @Asdqwe -WARNING- +[rcore] REVIEWED: `GetGamepadAxisMovement()`, fix #4405 (#4420) by @Asdqwe +[rcore] REVIEWED: `GetGestureHoldDuration()` comments by @Ray [rcore][rlgl] REVIEWED: Fix scale issues when ending a view mode (#3746) by @Jeffery Myers [rcore][GLFW] REVIEWED: Keep CORE.Window.position properly in sync with glfw window position (#4190) by @Dave Green [rcore][GLFW] REVIEWED: Set AUTO_ICONIFY flag to false per default (#4188) by @Dave Green @@ -57,6 +61,7 @@ WIP: Last update with commit from 21-Oct-2024 [rcore][GLFW] REVIEWED: Remove GLFW mouse passthrough hack and increase GLFW version in CMake (#3852) by @Alexandre Almeida [rcore][GLFW] REVIEWED: Updated GLFW to 3.4 (#3827) by @Alexandre Almeida [rcore][GLFW] REVIEWED: Feature test macros before include (#3737) by @John +[rcore][GLFW] REVIEWED: Fix inconsistent dll linkage warning on windows (#4447) by @Jeffery Myers [rcore][Web] ADDED: `SetWindowOpacity()` implementation (#4403) by @Asdqwe [rcore][Web] ADDED: `MaximizeWindow()` and `RestoreWindow()` implementations (#4397) by @Asdqwe [rcore][Web] ADDED: `ToggleFullscreen()` implementation (#3634) by @ubkp @@ -70,6 +75,8 @@ WIP: Last update with commit from 21-Oct-2024 [rcore][Web] REVIEWED: Fix CORE.Input.Mouse.cursorHidden with callbacks (#3644) by @ubkp [rcore][Web] REVIEWED: Fix `IsMouseButtonUp()` (#3611) by @ubkp [rcore][Web] REVIEWED: HighDPI support #3372 by @Ray +[rcore][Web] REVIEWED: `SetWindowSize()` (#4452) by @Asdqwe +[rcore][Web] REVIEWED: `EmscriptenResizeCallback()`, simplified (#4415) by @Asdqwe [rcore][SDL] ADDED: `IsCursorOnScreen()` (#3862) by @Peter0x44 [rcore][SDL] ADDED: Gamepad rumble/vibration support (#3819) by @GideonSerf [rcore][SDL] REVIEWED: Gamepad support (#3776) by @A @@ -107,6 +114,7 @@ WIP: Last update with commit from 21-Oct-2024 [rcore][RGFW] REVIEWED: RGFW 1.0 (#4144) by @Colleague Riley [rcore][RGFW] REVIEWED: Fix errors when compiling with mingw (#4282) by @Colleague Riley [rcore][RGFW] REVIEWED: Replace long switch with a lookup table (#4108) by @Colleague Riley +[rcore][RGFW] REVIEWED: Fix MSVC build errors (#4441) by @Colleague Riley [rlgl] ADDED: More uniform data type options #4137 by @Ray [rlgl] ADDED: Vertex normals for RLGL immediate drawing mode (#3866) by @bohonghuang [rlgl] ADDED: `rlCullDistance*()` variables and getters (#3912) by @KotzaBoss @@ -123,6 +131,7 @@ WIP: Last update with commit from 21-Oct-2024 [rlgl] REVIEWED: `rlMultMatrixf()`, fix matrix multiplication order (#3935) by @bohonghuang [rlgl] REVIEWED: `rlSetVertexAttribute()`, define last parameter as offset #3800 by @Ray [rlgl] REVIEWED: `rlDisableVertexAttribute()`, remove redundat calls for SHADER_LOC_VERTEX_COLOR (#3871) by @Kacper Zybała +[rlgl] REVIEWED: `rlLoadTextureCubemap()`, load mipmaps for cubemaps (#4429) by @Nikolas [rlgl] REVIEWED: `rlLoadFramebuffer()`, parameters not required by @Ray [rlgl] REVIEWED: `rlSetUniformSampler()` (#3759) by @veins1 [rlgl] REVIEWED: Renamed near/far variables (#4039) by @jgabaut @@ -132,7 +141,8 @@ WIP: Last update with commit from 21-Oct-2024 [rlgl] REVIEWED: rlgl function description and comments by @Ray [rlgl] REVIEWED: Expose glad functions when building raylib as a shared lib (#3572) by @Peter0x44 [rlgl] REVIEWED: Fix version info in rlgl.h (#3558) by @Steven Schveighoffer -[rcamera] REVIEWED: Make camera movement independant of framerate (#4247) by @hanaxars -WARNING- +[rlgl] REVIEWED: Use the vertex color to the base shader in GLSL330 (#4431) by @Jeffery Myers +[rcamera] REVIEWED: Make camera movement independant of framerate (#4247) by @hanaxars -WARNING- [rcamera] REVIEWED: Updated camera speeds with GetFrameTime() (#4362) by @Anthony Carbajal [rcamera] REVIEWED: `UpdateCamera()`, added CAMERA_CUSTOM check (#3938) by @Tomas Fabrizio Orsi [rcamera] REVIEWED: Support mouse/keyboard and gamepad coexistence for input (#3579) by @ubkp @@ -152,8 +162,10 @@ WIP: Last update with commit from 21-Oct-2024 [rshapes] REVIEWED: `DrawLine()` #4075 by @Ray [rshapes] REVIEWED: `DrawPixel()` drawing by @Ray [rshapes] REVIEWED: `DrawLine()` to avoid pixel rounding issues #3931 by @Ray -[rshapes] REVIEWED: `DrawRectangleLinesEx()`, make sure accounts for square tiles (#4382) by @Jojaby +[rshapes] REVIEWED: `DrawRectangleLines()`, considering view matrix for lines "alignment" by @Ray +[rshapes] REVIEWED: `DrawRectangleLines()`, pixel offset (#4261) by @RadsammyT [rshapes] REVIEWED: `DrawRectangleLines()`, pixel offset when scaling (#3884) by @Ray +[rshapes] REVIEWED: `DrawRectangleLinesEx()`, make sure accounts for square tiles (#4382) by @Jojaby [rshapes] REVIEWED: `Draw*Gradient()` color parameter names (#4270) by @Paperdomo101 [rshapes] REVIEWED: `DrawGrid()`, remove duplicate color calls (#4148) by @Jeffery Myers [rshapes] REVIEWED: `DrawSplineLinear()` to `SUPPORT_SPLINE_MITERS` by @Ray @@ -177,7 +189,9 @@ WIP: Last update with commit from 21-Oct-2024 [rtextures] REVIEWED: `LoadImageRaw()` #3926 by @Ray [rtextures] REVIEWED: `LoadImageColors()`, advance k in loop (#4120) by @Bruno Cabral [rtextures] REVIEWED: `LoadTextureCubemap()`, added `mipmaps` #3665 by @Ray -[rtextures] REVIEWED: `LoadTextureCubemap(), assign format to cubemap (#3823) by @Gary M +[rtextures] REVIEWED: `LoadTextureCubemap()`, assign format to cubemap (#3823) by @Gary M +[rtextures] REVIEWED: `LoadTextureCubemap()`, load mipmaps for cubemaps (#4429) by @Nikolas +[rtextures] REVIEWED: `LoadTextureCubemap()`, avoid dangling re-allocated pointers (#4439) by @Nikolas [rtextures] REVIEWED: `LoadImageFromScreen()`, fix scaling (#3881) by @proberge-dev [rtextures] REVIEWED: `LoadImageFromMemory()`, warnings on invalid image data (#4179) by @Jutastre [rtextures] REVIEWED: `LoadImageAnimFromMemory()`, added security checks (#3924) by @Ray @@ -190,6 +204,8 @@ WIP: Last update with commit from 21-Oct-2024 [rtextures] REVIEWED: `GenImagePerlinNoise()` being stretched (#4276) by @Bugsia [rtextures] REVIEWED: `DrawTexturePro()` to avoid negative dest rec #4316 by @Ray [rtextures] REVIEWED: `ColorToInt()`, fix undefined behaviour (#3996) by @OetkenPurveyorOfCode +[rtextures] REVIEWED: Remove panorama cubemap layout option (#4425) by @Jeffery Myers +[rtextures] REVIEWED: Removed unneeded module check, `rtextures` should not depend on `rtext` by @Ray [rtextures] REVIEWED: Simplified for loop for some image manipulation functions (#3712) by @Alice Nyaa [rtext] ADDED: BDF fonts support (#3735) by @Stanley Fuller -WARNING- [rtext] ADDED: `TextToCamel()` (#4033) by @IoIxD @@ -207,6 +223,7 @@ WIP: Last update with commit from 21-Oct-2024 [rtext] REVIEWED: `LoadFontData()`, load image only if glyph has been found in font by @Ray [rtext] REVIEWED: `ExportFontAsCode()`, fix C++ compiler errors (#4013) by @DarkAssassin23 [rtext] REVIEWED: `MeasureTextEx()` height calculation (#3770) by @Marrony Neris +[rtext] REVIEWED: `MeasureTextEx()`, additional check for empty input string (#4448) by @mpv-enjoyer [rtext] REVIEWED: `CodepointToUTF8()`, clean static buffer #4379 by @Ray [rtext] REVIEWED: `TextToFloat()`, always multiply by sign (#4273) by @listeria [rtext] REVIEWED: `TextReplace()` const correctness (#3678) by @maverikou @@ -237,6 +254,7 @@ WIP: Last update with commit from 21-Oct-2024 [rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, added missing interpolation types (#3919) by @Benji [rmodels] REVIEWED: `LoadModelAnimationsGLTF()` (#4107) by @VitoTringolo [rmodels] REVIEWED: `LoadBoneInfoGLTF()`, add check for animation name being NULL (#4053) by @VitoTringolo +[rmodels] REVIEWED: `GenMeshSphere()`, fix artifacts (#4460) by @MikiZX1 [rmodels] REVIEWED: `GenMeshTangents()`, read uninitialized values, fix bounding case (#4066) by @kai-z99 [rmodels] REVIEWED: `GenMeshTangents()`, fixed out of bounds error (#3990) by @Salvador Galindo [rmodels] REVIEWED: `DrawCylinder()`, fix drawing due to imprecise angle (#4034) by @Paul Melis @@ -258,6 +276,8 @@ WIP: Last update with commit from 21-Oct-2024 [raudio] REVIEWED: Fix crash when switching playback device at runtime (#4102) by @jkaup [raudio] REVIEWED: Support 24 bits samples for FLAC format (#4058) by @Alexey Kutepov [examples] ADDED: `core_random_sequence` (#3846) by @Dalton Overmyer +[examples] ADDED: `core_input_virtual_controls` (#4342) by @oblerion +[examples] ADDED: `shapes_rectangle_advanced `, implementing `DrawRectangleRoundedGradientH()` (#4435) by @Everton Jr. [examples] ADDED: `models_bone_socket` (#3833) by @iP [examples] ADDED: `shaders_vertex_displacement` (#4186) by @Alex ZH [examples] ADDED: `shaders_shadowmap` (#3653) by @TheManTheMythTheGameDev @@ -265,6 +285,8 @@ WIP: Last update with commit from 21-Oct-2024 [examples] REVIEWED: `core_2d_camera_mouse_zoom`, use logarithmic scaling for a 2d zoom functionality (#3977) by @Mike Will [examples] REVIEWED: `core_input_gamepad_info`, all buttons displayed within the window (#4241) by @Asdqwe [examples] REVIEWED: `core_input_gamepad_info`, show ps3 controller (#4040) by @Konrad Gutvik Grande +[examples] REVIEWED: `core_input_gamepad`, add drawing for generic gamepad (#4424) by @Asdqwe +[examples] REVIEWED: `core_input_gamepad`, add deadzone handling (#4422) by @Asdqwe [examples] REVIEWED: `shapes_bouncing_ball` (#4226) by @Anthony Carbajal [examples] REVIEWED: `shapes_following_eyes` (#3710) by @Hongyu Ouyang [examples] REVIEWED: `shapes_draw_rectangle_rounded` by @Ray @@ -288,6 +310,8 @@ WIP: Last update with commit from 21-Oct-2024 [examples] REVIEWED: `shaders_basic_pbr` (#3621) by @devdad [examples] REVIEWED: `shaders_basic_pbr`, remove dependencies (#3649) by @TheManTheMythTheGameDev [examples] REVIEWED: `shaders_basic_pbr`, added more comments by @Ray +[examples] REVIEWED: `shaders_gpu_skinning`, to work with OpenGL ES 2.0 #4412 by @Ray +[examples] REVIEWED: `shaders_model_shader`, use free camera (#4428) by @IcyLeave6109 [examples] REVIEWED: `audio_stream_effects` (#3618) by @lipx [examples] REVIEWED: `audio_raw_stream` (#3624) by @riadbettole [examples] REVIEWED: `audio_mixed_processor` (#4214) by @Anthony Carbajal @@ -302,10 +326,15 @@ WIP: Last update with commit from 21-Oct-2024 [build] REVIEWED: Makefile, fix -Wstringop-truncation warning (#4096) by @Peter0x44 [build] REVIEWED: Makefile, fix issues for RGFW on Linux/macOS (#3969) by @Colleague Riley [build] REVIEWED: Makefile, update RAYLIB_VERSION (#3901) by @Belllg -[build] REVIEWED: Makefile (#4054) by @Lázaro Albuquerque +[build] REVIEWED: Makefile, use mingw32-make for Windows (#4436) by @Asdqwe +[build] REVIEWED: Makefile, move CUSTOM_CFLAGS for better visibility (#4054) by @Lázaro Albuquerque +[build] REVIEWED: Makefile, update emsdk paths to latest versions by @Ray [build] REVIEWED: Makefile examples, align /usr/local with /src Makefile (#4286) by @Tchan0 [build] REVIEWED: Makefile examples, added `textures_image_kernel` (#3555) by @Sergey Zapunidi [build] REVIEWED: Makefile examples (#4209) by @Anthony Carbajal +[build] REVIEWED: Makefile examples, to work on NetBSD (#4438) by @NishiOwO +[build] REVIEWED: Makefile examples, WebGL2 (OpenGL ES 3.0) backend flags #4330 by @Ray +[build] REVIEWED: Makefile examples, web building (#4434) by @Asdqwe [build] REVIEWED: build.zig, fix various issues around `-Dconfig` (#4398) by @Sage Hane [build] REVIEWED: build.zig, fix type mismatch (#4383) by @yuval_dev [build] REVIEWED: build.zig, minor fixes (#4381) by @Sage Hane @@ -351,6 +380,7 @@ WIP: Last update with commit from 21-Oct-2024 [build] REVIEWED: CMake, disable SDL rlgl_standalone example (#3861) by @Rob Loach [build] REVIEWED: CMake, bump version required to avoid deprecated #3639 by @Ray [build] REVIEWED: CMake, fix examples linking -DPLATFORM=SDL (#3825) by @Peter0x44 +[build] REVIEWED: CMake, don't build for wayland by default (#4432) by @Peter0x44 [build] REVIEWED: VS2022 project by @Ray [build] REVIEWED: VS2022, fix build warnings (#4095) by @Jeffery Myers [build] REVIEWED: Fix fix-build-paths (#3849) by @Caleb Barger @@ -406,6 +436,13 @@ WIP: Last update with commit from 21-Oct-2024 [bindings] UPDATED: Raylib.nelua (#3552) by @Auz [bindings] UPDATED: raylib-cpp to 5.0 (#3551) by @Rob Loach [bindings] UPDATED: Pascal binding (#3548) by @Gunko Vadim +[external] UPDATED: stb_truetype.h to latest version by @Ray +[external] UPDATED: stb_image_resize2.h to latest version by @Ray +[external] UPDATED: stb_image.h to latest version by @Ray +[external] UPDATED: qoa.h to latest version by @Ray +[external] UPDATED: dr_wav.h to latest version by @Ray +[external] UPDATED: dr_mp3.h to latest version by @Ray +[external] UPDATED: cgltf.h to latest version by @Ray [external] REVIEWED: rl_gputex, correctly load mipmaps from DDS files (#4399) by @Nikolas [external] REVIEWED: stb_image_resize2, dix vld1q_f16 undeclared in arm (#4309) by @masnm [external] REVIEWED: miniaudio, fix library and Makefile for NetBSD (#4212) by @NishiOwO From be360d2ad18707887b3e556da5e50c334c234505 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 3 Nov 2024 13:12:01 +0100 Subject: [PATCH 003/194] RENAMED: `UpdateModelAnimationBoneMatrices()` to `UpdateModelAnimationBones()` Still, not fully convinced of those functions naming, despite quite descriptive, sounds a bit confusing to me... --- examples/models/models_gpu_skinning.c | 2 +- src/raylib.h | 2 +- src/rmodels.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/models/models_gpu_skinning.c b/examples/models/models_gpu_skinning.c index 7e81b0d82..98bf09922 100644 --- a/examples/models/models_gpu_skinning.c +++ b/examples/models/models_gpu_skinning.c @@ -82,7 +82,7 @@ int main(void) ModelAnimation anim = modelAnimations[animIndex]; animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount; characterModel.transform = MatrixTranslate(position.x, position.y, position.z); - UpdateModelAnimationBoneMatrices(characterModel, anim, animCurrentFrame); + UpdateModelAnimationBones(characterModel, anim, animCurrentFrame); //---------------------------------------------------------------------------------- // Draw diff --git a/src/raylib.h b/src/raylib.h index c9d9f6e54..e0822bb7d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1602,7 +1602,7 @@ RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Model animations loading/unloading functions RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose (CPU) -RLAPI void UpdateModelAnimationBoneMatrices(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning) +RLAPI void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning) RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match diff --git a/src/rmodels.c b/src/rmodels.c index 40e0182ad..daabbe209 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1508,7 +1508,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform) #ifdef RL_SUPPORT_MESH_GPU_SKINNING // Upload Bone Transforms - if (material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1 && mesh.boneMatrices) + if ((material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1) && mesh.boneMatrices) { rlSetUniformMatrices(material.shader.locs[SHADER_LOC_BONE_MATRICES], mesh.boneMatrices, mesh.boneCount); } @@ -1754,7 +1754,7 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i #ifdef RL_SUPPORT_MESH_GPU_SKINNING // Upload Bone Transforms - if (material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1 && mesh.boneMatrices) + if ((material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1) && mesh.boneMatrices) { rlSetUniformMatrices(material.shader.locs[SHADER_LOC_BONE_MATRICES], mesh.boneMatrices, mesh.boneCount); } @@ -2367,7 +2367,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) // Update model animated bones transform matrices for a given frame // NOTE: Updated data is not uploaded to GPU but kept at model.meshes[i].boneMatrices[boneId], // to be uploaded to shader at drawing, in case GPU skinning is enabled -void UpdateModelAnimationBoneMatrices(Model model, ModelAnimation anim, int frame) +void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) { if ((anim.frameCount > 0) && (anim.bones != NULL) && (anim.framePoses != NULL)) { From 6028052c7eb0a0702423f8a4b0625bca1ad5b731 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 3 Nov 2024 12:12:25 +0000 Subject: [PATCH 004/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 2 +- parser/output/raylib_api.lua | 2 +- parser/output/raylib_api.txt | 4 ++-- parser/output/raylib_api.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 37b0a16a6..8f5a6c826 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -11087,7 +11087,7 @@ ] }, { - "name": "UpdateModelAnimationBoneMatrices", + "name": "UpdateModelAnimationBones", "description": "Update model animation mesh bone matrices (GPU skinning)", "returnType": "void", "params": [ diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 934c08eb7..f532cd0d5 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -7607,7 +7607,7 @@ return { } }, { - name = "UpdateModelAnimationBoneMatrices", + name = "UpdateModelAnimationBones", description = "Update model animation mesh bone matrices (GPU skinning)", returnType = "void", params = { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 541b5caf3..f45217ac6 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -4221,8 +4221,8 @@ Function 502: UpdateModelAnimation() (3 input parameters) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 503: UpdateModelAnimationBoneMatrices() (3 input parameters) - Name: UpdateModelAnimationBoneMatrices +Function 503: UpdateModelAnimationBones() (3 input parameters) + Name: UpdateModelAnimationBones Return type: void Description: Update model animation mesh bone matrices (GPU skinning) Param[1]: model (type: Model) diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 58794b4eb..20cb502d8 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -2826,7 +2826,7 @@ - + From 66a4f2e90b62d0f322e2b39b1459b148f1c4079b Mon Sep 17 00:00:00 2001 From: waveydave Date: Sun, 3 Nov 2024 19:36:32 +0000 Subject: [PATCH 005/194] Fix for issue 4454, MatrixDecompose() gave incorrect output for certain combinations of scale and rotation (#4461) --- src/raymath.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/raymath.h b/src/raymath.h index d1b5ab01e..e522113b1 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -2569,7 +2569,13 @@ RMAPI void MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotatio if (!FloatEquals(det, 0)) { clone.m0 /= s.x; + clone.m4 /= s.x; + clone.m8 /= s.x; + clone.m1 /= s.y; clone.m5 /= s.y; + clone.m9 /= s.y; + clone.m2 /= s.z; + clone.m6 /= s.z; clone.m10 /= s.z; // Extract rotation From ec953240b1023d39b0f5219ee9cc8b56f1fc454f Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 3 Nov 2024 21:02:13 +0100 Subject: [PATCH 006/194] Update CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 1f68fc46f..e0403dd63 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -155,6 +155,7 @@ WIP: Last update with commit from 02-Nov-2024 [raymath] REVIEWED: Add extern "C" to raymath header for C++ (#3978) by @Jeffery Myers [raymath] REVIEWED: `QuaternionFromAxisAngle()`, remove redundant axis length calculation (#3900) by @jtainer [raymath] REVIEWED: `Vector3Perpendicular()`, avoid implicit conversion from float to double (#3799) by @João Foscarini +[raymath] REVIEWED: `MatrixDecompose()`, incorrect output for certain scale and rotations (#4461) by @waveydave [raymath] REVIEWED: Small code refactor (#3753) by @Idir Carlos Aliane [rshapes] ADDED: `CheckCollisionCircleLine()` (#4018) by @kai-z99 [rshapes] REVIEWED: Multisegment Bezier splines (#3744) by @Santiago Pelufo From 281ee51aff02c9e454891b75d6fdfead8ffccb0f Mon Sep 17 00:00:00 2001 From: decromo Date: Mon, 4 Nov 2024 15:57:50 +0100 Subject: [PATCH 007/194] implemented new linear gradient generation function (#4462) --- src/rtextures.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index 92186dd96..c798bdcbf 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -827,16 +827,27 @@ Image GenImageGradientLinear(int width, int height, int direction, Color start, float cosDir = cosf(radianDirection); float sinDir = sinf(radianDirection); + // Calculate how far the top-left pixel is along the gradient direction from the center of said gradient + float startingPos = 0.5 - (cosDir*width/2) - (sinDir*height/2); + // With directions that lie in the first or third quadrant (i.e. from top-left to + // bottom-right or vice-versa), pixel (0, 0) is the farthest point on the gradient + // (i.e. the pixel which should become one of the gradient's ends color); while for + // directions that lie in the second or fourth quadrant, that point is pixel (width, 0). + float maxPosValue = + ((signbit(sinDir) != 0) == (signbit(cosDir) != 0)) + ? fabs(startingPos) + : fabs(startingPos+width*cosDir); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { // Calculate the relative position of the pixel along the gradient direction - float pos = (i*cosDir + j*sinDir)/(width*cosDir + height*sinDir); + float pos = (startingPos + (i*cosDir + j*sinDir)) / maxPosValue; float factor = pos; - factor = (factor > 1.0f)? 1.0f : factor; // Clamp to [0,1] - factor = (factor < 0.0f)? 0.0f : factor; // Clamp to [0,1] + factor = (factor > 1.0f)? 1.0f : factor; // Clamp to [-1,1] + factor = (factor < -1.0f)? -1.0f : factor; // Clamp to [-1,1] + factor = factor / 2 + 0.5f; // Generate the color for this pixel pixels[j*width + i].r = (int)((float)end.r*factor + (float)start.r*(1.0f - factor)); From b47fffb48bfeb6a73060c5fb8847d8db2879110c Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 5 Nov 2024 00:09:12 +0100 Subject: [PATCH 008/194] Update Makefile.Web --- examples/Makefile.Web | 44 +++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 250145053..7ea7f4784 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -1,6 +1,6 @@ #************************************************************************************************** # -# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5 +# raylib makefile for Web platform # # Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) # @@ -30,9 +30,12 @@ PLATFORM ?= PLATFORM_WEB # Define required raylib variables PROJECT_NAME ?= raylib_examples -RAYLIB_VERSION ?= 5.0.0 +RAYLIB_VERSION ?= 5.5.0 RAYLIB_PATH ?= .. +# Define raylib source code path +RAYLIB_SRC_PATH ?= ../src + # Locations of raylib.h and libraylib.a/libraylib.so # NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD DESTDIR ?= /usr/local @@ -52,6 +55,11 @@ USE_EXTERNAL_GLFW ?= FALSE # NOTE: This variable is only used for PLATFORM_OS: LINUX USE_WAYLAND_DISPLAY ?= FALSE +# PLATFORM_WEB: Default properties +BUILD_WEB_ASYNCIFY ?= TRUE +BUILD_WEB_SHELL ?= $(RAYLIB_PATH)/src/shell.html +BUILD_WEB_HEAP_SIZE ?= 134217728 + # Use WebGL2 backend (OpenGL 3.0) # WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3 USE_WEBGL2 ?= FALSE @@ -266,13 +274,17 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) - # -sEXPORTED_RUNTIME_METHODS=ccall # require exporting some LEGACY_RUNTIME functions, ccall() is required by miniaudio # -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading # --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 # --source-map-base # allow debugging in browser with source map - LDFLAGS += -sUSE_GLFW=3 -sASYNCIFY -sEXPORTED_RUNTIME_METHODS=ccall + LDFLAGS += -sUSE_GLFW=3 -sEXPORTED_RUNTIME_METHODS=ccall + + # Build using asyncify + ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) + LDFLAGS += -sASYNCIFY + endif # NOTE: Flags required for WebGL 2.0 (OpenGL ES 3.0) # WARNING: Requires raylib compiled with GRAPHICS_API_OPENGL_ES3 @@ -280,17 +292,20 @@ ifeq ($(PLATFORM),PLATFORM_WEB) LDFLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 endif + # Add debug mode flags if required + ifeq ($(BUILD_MODE),DEBUG) + LDFLAGS += -sASSERTIONS=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. - # NOTE: Additional compilate flags for TOTAL_MEMORY, FORCE_FILESYSTEM and resources loading - # are specified per-example for optimization - - # Define a custom shell .html and output extension - LDFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html - EXT = .html endif # Define libraries required on linking: LDLIBS @@ -332,7 +347,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling # NOTE: Required packages: mesa-libs - LDLIBS = -lraylib -lGL -lpthread -lm + LDFLAGS += -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib + LDLIBS = -lraylib -lGL -lm -lpthread # On XWindow requires also below libraries LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor @@ -408,7 +424,8 @@ SHAPES = \ shapes/shapes_logo_raylib_anim \ shapes/shapes_rectangle_scaling \ shapes/shapes_splines_drawing \ - shapes/shapes_top_down_lights + shapes/shapes_top_down_lights \ + shapes/shapes_rectangle_advanced TEXTURES = \ textures/textures_background_scrolling \ @@ -417,6 +434,7 @@ TEXTURES = \ textures/textures_draw_tiled \ textures/textures_fog_of_war \ textures/textures_gif_player \ + textures/textures_image_channel \ textures/textures_image_drawing \ textures/textures_image_generation \ textures/textures_image_kernel \ @@ -455,6 +473,7 @@ MODELS = \ models/models_animation \ models/models_gpu_skinning \ models/models_billboard \ + models/models_bone_socket \ models/models_box_collisions \ models/models_cubicmap \ models/models_draw_cube_texture \ @@ -476,6 +495,7 @@ MODELS = \ SHADERS = \ shaders/shaders_basic_lighting \ + shaders/shaders_basic_pbr \ shaders/shaders_custom_uniform \ shaders/shaders_deferred_render \ shaders/shaders_eratosthenes \ From a617e1e217fa3d78e1d3d4e7d0bc4266c88a6dd4 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 6 Nov 2024 12:00:39 +0100 Subject: [PATCH 009/194] Update core_2d_camera_mouse_zoom.c --- examples/core/core_2d_camera_mouse_zoom.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/examples/core/core_2d_camera_mouse_zoom.c b/examples/core/core_2d_camera_mouse_zoom.c index 8af94440d..a9864b168 100644 --- a/examples/core/core_2d_camera_mouse_zoom.c +++ b/examples/core/core_2d_camera_mouse_zoom.c @@ -45,7 +45,7 @@ int main () else if (IsKeyPressed(KEY_TWO)) zoomMode = 1; // Translate based on mouse right click - if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) { Vector2 delta = GetMouseDelta(); delta = Vector2Scale(delta, -1.0f/camera.zoom); @@ -76,8 +76,8 @@ int main () } else { - // Zoom based on mouse left click - if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) + // Zoom based on mouse right click + if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) { // Get the world point that is under the mouse Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera); @@ -89,7 +89,7 @@ int main () // under the cursor to the screen space point under the cursor at any zoom camera.target = mouseWorldPos; } - if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) + if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) { // Zoom increment float deltaX = GetMouseDelta().x; @@ -119,10 +119,16 @@ int main () DrawCircle(GetScreenWidth()/2, GetScreenHeight()/2, 50, MAROON); EndMode2D(); + + // Draw mouse reference + //Vector2 mousePos = GetWorldToScreen2D(GetMousePosition(), camera) + DrawCircleV(GetMousePosition(), 4, DARKGRAY); + DrawTextEx(GetFontDefault(), TextFormat("[%i, %i]", GetMouseX(), GetMouseY()), + Vector2Add(GetMousePosition(), (Vector2){ -44, -24 }), 20, 2, BLACK); DrawText("[1][2] Select mouse zoom mode (Wheel or Move)", 20, 20, 20, DARKGRAY); - if (zoomMode == 0) DrawText("Mouse right button drag to move, mouse wheel to zoom", 20, 50, 20, DARKGRAY); - else DrawText("Mouse right button drag to move, mouse press and move to zoom", 20, 50, 20, DARKGRAY); + if (zoomMode == 0) DrawText("Mouse left button drag to move, mouse wheel to zoom", 20, 50, 20, DARKGRAY); + else DrawText("Mouse left button drag to move, mouse press and move to zoom", 20, 50, 20, DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- From 55a64f51b805d158020b74fda3c507ab7510478a Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Thu, 7 Nov 2024 12:42:59 -0800 Subject: [PATCH 010/194] fix float casting warnings (#4471) --- src/rtextures.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index c798bdcbf..2d269d7f3 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -828,15 +828,15 @@ Image GenImageGradientLinear(int width, int height, int direction, Color start, float sinDir = sinf(radianDirection); // Calculate how far the top-left pixel is along the gradient direction from the center of said gradient - float startingPos = 0.5 - (cosDir*width/2) - (sinDir*height/2); + float startingPos = 0.5f - (cosDir*width/2) - (sinDir*height/2); // With directions that lie in the first or third quadrant (i.e. from top-left to // bottom-right or vice-versa), pixel (0, 0) is the farthest point on the gradient // (i.e. the pixel which should become one of the gradient's ends color); while for // directions that lie in the second or fourth quadrant, that point is pixel (width, 0). float maxPosValue = ((signbit(sinDir) != 0) == (signbit(cosDir) != 0)) - ? fabs(startingPos) - : fabs(startingPos+width*cosDir); + ? fabsf(startingPos) + : fabsf(startingPos+width*cosDir); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) From dc489786b022bc7bc5de7a3fa4cadc0881916dce Mon Sep 17 00:00:00 2001 From: Jett <30197659+JettMonstersGoBoom@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:28:39 -0500 Subject: [PATCH 011/194] UpdateModelAnimation speedup (#4470) If we borrow from the GPU skinned animation code, we can just multiply the vertex by the matrix * weight and shave a chunk of CPU time. --- src/rmodels.c | 162 +++++++++++++++++++------------------------------- 1 file changed, 60 insertions(+), 102 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index daabbe209..6ddb53ae4 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2262,108 +2262,6 @@ ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount) return animations; } -// Update model animated vertex data (positions and normals) for a given frame -// NOTE: Updated data is uploaded to GPU -void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) -{ - if ((anim.frameCount > 0) && (anim.bones != NULL) && (anim.framePoses != NULL)) - { - if (frame >= anim.frameCount) frame = frame%anim.frameCount; - - for (int m = 0; m < model.meshCount; m++) - { - Mesh mesh = model.meshes[m]; - - if (mesh.boneIds == NULL || mesh.boneWeights == NULL) - { - TRACELOG(LOG_WARNING, "MODEL: UpdateModelAnimation(): Mesh %i has no connection to bones", m); - continue; - } - - bool updated = false; // Flag to check when anim vertex information is updated - Vector3 animVertex = { 0 }; - Vector3 animNormal = { 0 }; - - Vector3 inTranslation = { 0 }; - Quaternion inRotation = { 0 }; - // Vector3 inScale = { 0 }; - - Vector3 outTranslation = { 0 }; - Quaternion outRotation = { 0 }; - Vector3 outScale = { 0 }; - - int boneId = 0; - int boneCounter = 0; - float boneWeight = 0.0; - - const int vValues = mesh.vertexCount*3; - for (int vCounter = 0; vCounter < vValues; vCounter += 3) - { - mesh.animVertices[vCounter] = 0; - mesh.animVertices[vCounter + 1] = 0; - mesh.animVertices[vCounter + 2] = 0; - - if (mesh.animNormals != NULL) - { - mesh.animNormals[vCounter] = 0; - mesh.animNormals[vCounter + 1] = 0; - mesh.animNormals[vCounter + 2] = 0; - } - - // Iterates over 4 bones per vertex - for (int j = 0; j < 4; j++, boneCounter++) - { - boneWeight = mesh.boneWeights[boneCounter]; - - // Early stop when no transformation will be applied - if (boneWeight == 0.0f) continue; - - boneId = mesh.boneIds[boneCounter]; - //int boneIdParent = model.bones[boneId].parent; - inTranslation = model.bindPose[boneId].translation; - inRotation = model.bindPose[boneId].rotation; - //inScale = model.bindPose[boneId].scale; - outTranslation = anim.framePoses[frame][boneId].translation; - outRotation = anim.framePoses[frame][boneId].rotation; - outScale = anim.framePoses[frame][boneId].scale; - - // Vertices processing - // NOTE: We use meshes.vertices (default vertex position) to calculate meshes.animVertices (animated vertex position) - animVertex = (Vector3){ mesh.vertices[vCounter], mesh.vertices[vCounter + 1], mesh.vertices[vCounter + 2] }; - animVertex = Vector3Subtract(animVertex, inTranslation); - animVertex = Vector3Multiply(animVertex, outScale); - animVertex = Vector3RotateByQuaternion(animVertex, QuaternionMultiply(outRotation, QuaternionInvert(inRotation))); - animVertex = Vector3Add(animVertex, outTranslation); - //animVertex = Vector3Transform(animVertex, model.transform); - mesh.animVertices[vCounter] += animVertex.x*boneWeight; - mesh.animVertices[vCounter + 1] += animVertex.y*boneWeight; - mesh.animVertices[vCounter + 2] += animVertex.z*boneWeight; - updated = true; - - // Normals processing - // NOTE: We use meshes.baseNormals (default normal) to calculate meshes.normals (animated normals) - if (mesh.normals != NULL) - { - animNormal = (Vector3){ mesh.normals[vCounter], mesh.normals[vCounter + 1], mesh.normals[vCounter + 2] }; - animNormal = Vector3RotateByQuaternion(animNormal, QuaternionMultiply(outRotation, QuaternionInvert(inRotation))); - mesh.animNormals[vCounter] += animNormal.x*boneWeight; - mesh.animNormals[vCounter + 1] += animNormal.y*boneWeight; - mesh.animNormals[vCounter + 2] += animNormal.z*boneWeight; - } - } - } - - // Upload new vertex data to GPU for model drawing - // NOTE: Only update data when values changed - if (updated) - { - rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position - rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals - } - } - } -} - // Update model animated bones transform matrices for a given frame // NOTE: Updated data is not uploaded to GPU but kept at model.meshes[i].boneMatrices[boneId], // to be uploaded to shader at drawing, in case GPU skinning is enabled @@ -2411,6 +2309,66 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) } } +// at least 2x speed up vs the old method +// Update model animated vertex data (positions and normals) for a given frame +// NOTE: Updated data is uploaded to GPU +void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) +{ + UpdateModelAnimationBones(model,anim,frame); + for (int m = 0; m < model.meshCount; m++) + { + Mesh mesh = model.meshes[m]; + Vector3 animVertex = { 0 }; + Vector3 animNormal = { 0 }; + int boneId = 0; + int boneCounter = 0; + float boneWeight = 0.0; + bool updated = false; // Flag to check when anim vertex information is updated + const int vValues = mesh.vertexCount*3; + for (int vCounter = 0; vCounter < vValues; vCounter += 3) + { + mesh.animVertices[vCounter] = 0; + mesh.animVertices[vCounter + 1] = 0; + mesh.animVertices[vCounter + 2] = 0; + if (mesh.animNormals != NULL) + { + mesh.animNormals[vCounter] = 0; + mesh.animNormals[vCounter + 1] = 0; + mesh.animNormals[vCounter + 2] = 0; + } + // Iterates over 4 bones per vertex + for (int j = 0; j < 4; j++, boneCounter++) + { + boneWeight = mesh.boneWeights[boneCounter]; + boneId = mesh.boneIds[boneCounter]; + // Early stop when no transformation will be applied + if (boneWeight == 0.0f) continue; + animVertex = (Vector3){ mesh.vertices[vCounter], mesh.vertices[vCounter + 1], mesh.vertices[vCounter + 2] }; + animVertex = Vector3Transform(animVertex,model.meshes[m].boneMatrices[boneId]); + mesh.animVertices[vCounter] += animVertex.x * boneWeight; + mesh.animVertices[vCounter+1] += animVertex.y * boneWeight; + mesh.animVertices[vCounter+2] += animVertex.z * boneWeight; + updated = true; + // Normals processing + // NOTE: We use meshes.baseNormals (default normal) to calculate meshes.normals (animated normals) + if (mesh.normals != NULL) + { + animNormal = (Vector3){ mesh.normals[vCounter], mesh.normals[vCounter + 1], mesh.normals[vCounter + 2] }; + animNormal = Vector3Transform(animNormal,model.meshes[m].boneMatrices[boneId]); + mesh.animNormals[vCounter] += animNormal.x*boneWeight; + mesh.animNormals[vCounter + 1] += animNormal.y*boneWeight; + mesh.animNormals[vCounter + 2] += animNormal.z*boneWeight; + } + } + } + if (updated) + { + rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position + rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals + } + } +} + // Unload animation array data void UnloadModelAnimations(ModelAnimation *animations, int animCount) { From 53b929cbfb50300a4b1e3bfd7986ee091b0d2dcf Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Fri, 8 Nov 2024 14:31:31 +0100 Subject: [PATCH 012/194] Improve cross-compilation with zig builds (#4468) - Add xcode_frameworks when cross compiling for mac (ref: https://github.com/hexops/mach/blob/main/build.zig) - Add emsdk when cross compiling for wasm (ref: https://github.com/floooh/sokol-zig/blob/master/build.zig) Signed-off-by: Tomas Slusny --- build.zig | 55 ++++++++++++++++++++++++++++++++++++++++----------- build.zig.zon | 24 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 build.zig.zon diff --git a/build.zig b/build.zig index 75a77dd51..c5e2f718b 100644 --- a/build.zig +++ b/build.zig @@ -2,7 +2,7 @@ const std = @import("std"); const builtin = @import("builtin"); /// Minimum supported version of Zig -const min_ver = "0.12.0"; +const min_ver = "0.13.0"; comptime { const order = std.SemanticVersion.order; @@ -15,7 +15,7 @@ comptime { // get the flags a second time when adding raygui var raylib_flags_arr: std.ArrayListUnmanaged([]const u8) = .{}; -// This has been tested with zig version 0.12.0 +// This has been tested with zig version 0.13.0 pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile { const raylib_dep = b.dependencyFromBuildZig(@This(), .{ .target = target, @@ -52,6 +52,30 @@ fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend } } +fn createEmsdkStep(b: *std.Build, emsdk: *std.Build.Dependency) *std.Build.Step.Run { + if (builtin.os.tag == .windows) { + return b.addSystemCommand(&.{emsdk.path("emsdk.bat").getPath(b)}); + } else { + return b.addSystemCommand(&.{emsdk.path("emsdk").getPath(b)}); + } +} + +fn emSdkSetupStep(b: *std.Build, emsdk: *std.Build.Dependency) !?*std.Build.Step.Run { + const dot_emsc_path = emsdk.path(".emscripten").getPath(b); + const dot_emsc_exists = !std.meta.isError(std.fs.accessAbsolute(dot_emsc_path, .{})); + + if (!dot_emsc_exists) { + const emsdk_install = createEmsdkStep(b, emsdk); + emsdk_install.addArgs(&.{ "install", "latest" }); + const emsdk_activate = createEmsdkStep(b, emsdk); + emsdk_activate.addArgs(&.{ "activate", "latest" }); + emsdk_activate.step.dependOn(&emsdk_install.step); + return emsdk_activate; + } else { + return null; + } +} + /// A list of all flags from `src/config.h` that one may override const config_h_flags = outer: { // Set this value higher if compile errors happen as `src/config.h` gets larger @@ -223,6 +247,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. waylandGenerate(b, raylib, "xdg-activation-v1.xml", "xdg-activation-v1-client-protocol"); waylandGenerate(b, raylib, "idle-inhibit-unstable-v1.xml", "idle-inhibit-unstable-v1-client-protocol"); } + setDesktopPlatform(raylib, options.platform); } else { if (options.opengl_version == .auto) { @@ -255,6 +280,13 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. setDesktopPlatform(raylib, options.platform); }, .macos => { + // Include xcode_frameworks for cross compilation + if (b.lazyDependency("xcode_frameworks", .{})) |dep| { + raylib.addSystemFrameworkPath(dep.path("Frameworks")); + raylib.addSystemIncludePath(dep.path("include")); + raylib.addLibraryPath(dep.path("lib")); + } + // On macos rglfw.c include Objective-C files. try raylib_flags_arr.append(b.allocator, "-ObjC"); raylib.root_module.addCSourceFile(.{ @@ -271,20 +303,19 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. setDesktopPlatform(raylib, options.platform); }, .emscripten => { + // Include emscripten for cross compilation + if (b.lazyDependency("emsdk", .{})) |dep| { + if (try emSdkSetupStep(b, dep)) |emSdkStep| { + raylib.step.dependOn(&emSdkStep.step); + } + + raylib.addIncludePath(dep.path("upstream/emscripten/cache/sysroot/include")); + } + raylib.defineCMacro("PLATFORM_WEB", null); if (options.opengl_version == .auto) { raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); } - - if (b.sysroot == null) { - @panic("Pass '--sysroot \"$EMSDK/upstream/emscripten\"'"); - } - - const cache_include = b.pathJoin(&.{ b.sysroot.?, "cache", "sysroot", "include" }); - - var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!"); - dir.close(); - raylib.addIncludePath(.{ .cwd_relative = cache_include }); }, else => { @panic("Unsupported OS"); diff --git a/build.zig.zon b/build.zig.zon new file mode 100644 index 000000000..557028e45 --- /dev/null +++ b/build.zig.zon @@ -0,0 +1,24 @@ +.{ + .name = "raylib", + .version = "5.5.0", + .minimum_zig_version = "0.13.0", + + .dependencies = .{ + .xcode_frameworks = .{ + .url = "git+https://github.com/hexops/xcode-frameworks#a6bf82e032d4d9923ad5c222d466710fcc05f249", + .hash = "12208da4dfcd9b53fb367375fb612ec73f38e53015f1ce6ae6d6e8437a637078e170", + .lazy = true, + }, + .emsdk = .{ + .url = "git+https://github.com/emscripten-core/emsdk#3.1.50", + .hash = "1220e8fe9509f0843e5e22326300ca415c27afbfbba3992f3c3184d71613540b5564", + .lazy = true, + }, + }, + + .paths = .{ + "build.zig", + "build.zig.zon", + "src", + }, +} From 00396e34369a1696180849216c3e5aca264c70e4 Mon Sep 17 00:00:00 2001 From: "Everton Jr." <69195288+evertonse@users.noreply.github.com> Date: Sat, 9 Nov 2024 15:40:41 -0300 Subject: [PATCH 013/194] [rcore] Clipboard Image Support (#4459) * [rcore] add 'GetClipboardImage' for windows * [rcore] GetClipboardImage removed some unneeded defines * [rcore] PLATFORM_SDL: create a compatility layer for SDL3 * external: add win32_clipboard.h header only lib * [rcore] using win32_clipboard on platforms rlfw and rgfw * [rcore] fix warnings in SDL3 compatibility layer * Makefile: Allow specifying SDL_LIBRARIES to link, this helps with SDL3 * Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW * Makefile: examples makefile now compile others/rlgl_standalone only when TARGET_PLATFORM is PLATFORM_DESKTOP_GFLW * [rcore]: PLATFORM_SDL: improve clipboard data retrieval * external: remove unused function from win32_clipboard.h * Makefile: allow for extra flags necessary when compiling for SDL3 * [rcore]: fix string typo * [rcore]: Properly handle NULL dpi passing. As is allowed in SDL2 * external: fix arch finding on win32_clipboard.h to allow compilation on msvc cmake CI * [rcore]: PLATFORM_SDL: Treat monitor as an ID in SDL3 as opposed to an index as in SDL2 * [rcore]: typo --- examples/Makefile | 18 +- src/Makefile | 6 +- src/config.h | 28 +++ src/external/win32_clipboard.h | 374 +++++++++++++++++++++++++++++ src/platforms/rcore_desktop_glfw.c | 32 +++ src/platforms/rcore_desktop_rgfw.c | 37 +++ src/platforms/rcore_desktop_sdl.c | 346 +++++++++++++++++++++++++- src/raylib.h | 1 + src/rcore.c | 6 + 9 files changed, 837 insertions(+), 11 deletions(-) create mode 100644 src/external/win32_clipboard.h diff --git a/examples/Makefile b/examples/Makefile index 304599cf8..a47911b5e 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -87,6 +87,8 @@ USE_EXTERNAL_GLFW ?= FALSE # WARNING: Library is not included in raylib, it MUST be configured by users SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib +SDL_LIBRARIES ?= -lSDL2 -lSDL2main + # 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 @@ -263,9 +265,9 @@ 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 - +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external $(EXTRA_INCLUDE_PATHS) # Define additional directories containing required header files + ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(PLATFORM_OS),BSD) INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) -I/usr/pkg/include -I/usr/X11R7/include @@ -415,12 +417,12 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL) ifeq ($(PLATFORM_OS),WINDOWS) # Libraries for Windows desktop compilation - LDLIBS = -lraylib -lSDL2 -lSDL2main -lopengl32 -lgdi32 + LDLIBS = -lraylib $(SDL_LIBRARIES) -lopengl32 -lgdi32 endif ifeq ($(PLATFORM_OS),LINUX) # Libraries for Debian GNU/Linux desktop compiling # NOTE: Required packages: libegl1-mesa-dev - LDLIBS = -lraylib -lSDL2 -lSDL2main -lGL -lm -lpthread -ldl -lrt + LDLIBS = -lraylib $(SDL_LIBRARIES) -lGL -lm -lpthread -ldl -lrt # On X11 requires also below libraries LDLIBS += -lX11 @@ -646,8 +648,12 @@ OTHERS = \ others/embedded_files_loading \ others/raylib_opengl_interop \ others/raymath_vector_angle \ - others/rlgl_compute_shader \ - others/rlgl_standalone + others/rlgl_compute_shader + +ifeq ($(TARGET_PLATFORM), PLATFORM_DESKTOP_GFLW) + OTHERS += others/rlgl_standalone +endif + CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST)) diff --git a/src/Makefile b/src/Makefile index 1f0b730c6..265f95ca0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -118,6 +118,8 @@ GLFW_LINUX_ENABLE_X11 ?= TRUE # WARNING: Library is not included in raylib, it MUST be configured by users SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib +SDL_LIBRARIES ?= -lSDL2 -lSDL2main + # Determine if the file has root access (only required to install raylib) # "whoami" prints the name of the user that calls him (so, if it is the root user, "whoami" prints "root") @@ -460,7 +462,7 @@ CFLAGS += $(CUSTOM_CFLAGS) # Define include paths for required headers: INCLUDE_PATHS # NOTE: Several external required libraries (stb and others) #------------------------------------------------------------------------------------------------ -INCLUDE_PATHS = -I. +INCLUDE_PATHS = -I. $(EXTRA_INCLUDE_PATHS) # Define additional directories containing required header files ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) @@ -586,7 +588,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL) LDLIBS += -lX11 endif endif - LDLIBS += -lSDL2 -lSDL2main + LDLIBS += $(SDL_LIBRARIES) endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW) ifeq ($(PLATFORM_OS),WINDOWS) diff --git a/src/config.h b/src/config.h index f37a9de3e..e3749c560 100644 --- a/src/config.h +++ b/src/config.h @@ -71,6 +71,7 @@ // Enabling this flag allows manual control of the frame processes, use at your own risk //#define SUPPORT_CUSTOM_FRAME_CONTROL 1 + // rcore: Configuration values //------------------------------------------------------------------------------------ #define MAX_FILEPATH_CAPACITY 8192 // Maximum file paths capacity @@ -272,4 +273,31 @@ //------------------------------------------------------------------------------------ #define MAX_TRACELOG_MSG_LENGTH 256 // Max length of one trace-log message + +// Enable partial support for clipboard image, only working on SDL3 or +// being on both Windows OS + GLFW or Windows OS + RGFW +#define SUPPORT_CLIPBOARD_IMAGE 1 + +#if defined(SUPPORT_CLIPBOARD_IMAGE) + #ifndef STBI_REQUIRED + #define STBI_REQUIRED + #endif + + #ifndef SUPPORT_FILEFORMAT_BMP // For clipboard image on Windows + #define SUPPORT_FILEFORMAT_BMP 1 + #endif + + #ifndef SUPPORT_FILEFORMAT_PNG // Wayland uses png for prints, at least it was on 22 LTS ubuntu + #define SUPPORT_FILEFORMAT_PNG 1 + #endif + + #ifndef SUPPORT_FILEFORMAT_JPG + #define SUPPORT_FILEFORMAT_JPG 1 + #endif + + #ifndef SUPPORT_MODULE_RTEXTURES + #define SUPPORT_MODULE_RTEXTURES 1 + #endif +#endif + #endif // CONFIG_H diff --git a/src/external/win32_clipboard.h b/src/external/win32_clipboard.h new file mode 100644 index 000000000..832856432 --- /dev/null +++ b/src/external/win32_clipboard.h @@ -0,0 +1,374 @@ +#if !defined(_WIN32) +# error "This module is only made for Windows OS" +#endif + +#ifndef WIN32_CLIPBOARD_ +#define WIN32_CLIPBOARD_ +unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long long int *dataSize); +#endif // WIN32_CLIPBOARD_ + +#ifdef WIN32_CLIPBOARD_IMPLEMENTATION +#include +#include +#include +#include + +// NOTE: These search for architecture is taken from "Windows.h", and it's necessary if we really don't wanna import windows.h +// and still make it compile on msvc, because import indirectly importing "winnt.h" (e.g. ) can cause problems is these are not defined. +#if !defined(_X86_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_IX86) +#define _X86_ +#if !defined(_CHPE_X86_ARM64_) && defined(_M_HYBRID) +#define _CHPE_X86_ARM64_ +#endif +#endif + +#if !defined(_AMD64_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && (defined(_M_AMD64) || defined(_M_ARM64EC)) +#define _AMD64_ +#endif + +#if !defined(_ARM_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_ARM) +#define _ARM_ +#endif + +#if !defined(_ARM64_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64EC_) && defined(_M_ARM64) +#define _ARM64_ +#endif + +#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_ARM64EC) +#define _ARM64EC_ +#endif + +#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_M68K) +#define _68K_ +#endif + +#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_MPPC) +#define _MPPC_ +#endif + +#if !defined(_IA64_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_M_IX86) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_IA64) +#define _IA64_ +#endif + + +#define WIN32_LEAN_AND_MEAN +// #include +// #include +// #include +#include +// #include + +#ifndef WINAPI +#if defined(_ARM_) +#define WINAPI +#else +#define WINAPI __stdcall +#endif +#endif + +#ifndef WINAPI +#if defined(_ARM_) +#define WINAPI +#else +#define WINAPI __stdcall +#endif +#endif + +#ifndef WINBASEAPI +#ifndef _KERNEL32_ +#define WINBASEAPI DECLSPEC_IMPORT +#else +#define WINBASEAPI +#endif +#endif + +#ifndef WINUSERAPI +#ifndef _USER32_ +#define WINUSERAPI __declspec (dllimport) +#else +#define WINUSERAPI +#endif +#endif + +typedef int WINBOOL; + + + +// typedef HANDLE HGLOBAL; + +#ifndef HWND +#define HWND void* +#endif + + +#if !defined(_WINUSER_) || !defined(WINUSER_ALREADY_INCLUDED) +WINUSERAPI WINBOOL WINAPI OpenClipboard(HWND hWndNewOwner); +WINUSERAPI WINBOOL WINAPI CloseClipboard(VOID); +WINUSERAPI DWORD WINAPI GetClipboardSequenceNumber(VOID); +WINUSERAPI HWND WINAPI GetClipboardOwner(VOID); +WINUSERAPI HWND WINAPI SetClipboardViewer(HWND hWndNewViewer); +WINUSERAPI HWND WINAPI GetClipboardViewer(VOID); +WINUSERAPI WINBOOL WINAPI ChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext); +WINUSERAPI HANDLE WINAPI SetClipboardData(UINT uFormat, HANDLE hMem); +WINUSERAPI HANDLE WINAPI GetClipboardData(UINT uFormat); +WINUSERAPI UINT WINAPI RegisterClipboardFormatA(LPCSTR lpszFormat); +WINUSERAPI UINT WINAPI RegisterClipboardFormatW(LPCWSTR lpszFormat); +WINUSERAPI int WINAPI CountClipboardFormats(VOID); +WINUSERAPI UINT WINAPI EnumClipboardFormats(UINT format); +WINUSERAPI int WINAPI GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount); +WINUSERAPI int WINAPI GetClipboardFormatNameW(UINT format, LPWSTR lpszFormatName, int cchMaxCount); +WINUSERAPI WINBOOL WINAPI EmptyClipboard(VOID); +WINUSERAPI WINBOOL WINAPI IsClipboardFormatAvailable(UINT format); +WINUSERAPI int WINAPI GetPriorityClipboardFormat(UINT *paFormatPriorityList, int cFormats); +WINUSERAPI HWND WINAPI GetOpenClipboardWindow(VOID); +#endif + +#ifndef HGLOBAL +#define HGLOBAL void* +#endif + +#if !defined(_WINBASE_) || !defined(WINBASE_ALREADY_INCLUDED) +WINBASEAPI SIZE_T WINAPI GlobalSize (HGLOBAL hMem); +WINBASEAPI LPVOID WINAPI GlobalLock (HGLOBAL hMem); +WINBASEAPI WINBOOL WINAPI GlobalUnlock (HGLOBAL hMem); +#endif + + +#if !defined(_WINGDI_) || !defined(WINGDI_ALREADY_INCLUDED) +#ifndef BITMAPINFOHEADER_ALREADY_DEFINED +#define BITMAPINFOHEADER_ALREADY_DEFINED +// Does this header need to be packed ? by the windowps header it doesnt seem to be +#pragma pack(push, 1) +typedef struct tagBITMAPINFOHEADER { + DWORD biSize; + LONG biWidth; + LONG biHeight; + WORD biPlanes; + WORD biBitCount; + DWORD biCompression; + DWORD biSizeImage; + LONG biXPelsPerMeter; + LONG biYPelsPerMeter; + DWORD biClrUsed; + DWORD biClrImportant; +} BITMAPINFOHEADER,*LPBITMAPINFOHEADER,*PBITMAPINFOHEADER; +#pragma pack(pop) +#endif + +#ifndef BITMAPFILEHEADER_ALREADY_DEFINED +#define BITMAPFILEHEADER_ALREADY_DEFINED +#pragma pack(push, 1) +typedef struct tagBITMAPFILEHEADER { + WORD bfType; + DWORD bfSize; + WORD bfReserved1; + WORD bfReserved2; + DWORD bfOffBits; +} BITMAPFILEHEADER,*LPBITMAPFILEHEADER,*PBITMAPFILEHEADER; +#pragma pack(pop) +#endif + +#ifndef RGBQUAD_ALREADY_DEFINED +#define RGBQUAD_ALREADY_DEFINED +typedef struct tagRGBQUAD { + BYTE rgbBlue; + BYTE rgbGreen; + BYTE rgbRed; + BYTE rgbReserved; +} RGBQUAD, *LPRGBQUAD; +#endif + + +// https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/4e588f70-bd92-4a6f-b77f-35d0feaf7a57 +#define BI_RGB 0x0000 +#define BI_RLE8 0x0001 +#define BI_RLE4 0x0002 +#define BI_BITFIELDS 0x0003 +#define BI_JPEG 0x0004 +#define BI_PNG 0x0005 +#define BI_CMYK 0x000B +#define BI_CMYKRLE8 0x000C +#define BI_CMYKRLE4 0x000D + +#endif + +// https://learn.microsoft.com/en-us/windows/win32/dataxchg/standard-clipboard-formats +#define CF_DIB 8 + +// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setsystemcursor +// #define OCR_NORMAL 32512 // Normal select +// #define OCR_IBEAM 32513 // Text select +// #define OCR_WAIT 32514 // Busy +// #define OCR_CROSS 32515 // Precision select +// #define OCR_UP 32516 // Alternate select +// #define OCR_SIZENWSE 32642 // Diagonal resize 1 +// #define OCR_SIZENESW 32643 // Diagonal resize 2 +// #define OCR_SIZEWE 32644 // Horizontal resize +// #define OCR_SIZENS 32645 // Vertical resize +// #define OCR_SIZEALL 32646 // Move +// #define OCR_NO 32648 // Unavailable +// #define OCR_HAND 32649 // Link select +// #define OCR_APPSTARTING 32650 // + + +//---------------------------------------------------------------------------------- +// Module Internal Functions Declaration +//---------------------------------------------------------------------------------- + + +static BOOL OpenClipboardRetrying(HWND handle); // Open clipboard with a number of retries +static int GetPixelDataOffset(BITMAPINFOHEADER bih); + +unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long long int *dataSize) +{ + HWND win = NULL; // Get from somewhere but is doesnt seem to matter + const char* msgString = ""; + int severity = LOG_INFO; + BYTE* bmpData = NULL; + if (!OpenClipboardRetrying(win)) { + severity = LOG_ERROR; + msgString = "Couldn't open clipboard"; + goto end; + } + + HGLOBAL clipHandle = (HGLOBAL)GetClipboardData(CF_DIB); + if (!clipHandle) { + severity = LOG_ERROR; + msgString = "Clipboard data is not an Image"; + goto close; + } + + BITMAPINFOHEADER *bmpInfoHeader = (BITMAPINFOHEADER *)GlobalLock(clipHandle); + if (!bmpInfoHeader) { + // Mapping from HGLOBAL to our local *address space* failed + severity = LOG_ERROR; + msgString = "Clipboard data failed to be locked"; + goto unlock; + } + + *width = bmpInfoHeader->biWidth; + *height = bmpInfoHeader->biHeight; + + SIZE_T clipDataSize = GlobalSize(clipHandle); + if (clipDataSize < sizeof(BITMAPINFOHEADER)) { + // Format CF_DIB needs space for BITMAPINFOHEADER struct. + msgString = "Clipboard has Malformed data"; + severity = LOG_ERROR; + goto unlock; + } + + // Denotes where the pixel data starts from the bmpInfoHeader pointer + int pixelOffset = GetPixelDataOffset(*bmpInfoHeader); + + //--------------------------------------------------------------------------------// + // + // The rest of the section is about create the bytes for a correct BMP file + // Then we copy the data and to a pointer + // + //--------------------------------------------------------------------------------// + + BITMAPFILEHEADER bmpFileHeader = {0}; + SIZE_T bmpFileSize = sizeof(bmpFileHeader) + clipDataSize; + *dataSize = bmpFileSize; + + bmpFileHeader.bfType = 0x4D42; //https://stackoverflow.com/questions/601430/multibyte-character-constants-and-bitmap-file-header-type-constants#601536 + + bmpFileHeader.bfSize = (DWORD)bmpFileSize; // Up to 4GB works fine + bmpFileHeader.bfOffBits = sizeof(bmpFileHeader) + pixelOffset; + + // + // Each process has a default heap provided by the system + // Memory objects allocated by GlobalAlloc and LocalAlloc are in private, + // committed pages with read/write access that cannot be accessed by other processes. + // + // This may be wrong since we might be allocating in a DLL and freeing from another module, the main application + // that may cause heap corruption. We could create a FreeImage function + // + bmpData = malloc(sizeof(bmpFileHeader) + clipDataSize); + // First we add the header for a bmp file + memcpy(bmpData, &bmpFileHeader, sizeof(bmpFileHeader)); + // Then we add the header for the bmp itself + the pixel data + memcpy(bmpData + sizeof(bmpFileHeader), bmpInfoHeader, clipDataSize); + msgString = "Clipboad image acquired successfully"; + + +unlock: + GlobalUnlock(clipHandle); +close: + CloseClipboard(); +end: + + TRACELOG(severity, msgString); + return bmpData; +} + +static BOOL OpenClipboardRetrying(HWND hWnd) +{ + static const int maxTries = 20; + static const int sleepTimeMS = 60; + for (int _ = 0; _ < maxTries; ++_) + { + // Might be being hold by another process + // Or yourself forgot to CloseClipboard + if (OpenClipboard(hWnd)) { + return true; + } + Sleep(sleepTimeMS); + } + return false; +} + +// Based off of researching microsoft docs and reponses from this question https://stackoverflow.com/questions/30552255/how-to-read-a-bitmap-from-the-windows-clipboard#30552856 +// https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapinfoheader +// Get the byte offset where does the pixels data start (from a packed DIB) +static int GetPixelDataOffset(BITMAPINFOHEADER bih) +{ + int offset = 0; + const unsigned int rgbaSize = sizeof(RGBQUAD); + + // biSize Specifies the number of bytes required by the structure + // We expect to always be 40 because it should be packed + if (40 == bih.biSize && 40 == sizeof(BITMAPINFOHEADER)) + { + // + // biBitCount Specifies the number of bits per pixel. + // Might exist some bit masks *after* the header and *before* the pixel offset + // we're looking, but only if we have more than + // 8 bits per pixel, so we need to ajust for that + // + if (bih.biBitCount > 8) + { + // if bih.biCompression is RBG we should NOT offset more + + if (bih.biCompression == BI_BITFIELDS) + { + offset += 3 * rgbaSize; + } else if (bih.biCompression == 6 /* BI_ALPHABITFIELDS */) + { + // Not widely supported, but valid. + offset += 4 * rgbaSize; + } + } + } + + // + // biClrUsed Specifies the number of color indices in the color table that are actually used by the bitmap. + // If this value is zero, the bitmap uses the maximum number of colors + // corresponding to the value of the biBitCount member for the compression mode specified by biCompression. + // If biClrUsed is nonzero and the biBitCount member is less than 16 + // the biClrUsed member specifies the actual number of colors + // + if (bih.biClrUsed > 0) { + offset += bih.biClrUsed * rgbaSize; + } else { + if (bih.biBitCount < 16) + { + offset = offset + (rgbaSize << bih.biBitCount); + } + } + + return bih.biSize + offset; +} +#endif // WIN32_CLIPBOARD_IMPLEMENTATION +// EOF + diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 45811e766..e765debc1 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -58,6 +58,7 @@ #if defined(_WIN32) typedef void *PVOID; typedef PVOID HANDLE; + #include "../external/win32_clipboard.h" typedef HANDLE HWND; #define GLFW_EXPOSE_NATIVE_WIN32 #define GLFW_NATIVE_INCLUDE_NONE // To avoid some symbols re-definition in windows.h @@ -966,6 +967,33 @@ const char *GetClipboardText(void) return glfwGetClipboardString(platform.handle); } +#if defined(SUPPORT_CLIPBOARD_IMAGE) +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = {0}; + unsigned long long int dataSize = 0; + void* fileData = NULL; + +#ifdef _WIN32 + int width, height; + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); +#else + TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_GLFW doesn't implement `GetClipboardImage` for this OS"); +#endif + + if (fileData == NULL) + { + TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); + } + else + { + image = LoadImageFromMemory(".bmp", fileData, dataSize); + } + return image; +} +#endif // SUPPORT_CLIPBOARD_IMAGE + // Show mouse cursor void ShowCursor(void) { @@ -1898,4 +1926,8 @@ static void JoystickCallback(int jid, int event) } } +#ifdef _WIN32 +# define WIN32_CLIPBOARD_IMPLEMENTATION +# include "../external/win32_clipboard.h" +#endif // EOF diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 68885ce3f..f3f26e3e8 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -664,6 +664,43 @@ const char *GetClipboardText(void) return RGFW_readClipboard(NULL); } + +#if defined(SUPPORT_CLIPBOARD_IMAGE) + +#ifdef _WIN32 +# define WIN32_CLIPBOARD_IMPLEMENTATION +# define WINUSER_ALREADY_INCLUDED +# define WINBASE_ALREADY_INCLUDED +# define WINGDI_ALREADY_INCLUDED +# include "../external/win32_clipboard.h" +#endif + +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = {0}; + unsigned long long int dataSize = 0; + void* fileData = NULL; + +#ifdef _WIN32 + int width, height; + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); +#else + TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement `GetClipboardImage` for this OS"); +#endif + + if (fileData == NULL) + { + TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); + } + else + { + image = LoadImageFromMemory(".bmp", fileData, dataSize); + } + return image; +} +#endif // SUPPORT_CLIPBOARD_IMAGE + // Show mouse cursor void ShowCursor(void) { diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 7cbe0354e..a201f2cde 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -23,7 +23,7 @@ * Custom flag for rcore on target platform -not used- * * DEPENDENCIES: -* - SDL 2 (main library): Windowing and inputs management +* - SDL 2 or SLD 3 (main library): Windowing and inputs management * - gestures: Gestures system for touch-ready devices (or simulated from mouse inputs) * * @@ -48,6 +48,10 @@ * **********************************************************************************************/ + +#ifndef SDL_ENABLE_OLD_NAMES + #define SDL_ENABLE_OLD_NAMES // Just in case we're on SDL3, we need some in-between compatibily +#endif #include "SDL.h" // SDL base library (window/rendered, input, timing... functionality) #if defined(GRAPHICS_API_OPENGL_ES2) @@ -64,6 +68,13 @@ #define MAX_CLIPBOARD_BUFFER_LENGTH 1024 // Size of the clipboard buffer used on GetClipboardText() #endif +#if ((defined(SDL_MAJOR_VERSION) && SDL_MAJOR_VERSION == 3) && (defined(SDL_MINOR_VERSION) && SDL_MINOR_VERSION >= 1)) + #ifndef PLATFORM_DESKTOP_SDL3 + #define PLATFORM_DESKTOP_SDL3 + #endif +#endif + + //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- @@ -227,6 +238,190 @@ static const int CursorsLUT[] = { //SDL_SYSTEM_CURSOR_WAITARROW, // No equivalent implemented on MouseCursor enum on raylib.h }; + +// SDL3 Migration Layer made to avoid `ifdefs` inside functions when we can. +#ifdef PLATFORM_DESKTOP_SDL3 + +// SDL3 Migration: +// SDL_WINDOW_FULLSCREEN_DESKTOP has been removed, +// and you can call SDL_GetWindowFullscreenMode() +// to see whether an exclusive fullscreen mode will be used +// or the borderless fullscreen desktop mode will be used +#define SDL_WINDOW_FULLSCREEN_DESKTOP SDL_WINDOW_FULLSCREEN + + +#define SDL_IGNORE false +#define SDL_DISABLE false +#define SDL_ENABLE true + +// SDL3 Migration: SDL_INIT_TIMER - no longer needed before calling SDL_AddTimer() +#define SDL_INIT_TIMER 0x0 // It's a flag, so no problem in setting it to zero if we use in a bitor (|) + +// SDL3 Migration: The SDL_WINDOW_SHOWN flag has been removed. Windows are shown by default and can be created hidden by using the SDL_WINDOW_HIDDEN flag. +#define SDL_WINDOW_SHOWN 0x0 // It's a flag, so no problem in setting it to zero if we use in a bitor (|) + +// +// SDL3 Migration: Renamed +// IMPORTANT: +// Might need to call SDL_CleanupEvent somewhere see :https://github.com/libsdl-org/SDL/issues/3540#issuecomment-1793449852 +// +#define SDL_DROPFILE SDL_EVENT_DROP_FILE + + +const char* SDL_GameControllerNameForIndex(int joystickIndex) +{ + // NOTE: SDL3 uses the IDs itself (SDL_JoystickID) instead of SDL2 joystick_index + const char* name = NULL; + int numJoysticks = 0; + SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); + if (joysticks) { + if (joystickIndex < numJoysticks) { + SDL_JoystickID instance_id = joysticks[joystickIndex]; + name = SDL_GetGamepadNameForID(instance_id); + } + SDL_free(joysticks); + } + return name; +} + +int SDL_GetNumVideoDisplays(void) +{ + int monitorCount = 0; + SDL_DisplayID *displays = SDL_GetDisplays(&monitorCount); + // Safe because If `mem` is NULL, SDL_free does nothing. + SDL_free(displays); + + return monitorCount; +} + + +// SLD3 Migration: +// To emulate SDL2 this function should return `SDL_DISABLE` or `SDL_ENABLE` +// representing the *processing state* of the event before this function makes any changes to it. +Uint8 SDL_EventState(Uint32 type, int state) { + + Uint8 stateBefore = SDL_EventEnabled(type); + switch (state) + { + case SDL_DISABLE: SDL_SetEventEnabled(type, false); break; + case SDL_ENABLE: SDL_SetEventEnabled(type, true); break; + default: TRACELOG(LOG_WARNING, "Event sate: unknow type"); + } + return stateBefore; +} + +void SDL_GetCurrentDisplayMode_Adapter(SDL_DisplayID displayID, SDL_DisplayMode* mode) +{ + const SDL_DisplayMode* currMode = SDL_GetCurrentDisplayMode(displayID); + if (currMode == NULL) + { + TRACELOG(LOG_WARNING, "No current display mode"); + } + else + { + *mode = *currMode; + } +} + +// SDL3 Migration: Renamed +#define SDL_GetCurrentDisplayMode SDL_GetCurrentDisplayMode_Adapter + + +SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) +{ + return SDL_CreateSurface(width, height, SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask)); +} + +// SDL3 Migration: +// SDL_GetDisplayDPI() - +// not reliable across platforms, approximately replaced by multiplying +// SDL_GetWindowDisplayScale() times 160 on iPhone and Android, and 96 on other platforms. +// returns 0 on success or a negative error code on failure +int SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi) { + float dpi = SDL_GetWindowDisplayScale(platform.window) * 96.0; + if (ddpi != NULL) *ddpi = dpi; + if (hdpi != NULL) *hdpi = dpi; + if (vdpi != NULL) *vdpi = dpi; + return 0; +} + +SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format) +{ + return SDL_CreateSurface(width, height, format); +} + +SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) +{ + return SDL_CreateSurfaceFrom(width, height, SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask), pixels, pitch); +} + +SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format) +{ + return SDL_CreateSurfaceFrom(width, height, format, pixels, pitch); +} + +int SDL_NumJoysticks(void) +{ + int numJoysticks; + SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); + SDL_free(joysticks); + return numJoysticks; +} + + +// SDL_SetRelativeMouseMode +// returns 0 on success or a negative error code on failure +// If relative mode is not supported, this returns -1. +int SDL_SetRelativeMouseMode_Adapter(SDL_bool enabled) +{ + + // + // SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled) + // \returns true on success or false on failure; call SDL_GetError() for more + // + if (SDL_SetWindowRelativeMouseMode(platform.window, enabled)) + { + return 0; // success + } + else + { + return -1; // failure + } +} + +#define SDL_SetRelativeMouseMode SDL_SetRelativeMouseMode_Adapter + +bool SDL_GetRelativeMouseMode_Adapter(void) +{ + return SDL_GetWindowRelativeMouseMode(platform.window); +} + +#define SDL_GetRelativeMouseMode SDL_GetRelativeMouseMode_Adapter + + +int SDL_GetNumTouchFingers(SDL_TouchID touchID) +{ + // SDL_Finger **SDL_GetTouchFingers(SDL_TouchID touchID, int *count) + int count = 0; + SDL_Finger **fingers = SDL_GetTouchFingers(touchID, &count); + SDL_free(fingers); + return count; +} + +#else // We're on SDL2 + +// Since SDL2 doesn't have this function we leave a stub +// SDL_GetClipboardData function is available since SDL 3.1.3. (e.g. SDL3) +void* SDL_GetClipboardData(const char *mime_type, size_t *size) { + TRACELOG(LOG_WARNING, "Getting clipboard data that is not text is only available in SDL3"); + // We could possibly implement it ourselves in this case for some easier platforms + return NULL; +} + +#endif // PLATFORM_DESKTOP_SDL3 + + + //---------------------------------------------------------------------------------- // Module Internal Functions Declaration //---------------------------------------------------------------------------------- @@ -256,7 +451,12 @@ void ToggleFullscreen(void) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); + +#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + if ((monitor > 0) && (monitor <= monitorCount)) +#else if ((monitor >= 0) && (monitor < monitorCount)) +#endif { if ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) > 0) { @@ -279,7 +479,11 @@ void ToggleBorderlessWindowed(void) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); +#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + if ((monitor > 0) && (monitor <= monitorCount)) +#else if ((monitor >= 0) && (monitor < monitorCount)) +#endif { if ((CORE.Window.flags & FLAG_BORDERLESS_WINDOWED_MODE) > 0) { @@ -328,7 +532,11 @@ void SetWindowState(unsigned int flags) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); + #ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + if ((monitor > 0) && (monitor <= monitorCount)) + #else if ((monitor >= 0) && (monitor < monitorCount)) + #endif { SDL_SetWindowFullscreen(platform.window, SDL_WINDOW_FULLSCREEN); CORE.Window.fullscreen = true; @@ -387,7 +595,11 @@ void SetWindowState(unsigned int flags) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); + #ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + if ((monitor > 0) && (monitor <= monitorCount)) + #else if ((monitor >= 0) && (monitor < monitorCount)) + #endif { SDL_SetWindowFullscreen(platform.window, SDL_WINDOW_FULLSCREEN_DESKTOP); } @@ -606,7 +818,11 @@ void SetWindowMonitor(int monitor) const int screenWidth = CORE.Window.screen.width; const int screenHeight = CORE.Window.screen.height; SDL_Rect usableBounds; + #ifdef PLATFORM_DESKTOP_SDL3 // Different style for success checking + if (SDL_GetDisplayUsableBounds(monitor, &usableBounds)) + #else if (SDL_GetDisplayUsableBounds(monitor, &usableBounds) == 0) + #endif { if (wasFullscreen == 1) ToggleFullscreen(); // Leave fullscreen. @@ -704,6 +920,7 @@ int GetCurrentMonitor(void) { int currentMonitor = 0; + // Be aware that this returns an ID in SDL3 and a Index in SDL2 currentMonitor = SDL_GetWindowDisplayIndex(platform.window); return currentMonitor; @@ -716,7 +933,11 @@ Vector2 GetMonitorPosition(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { SDL_Rect displayBounds; + #ifdef PLATFORM_DESKTOP_SDL3 + if (SDL_GetDisplayUsableBounds(monitor, &displayBounds)) + #else if (SDL_GetDisplayUsableBounds(monitor, &displayBounds) == 0) + #endif { return (Vector2){ (float)displayBounds.x, (float)displayBounds.y }; } @@ -844,10 +1065,16 @@ Vector2 GetWindowScaleDPI(void) { Vector2 scale = { 1.0f, 1.0f }; +#ifndef PLATFORM_DESKTOP_SDL3 // NOTE: SDL_GetWindowDisplayScale was only added on SDL3 // see https://wiki.libsdl.org/SDL3/SDL_GetWindowDisplayScale // TODO: Implement the window scale factor calculation manually. TRACELOG(LOG_WARNING, "GetWindowScaleDPI() not implemented on target platform"); +#else + scale.x = SDL_GetWindowDisplayScale(platform.window); + scale.y = scale.x; + TRACELOG(LOG_INFO, "WindowScaleDPI is %f", scale.x); +#endif return scale; } @@ -877,19 +1104,68 @@ const char *GetClipboardText(void) return buffer; } + +#if defined(SUPPORT_CLIPBOARD_IMAGE) +// Get clipboard image +Image GetClipboardImage(void) +{ + // Let's hope compiler put these arrays in static memory + const char *image_formats[] = { + "image/bmp", + "image/png", + "image/jpg", + "image/tiff", + }; + const char *image_extensions[] = { + ".bmp", + ".png", + ".jpg", + ".tiff", + }; + + + Image image = {0}; + size_t dataSize = 0; + void *fileData = NULL; + for (int i = 0; i < SDL_arraysize(image_formats); ++i) + { + // NOTE: This pointer should be free with SDL_free() at some point. + fileData = SDL_GetClipboardData(image_formats[i], &dataSize); + if (fileData) { + image = LoadImageFromMemory(image_extensions[i], fileData, dataSize); + if (IsImageValid(image)) + { + TRACELOG(LOG_INFO, "Clipboard image: Got image from clipboard as a `%s` successfully", image_extensions[i]); + return image; + } + } + } + + TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data. %s", SDL_GetError()); + return image; +} +#endif + + // Show mouse cursor void ShowCursor(void) { +#ifdef PLATFORM_DESKTOP_SDL3 + SDL_ShowCursor(); +#else SDL_ShowCursor(SDL_ENABLE); - +#endif CORE.Input.Mouse.cursorHidden = false; } // Hides mouse cursor void HideCursor(void) { +#ifdef PLATFORM_DESKTOP_SDL3 + SDL_HideCursor(); +#else SDL_ShowCursor(SDL_DISABLE); - +#endif CORE.Input.Mouse.cursorHidden = true; } @@ -897,7 +1173,13 @@ void HideCursor(void) void EnableCursor(void) { SDL_SetRelativeMouseMode(SDL_FALSE); + +#ifdef PLATFORM_DESKTOP_SDL3 + // SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible() + SDL_ShowCursor(); +#else SDL_ShowCursor(SDL_ENABLE); +#endif platform.cursorRelative = false; CORE.Input.Mouse.cursorHidden = false; @@ -993,6 +1275,22 @@ const char *GetKeyName(int key) static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) { +#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 + int count = 0; + SDL_Finger **fingers = SDL_GetTouchFingers(event.touchID, &count); + CORE.Input.Touch.pointCount = count; + + for (int i = 0; i < CORE.Input.Touch.pointCount; i++) + { + SDL_Finger *finger = fingers[i]; + CORE.Input.Touch.pointId[i] = finger->id; + CORE.Input.Touch.position[i].x = finger->x*CORE.Window.screen.width; + CORE.Input.Touch.position[i].y = finger->y*CORE.Window.screen.height; + CORE.Input.Touch.currentTouchState[i] = 1; + } + SDL_free(fingers); +#else // SDL2 + CORE.Input.Touch.pointCount = SDL_GetNumTouchFingers(event.touchId); for (int i = 0; i < CORE.Input.Touch.pointCount; i++) @@ -1003,6 +1301,7 @@ static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) CORE.Input.Touch.position[i].y = finger->y*CORE.Window.screen.height; CORE.Input.Touch.currentTouchState[i] = 1; } +#endif for (int i = CORE.Input.Touch.pointCount; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.currentTouchState[i] = 0; } @@ -1094,16 +1393,26 @@ void PollInputEvents(void) CORE.Window.dropFilepaths = (char **)RL_CALLOC(1024, sizeof(char *)); CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); + #ifdef PLATFORM_DESKTOP_SDL3 + // const char *data; /**< The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events */ + // Event memory is now managed by SDL, so you should not free the data in SDL_EVENT_DROP_FILE, and if you want to hold onto the text in SDL_EVENT_TEXT_EDITING and SDL_EVENT_TEXT_INPUT events, you should make a copy of it. SDL_TEXTINPUTEVENT_TEXT_SIZE is no longer necessary and has been removed. + strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); + #else strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.file); SDL_free(event.drop.file); + #endif CORE.Window.dropFileCount++; } else if (CORE.Window.dropFileCount < 1024) { CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); + #ifdef PLATFORM_DESKTOP_SDL3 + strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); + #else strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.file); SDL_free(event.drop.file); + #endif CORE.Window.dropFileCount++; } @@ -1112,10 +1421,18 @@ void PollInputEvents(void) } break; // Window events are also polled (Minimized, maximized, close...) + + #ifndef PLATFORM_DESKTOP_SDL3 + // SDL3 states: + // The SDL_WINDOWEVENT_* events have been moved to top level events, + // and SDL_WINDOWEVENT has been removed. + // In general, handling this change just means checking for the individual events instead of first checking for SDL_WINDOWEVENT + // and then checking for window events. You can compare the event >= SDL_EVENT_WINDOW_FIRST and <= SDL_EVENT_WINDOW_LAST if you need to see whether it's a window event. case SDL_WINDOWEVENT: { switch (event.window.event) { + #endif case SDL_WINDOWEVENT_RESIZED: case SDL_WINDOWEVENT_SIZE_CHANGED: { @@ -1143,14 +1460,23 @@ void PollInputEvents(void) case SDL_WINDOWEVENT_FOCUS_GAINED: case SDL_WINDOWEVENT_MAXIMIZED: case SDL_WINDOWEVENT_RESTORED: + #ifdef PLATFORM_DESKTOP_SDL3 + break; + #else default: break; } } break; + #endif // Keyboard events case SDL_KEYDOWN: { + #ifdef PLATFORM_DESKTOP_SDL3 + // SDL3 Migration: The following structures have been removed: * SDL_Keysym + KeyboardKey key = ConvertScancodeToKey(event.key.scancode); + #else KeyboardKey key = ConvertScancodeToKey(event.key.keysym.scancode); + #endif if (key != KEY_NULL) { @@ -1175,7 +1501,12 @@ void PollInputEvents(void) case SDL_KEYUP: { + + #ifdef PLATFORM_DESKTOP_SDL3 + KeyboardKey key = ConvertScancodeToKey(event.key.scancode); + #else KeyboardKey key = ConvertScancodeToKey(event.key.keysym.scancode); + #endif if (key != KEY_NULL) CORE.Input.Keyboard.currentKeyState[key] = 0; } break; @@ -1527,7 +1858,11 @@ int InitPlatform(void) } // Init window +#ifdef PLATFORM_DESKTOP_SDL3 + platform.window = SDL_CreateWindow(CORE.Window.title, CORE.Window.screen.width, CORE.Window.screen.height, flags); +#else platform.window = SDL_CreateWindow(CORE.Window.title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, CORE.Window.screen.width, CORE.Window.screen.height, flags); +#endif // Init OpenGL context platform.glContext = SDL_GL_CreateContext(platform.window); @@ -1611,7 +1946,12 @@ int InitPlatform(void) CORE.Storage.basePath = SDL_GetBasePath(); // Alternative: GetWorkingDirectory(); //---------------------------------------------------------------------------- + +#ifdef PLATFORM_DESKTOP_SDL3 + TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL3): Initialized successfully"); +#else TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL): Initialized successfully"); +#endif return 0; } diff --git a/src/raylib.h b/src/raylib.h index e0822bb7d..02b3ee731 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1011,6 +1011,7 @@ RLAPI Vector2 GetWindowScaleDPI(void); // Get window RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor RLAPI void SetClipboardText(const char *text); // Set clipboard text content RLAPI const char *GetClipboardText(void); // Get clipboard text content +RLAPI Image GetClipboardImage(void); // Get clipboard image RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling diff --git a/src/rcore.c b/src/rcore.c index 75b9bf451..2d1808c14 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -512,6 +512,12 @@ const char *TextFormat(const char *text, ...); // Formatting of tex #define PLATFORM_DESKTOP_GLFW #endif +#if defined(SUPPORT_CLIPBOARD_IMAGE) + #if !defined(SUPPORT_FILEFORMAT_BMP) || !defined(STBI_REQUIRED) || !defined(SUPPORT_MODULE_RTEXTURES) + #error "To enabled SUPPORT_CLIPBOARD_IMAGE, it also needs SUPPORT_FILEFORMAT_BMP, SUPPORT_MODULE_RTEXTURES and STBI_REQUIRED to be defined. It should have been defined earlier" + #endif +#endif // SUPPORT_CLIPBOARD_IMAGE + // Include platform-specific submodules #if defined(PLATFORM_DESKTOP_GLFW) #include "platforms/rcore_desktop_glfw.c" From d8feef5279a6a13f4bf1e59e4c72f07d71e7553b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 9 Nov 2024 18:40:56 +0000 Subject: [PATCH 014/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 5 + parser/output/raylib_api.lua | 5 + parser/output/raylib_api.txt | 1075 +++++++++++++++++---------------- parser/output/raylib_api.xml | 4 +- 4 files changed, 553 insertions(+), 536 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 8f5a6c826..aa86d3f71 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -3520,6 +3520,11 @@ "description": "Get clipboard text content", "returnType": "const char *" }, + { + "name": "GetClipboardImage", + "description": "Get clipboard image", + "returnType": "Image" + }, { "name": "EnableEventWaiting", "description": "Enable waiting for events on EndDrawing(), no automatic event polling", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index f532cd0d5..e5a20049e 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -3397,6 +3397,11 @@ return { description = "Get clipboard text content", returnType = "const char *" }, + { + name = "GetClipboardImage", + description = "Get clipboard image", + returnType = "Image" + }, { name = "EnableEventWaiting", description = "Enable waiting for events on EndDrawing(), no automatic event polling", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index f45217ac6..e38495559 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -988,7 +988,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 580 +Functions found: 581 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -1227,112 +1227,117 @@ Function 046: GetClipboardText() (0 input parameters) Return type: const char * Description: Get clipboard text content No input parameters -Function 047: EnableEventWaiting() (0 input parameters) +Function 047: GetClipboardImage() (0 input parameters) + Name: GetClipboardImage + Return type: Image + Description: Get clipboard image + No input parameters +Function 048: EnableEventWaiting() (0 input parameters) Name: EnableEventWaiting Return type: void Description: Enable waiting for events on EndDrawing(), no automatic event polling No input parameters -Function 048: DisableEventWaiting() (0 input parameters) +Function 049: DisableEventWaiting() (0 input parameters) Name: DisableEventWaiting Return type: void Description: Disable waiting for events on EndDrawing(), automatic events polling No input parameters -Function 049: ShowCursor() (0 input parameters) +Function 050: ShowCursor() (0 input parameters) Name: ShowCursor Return type: void Description: Shows cursor No input parameters -Function 050: HideCursor() (0 input parameters) +Function 051: HideCursor() (0 input parameters) Name: HideCursor Return type: void Description: Hides cursor No input parameters -Function 051: IsCursorHidden() (0 input parameters) +Function 052: IsCursorHidden() (0 input parameters) Name: IsCursorHidden Return type: bool Description: Check if cursor is not visible No input parameters -Function 052: EnableCursor() (0 input parameters) +Function 053: EnableCursor() (0 input parameters) Name: EnableCursor Return type: void Description: Enables cursor (unlock cursor) No input parameters -Function 053: DisableCursor() (0 input parameters) +Function 054: DisableCursor() (0 input parameters) Name: DisableCursor Return type: void Description: Disables cursor (lock cursor) No input parameters -Function 054: IsCursorOnScreen() (0 input parameters) +Function 055: IsCursorOnScreen() (0 input parameters) Name: IsCursorOnScreen Return type: bool Description: Check if cursor is on the screen No input parameters -Function 055: ClearBackground() (1 input parameters) +Function 056: ClearBackground() (1 input parameters) Name: ClearBackground Return type: void Description: Set background color (framebuffer clear color) Param[1]: color (type: Color) -Function 056: BeginDrawing() (0 input parameters) +Function 057: BeginDrawing() (0 input parameters) Name: BeginDrawing Return type: void Description: Setup canvas (framebuffer) to start drawing No input parameters -Function 057: EndDrawing() (0 input parameters) +Function 058: EndDrawing() (0 input parameters) Name: EndDrawing Return type: void Description: End canvas drawing and swap buffers (double buffering) No input parameters -Function 058: BeginMode2D() (1 input parameters) +Function 059: BeginMode2D() (1 input parameters) Name: BeginMode2D Return type: void Description: Begin 2D mode with custom camera (2D) Param[1]: camera (type: Camera2D) -Function 059: EndMode2D() (0 input parameters) +Function 060: EndMode2D() (0 input parameters) Name: EndMode2D Return type: void Description: Ends 2D mode with custom camera No input parameters -Function 060: BeginMode3D() (1 input parameters) +Function 061: BeginMode3D() (1 input parameters) Name: BeginMode3D Return type: void Description: Begin 3D mode with custom camera (3D) Param[1]: camera (type: Camera3D) -Function 061: EndMode3D() (0 input parameters) +Function 062: EndMode3D() (0 input parameters) Name: EndMode3D Return type: void Description: Ends 3D mode and returns to default 2D orthographic mode No input parameters -Function 062: BeginTextureMode() (1 input parameters) +Function 063: BeginTextureMode() (1 input parameters) Name: BeginTextureMode Return type: void Description: Begin drawing to render texture Param[1]: target (type: RenderTexture2D) -Function 063: EndTextureMode() (0 input parameters) +Function 064: EndTextureMode() (0 input parameters) Name: EndTextureMode Return type: void Description: Ends drawing to render texture No input parameters -Function 064: BeginShaderMode() (1 input parameters) +Function 065: BeginShaderMode() (1 input parameters) Name: BeginShaderMode Return type: void Description: Begin custom shader drawing Param[1]: shader (type: Shader) -Function 065: EndShaderMode() (0 input parameters) +Function 066: EndShaderMode() (0 input parameters) Name: EndShaderMode Return type: void Description: End custom shader drawing (use default shader) No input parameters -Function 066: BeginBlendMode() (1 input parameters) +Function 067: BeginBlendMode() (1 input parameters) Name: BeginBlendMode Return type: void Description: Begin blending mode (alpha, additive, multiplied, subtract, custom) Param[1]: mode (type: int) -Function 067: EndBlendMode() (0 input parameters) +Function 068: EndBlendMode() (0 input parameters) Name: EndBlendMode Return type: void Description: End blending mode (reset to default: alpha blending) No input parameters -Function 068: BeginScissorMode() (4 input parameters) +Function 069: BeginScissorMode() (4 input parameters) Name: BeginScissorMode Return type: void Description: Begin scissor mode (define screen area for following drawing) @@ -1340,61 +1345,61 @@ Function 068: BeginScissorMode() (4 input parameters) Param[2]: y (type: int) Param[3]: width (type: int) Param[4]: height (type: int) -Function 069: EndScissorMode() (0 input parameters) +Function 070: EndScissorMode() (0 input parameters) Name: EndScissorMode Return type: void Description: End scissor mode No input parameters -Function 070: BeginVrStereoMode() (1 input parameters) +Function 071: BeginVrStereoMode() (1 input parameters) Name: BeginVrStereoMode Return type: void Description: Begin stereo rendering (requires VR simulator) Param[1]: config (type: VrStereoConfig) -Function 071: EndVrStereoMode() (0 input parameters) +Function 072: EndVrStereoMode() (0 input parameters) Name: EndVrStereoMode Return type: void Description: End stereo rendering (requires VR simulator) No input parameters -Function 072: LoadVrStereoConfig() (1 input parameters) +Function 073: LoadVrStereoConfig() (1 input parameters) Name: LoadVrStereoConfig Return type: VrStereoConfig Description: Load VR stereo config for VR simulator device parameters Param[1]: device (type: VrDeviceInfo) -Function 073: UnloadVrStereoConfig() (1 input parameters) +Function 074: UnloadVrStereoConfig() (1 input parameters) Name: UnloadVrStereoConfig Return type: void Description: Unload VR stereo config Param[1]: config (type: VrStereoConfig) -Function 074: LoadShader() (2 input parameters) +Function 075: LoadShader() (2 input parameters) Name: LoadShader Return type: Shader Description: Load shader from files and bind default locations Param[1]: vsFileName (type: const char *) Param[2]: fsFileName (type: const char *) -Function 075: LoadShaderFromMemory() (2 input parameters) +Function 076: LoadShaderFromMemory() (2 input parameters) Name: LoadShaderFromMemory Return type: Shader Description: Load shader from code strings and bind default locations Param[1]: vsCode (type: const char *) Param[2]: fsCode (type: const char *) -Function 076: IsShaderValid() (1 input parameters) +Function 077: IsShaderValid() (1 input parameters) Name: IsShaderValid Return type: bool Description: Check if a shader is valid (loaded on GPU) Param[1]: shader (type: Shader) -Function 077: GetShaderLocation() (2 input parameters) +Function 078: GetShaderLocation() (2 input parameters) Name: GetShaderLocation Return type: int Description: Get shader uniform location Param[1]: shader (type: Shader) Param[2]: uniformName (type: const char *) -Function 078: GetShaderLocationAttrib() (2 input parameters) +Function 079: GetShaderLocationAttrib() (2 input parameters) Name: GetShaderLocationAttrib Return type: int Description: Get shader attribute location Param[1]: shader (type: Shader) Param[2]: attribName (type: const char *) -Function 079: SetShaderValue() (4 input parameters) +Function 080: SetShaderValue() (4 input parameters) Name: SetShaderValue Return type: void Description: Set shader uniform value @@ -1402,7 +1407,7 @@ Function 079: SetShaderValue() (4 input parameters) Param[2]: locIndex (type: int) Param[3]: value (type: const void *) Param[4]: uniformType (type: int) -Function 080: SetShaderValueV() (5 input parameters) +Function 081: SetShaderValueV() (5 input parameters) Name: SetShaderValueV Return type: void Description: Set shader uniform value vector @@ -1411,32 +1416,32 @@ Function 080: SetShaderValueV() (5 input parameters) Param[3]: value (type: const void *) Param[4]: uniformType (type: int) Param[5]: count (type: int) -Function 081: SetShaderValueMatrix() (3 input parameters) +Function 082: SetShaderValueMatrix() (3 input parameters) Name: SetShaderValueMatrix Return type: void Description: Set shader uniform value (matrix 4x4) Param[1]: shader (type: Shader) Param[2]: locIndex (type: int) Param[3]: mat (type: Matrix) -Function 082: SetShaderValueTexture() (3 input parameters) +Function 083: SetShaderValueTexture() (3 input parameters) Name: SetShaderValueTexture Return type: void Description: Set shader uniform value for texture (sampler2d) Param[1]: shader (type: Shader) Param[2]: locIndex (type: int) Param[3]: texture (type: Texture2D) -Function 083: UnloadShader() (1 input parameters) +Function 084: UnloadShader() (1 input parameters) Name: UnloadShader Return type: void Description: Unload shader from GPU memory (VRAM) Param[1]: shader (type: Shader) -Function 084: GetScreenToWorldRay() (2 input parameters) +Function 085: GetScreenToWorldRay() (2 input parameters) Name: GetScreenToWorldRay Return type: Ray Description: Get a ray trace from screen position (i.e mouse) Param[1]: position (type: Vector2) Param[2]: camera (type: Camera) -Function 085: GetScreenToWorldRayEx() (4 input parameters) +Function 086: GetScreenToWorldRayEx() (4 input parameters) Name: GetScreenToWorldRayEx Return type: Ray Description: Get a ray trace from screen position (i.e mouse) in a viewport @@ -1444,13 +1449,13 @@ Function 085: GetScreenToWorldRayEx() (4 input parameters) Param[2]: camera (type: Camera) Param[3]: width (type: int) Param[4]: height (type: int) -Function 086: GetWorldToScreen() (2 input parameters) +Function 087: GetWorldToScreen() (2 input parameters) Name: GetWorldToScreen Return type: Vector2 Description: Get the screen space position for a 3d world space position Param[1]: position (type: Vector3) Param[2]: camera (type: Camera) -Function 087: GetWorldToScreenEx() (4 input parameters) +Function 088: GetWorldToScreenEx() (4 input parameters) Name: GetWorldToScreenEx Return type: Vector2 Description: Get size position for a 3d world space position @@ -1458,490 +1463,490 @@ Function 087: GetWorldToScreenEx() (4 input parameters) Param[2]: camera (type: Camera) Param[3]: width (type: int) Param[4]: height (type: int) -Function 088: GetWorldToScreen2D() (2 input parameters) +Function 089: GetWorldToScreen2D() (2 input parameters) Name: GetWorldToScreen2D Return type: Vector2 Description: Get the screen space position for a 2d camera world space position Param[1]: position (type: Vector2) Param[2]: camera (type: Camera2D) -Function 089: GetScreenToWorld2D() (2 input parameters) +Function 090: GetScreenToWorld2D() (2 input parameters) Name: GetScreenToWorld2D Return type: Vector2 Description: Get the world space position for a 2d camera screen space position Param[1]: position (type: Vector2) Param[2]: camera (type: Camera2D) -Function 090: GetCameraMatrix() (1 input parameters) +Function 091: GetCameraMatrix() (1 input parameters) Name: GetCameraMatrix Return type: Matrix Description: Get camera transform matrix (view matrix) Param[1]: camera (type: Camera) -Function 091: GetCameraMatrix2D() (1 input parameters) +Function 092: GetCameraMatrix2D() (1 input parameters) Name: GetCameraMatrix2D Return type: Matrix Description: Get camera 2d transform matrix Param[1]: camera (type: Camera2D) -Function 092: SetTargetFPS() (1 input parameters) +Function 093: SetTargetFPS() (1 input parameters) Name: SetTargetFPS Return type: void Description: Set target FPS (maximum) Param[1]: fps (type: int) -Function 093: GetFrameTime() (0 input parameters) +Function 094: GetFrameTime() (0 input parameters) Name: GetFrameTime Return type: float Description: Get time in seconds for last frame drawn (delta time) No input parameters -Function 094: GetTime() (0 input parameters) +Function 095: GetTime() (0 input parameters) Name: GetTime Return type: double Description: Get elapsed time in seconds since InitWindow() No input parameters -Function 095: GetFPS() (0 input parameters) +Function 096: GetFPS() (0 input parameters) Name: GetFPS Return type: int Description: Get current FPS No input parameters -Function 096: SwapScreenBuffer() (0 input parameters) +Function 097: SwapScreenBuffer() (0 input parameters) Name: SwapScreenBuffer Return type: void Description: Swap back buffer with front buffer (screen drawing) No input parameters -Function 097: PollInputEvents() (0 input parameters) +Function 098: PollInputEvents() (0 input parameters) Name: PollInputEvents Return type: void Description: Register all input events No input parameters -Function 098: WaitTime() (1 input parameters) +Function 099: WaitTime() (1 input parameters) Name: WaitTime Return type: void Description: Wait for some time (halt program execution) Param[1]: seconds (type: double) -Function 099: SetRandomSeed() (1 input parameters) +Function 100: SetRandomSeed() (1 input parameters) Name: SetRandomSeed Return type: void Description: Set the seed for the random number generator Param[1]: seed (type: unsigned int) -Function 100: GetRandomValue() (2 input parameters) +Function 101: GetRandomValue() (2 input parameters) Name: GetRandomValue Return type: int Description: Get a random value between min and max (both included) Param[1]: min (type: int) Param[2]: max (type: int) -Function 101: LoadRandomSequence() (3 input parameters) +Function 102: LoadRandomSequence() (3 input parameters) Name: LoadRandomSequence Return type: int * Description: Load random values sequence, no values repeated Param[1]: count (type: unsigned int) Param[2]: min (type: int) Param[3]: max (type: int) -Function 102: UnloadRandomSequence() (1 input parameters) +Function 103: UnloadRandomSequence() (1 input parameters) Name: UnloadRandomSequence Return type: void Description: Unload random values sequence Param[1]: sequence (type: int *) -Function 103: TakeScreenshot() (1 input parameters) +Function 104: TakeScreenshot() (1 input parameters) Name: TakeScreenshot Return type: void Description: Takes a screenshot of current screen (filename extension defines format) Param[1]: fileName (type: const char *) -Function 104: SetConfigFlags() (1 input parameters) +Function 105: SetConfigFlags() (1 input parameters) Name: SetConfigFlags Return type: void Description: Setup init configuration flags (view FLAGS) Param[1]: flags (type: unsigned int) -Function 105: OpenURL() (1 input parameters) +Function 106: OpenURL() (1 input parameters) Name: OpenURL Return type: void Description: Open URL with default system browser (if available) Param[1]: url (type: const char *) -Function 106: TraceLog() (3 input parameters) +Function 107: TraceLog() (3 input parameters) Name: TraceLog Return type: void Description: Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) Param[1]: logLevel (type: int) Param[2]: text (type: const char *) Param[3]: args (type: ...) -Function 107: SetTraceLogLevel() (1 input parameters) +Function 108: SetTraceLogLevel() (1 input parameters) Name: SetTraceLogLevel Return type: void Description: Set the current threshold (minimum) log level Param[1]: logLevel (type: int) -Function 108: MemAlloc() (1 input parameters) +Function 109: MemAlloc() (1 input parameters) Name: MemAlloc Return type: void * Description: Internal memory allocator Param[1]: size (type: unsigned int) -Function 109: MemRealloc() (2 input parameters) +Function 110: MemRealloc() (2 input parameters) Name: MemRealloc Return type: void * Description: Internal memory reallocator Param[1]: ptr (type: void *) Param[2]: size (type: unsigned int) -Function 110: MemFree() (1 input parameters) +Function 111: MemFree() (1 input parameters) Name: MemFree Return type: void Description: Internal memory free Param[1]: ptr (type: void *) -Function 111: SetTraceLogCallback() (1 input parameters) +Function 112: SetTraceLogCallback() (1 input parameters) Name: SetTraceLogCallback Return type: void Description: Set custom trace log Param[1]: callback (type: TraceLogCallback) -Function 112: SetLoadFileDataCallback() (1 input parameters) +Function 113: SetLoadFileDataCallback() (1 input parameters) Name: SetLoadFileDataCallback Return type: void Description: Set custom file binary data loader Param[1]: callback (type: LoadFileDataCallback) -Function 113: SetSaveFileDataCallback() (1 input parameters) +Function 114: SetSaveFileDataCallback() (1 input parameters) Name: SetSaveFileDataCallback Return type: void Description: Set custom file binary data saver Param[1]: callback (type: SaveFileDataCallback) -Function 114: SetLoadFileTextCallback() (1 input parameters) +Function 115: SetLoadFileTextCallback() (1 input parameters) Name: SetLoadFileTextCallback Return type: void Description: Set custom file text data loader Param[1]: callback (type: LoadFileTextCallback) -Function 115: SetSaveFileTextCallback() (1 input parameters) +Function 116: SetSaveFileTextCallback() (1 input parameters) Name: SetSaveFileTextCallback Return type: void Description: Set custom file text data saver Param[1]: callback (type: SaveFileTextCallback) -Function 116: LoadFileData() (2 input parameters) +Function 117: LoadFileData() (2 input parameters) Name: LoadFileData Return type: unsigned char * Description: Load file data as byte array (read) Param[1]: fileName (type: const char *) Param[2]: dataSize (type: int *) -Function 117: UnloadFileData() (1 input parameters) +Function 118: UnloadFileData() (1 input parameters) Name: UnloadFileData Return type: void Description: Unload file data allocated by LoadFileData() Param[1]: data (type: unsigned char *) -Function 118: SaveFileData() (3 input parameters) +Function 119: SaveFileData() (3 input parameters) Name: SaveFileData Return type: bool Description: Save data to file from byte array (write), returns true on success Param[1]: fileName (type: const char *) Param[2]: data (type: void *) Param[3]: dataSize (type: int) -Function 119: ExportDataAsCode() (3 input parameters) +Function 120: ExportDataAsCode() (3 input parameters) Name: ExportDataAsCode Return type: bool Description: Export data to code (.h), returns true on success Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: fileName (type: const char *) -Function 120: LoadFileText() (1 input parameters) +Function 121: LoadFileText() (1 input parameters) Name: LoadFileText Return type: char * Description: Load text data from file (read), returns a '\0' terminated string Param[1]: fileName (type: const char *) -Function 121: UnloadFileText() (1 input parameters) +Function 122: UnloadFileText() (1 input parameters) Name: UnloadFileText Return type: void Description: Unload file text data allocated by LoadFileText() Param[1]: text (type: char *) -Function 122: SaveFileText() (2 input parameters) +Function 123: SaveFileText() (2 input parameters) Name: SaveFileText Return type: bool Description: Save text data to file (write), string must be '\0' terminated, returns true on success Param[1]: fileName (type: const char *) Param[2]: text (type: char *) -Function 123: FileExists() (1 input parameters) +Function 124: FileExists() (1 input parameters) Name: FileExists Return type: bool Description: Check if file exists Param[1]: fileName (type: const char *) -Function 124: DirectoryExists() (1 input parameters) +Function 125: DirectoryExists() (1 input parameters) Name: DirectoryExists Return type: bool Description: Check if a directory path exists Param[1]: dirPath (type: const char *) -Function 125: IsFileExtension() (2 input parameters) +Function 126: IsFileExtension() (2 input parameters) Name: IsFileExtension Return type: bool Description: Check file extension (including point: .png, .wav) Param[1]: fileName (type: const char *) Param[2]: ext (type: const char *) -Function 126: GetFileLength() (1 input parameters) +Function 127: GetFileLength() (1 input parameters) Name: GetFileLength Return type: int Description: Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) Param[1]: fileName (type: const char *) -Function 127: GetFileExtension() (1 input parameters) +Function 128: GetFileExtension() (1 input parameters) Name: GetFileExtension Return type: const char * Description: Get pointer to extension for a filename string (includes dot: '.png') Param[1]: fileName (type: const char *) -Function 128: GetFileName() (1 input parameters) +Function 129: GetFileName() (1 input parameters) Name: GetFileName Return type: const char * Description: Get pointer to filename for a path string Param[1]: filePath (type: const char *) -Function 129: GetFileNameWithoutExt() (1 input parameters) +Function 130: GetFileNameWithoutExt() (1 input parameters) Name: GetFileNameWithoutExt Return type: const char * Description: Get filename string without extension (uses static string) Param[1]: filePath (type: const char *) -Function 130: GetDirectoryPath() (1 input parameters) +Function 131: GetDirectoryPath() (1 input parameters) Name: GetDirectoryPath Return type: const char * Description: Get full path for a given fileName with path (uses static string) Param[1]: filePath (type: const char *) -Function 131: GetPrevDirectoryPath() (1 input parameters) +Function 132: GetPrevDirectoryPath() (1 input parameters) Name: GetPrevDirectoryPath Return type: const char * Description: Get previous directory path for a given path (uses static string) Param[1]: dirPath (type: const char *) -Function 132: GetWorkingDirectory() (0 input parameters) +Function 133: GetWorkingDirectory() (0 input parameters) Name: GetWorkingDirectory Return type: const char * Description: Get current working directory (uses static string) No input parameters -Function 133: GetApplicationDirectory() (0 input parameters) +Function 134: GetApplicationDirectory() (0 input parameters) Name: GetApplicationDirectory Return type: const char * Description: Get the directory of the running application (uses static string) No input parameters -Function 134: MakeDirectory() (1 input parameters) +Function 135: MakeDirectory() (1 input parameters) Name: MakeDirectory Return type: int Description: Create directories (including full path requested), returns 0 on success Param[1]: dirPath (type: const char *) -Function 135: ChangeDirectory() (1 input parameters) +Function 136: ChangeDirectory() (1 input parameters) Name: ChangeDirectory Return type: bool Description: Change working directory, return true on success Param[1]: dir (type: const char *) -Function 136: IsPathFile() (1 input parameters) +Function 137: IsPathFile() (1 input parameters) Name: IsPathFile Return type: bool Description: Check if a given path is a file or a directory Param[1]: path (type: const char *) -Function 137: IsFileNameValid() (1 input parameters) +Function 138: IsFileNameValid() (1 input parameters) Name: IsFileNameValid Return type: bool Description: Check if fileName is valid for the platform/OS Param[1]: fileName (type: const char *) -Function 138: LoadDirectoryFiles() (1 input parameters) +Function 139: LoadDirectoryFiles() (1 input parameters) Name: LoadDirectoryFiles Return type: FilePathList Description: Load directory filepaths Param[1]: dirPath (type: const char *) -Function 139: LoadDirectoryFilesEx() (3 input parameters) +Function 140: LoadDirectoryFilesEx() (3 input parameters) Name: LoadDirectoryFilesEx Return type: FilePathList Description: Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result Param[1]: basePath (type: const char *) Param[2]: filter (type: const char *) Param[3]: scanSubdirs (type: bool) -Function 140: UnloadDirectoryFiles() (1 input parameters) +Function 141: UnloadDirectoryFiles() (1 input parameters) Name: UnloadDirectoryFiles Return type: void Description: Unload filepaths Param[1]: files (type: FilePathList) -Function 141: IsFileDropped() (0 input parameters) +Function 142: IsFileDropped() (0 input parameters) Name: IsFileDropped Return type: bool Description: Check if a file has been dropped into window No input parameters -Function 142: LoadDroppedFiles() (0 input parameters) +Function 143: LoadDroppedFiles() (0 input parameters) Name: LoadDroppedFiles Return type: FilePathList Description: Load dropped filepaths No input parameters -Function 143: UnloadDroppedFiles() (1 input parameters) +Function 144: UnloadDroppedFiles() (1 input parameters) Name: UnloadDroppedFiles Return type: void Description: Unload dropped filepaths Param[1]: files (type: FilePathList) -Function 144: GetFileModTime() (1 input parameters) +Function 145: GetFileModTime() (1 input parameters) Name: GetFileModTime Return type: long Description: Get file modification time (last write time) Param[1]: fileName (type: const char *) -Function 145: CompressData() (3 input parameters) +Function 146: CompressData() (3 input parameters) Name: CompressData Return type: unsigned char * Description: Compress data (DEFLATE algorithm), memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: compDataSize (type: int *) -Function 146: DecompressData() (3 input parameters) +Function 147: DecompressData() (3 input parameters) Name: DecompressData Return type: unsigned char * Description: Decompress data (DEFLATE algorithm), memory must be MemFree() Param[1]: compData (type: const unsigned char *) Param[2]: compDataSize (type: int) Param[3]: dataSize (type: int *) -Function 147: EncodeDataBase64() (3 input parameters) +Function 148: EncodeDataBase64() (3 input parameters) Name: EncodeDataBase64 Return type: char * Description: Encode data to Base64 string, memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: dataSize (type: int) Param[3]: outputSize (type: int *) -Function 148: DecodeDataBase64() (2 input parameters) +Function 149: DecodeDataBase64() (2 input parameters) Name: DecodeDataBase64 Return type: unsigned char * Description: Decode Base64 string data, memory must be MemFree() Param[1]: data (type: const unsigned char *) Param[2]: outputSize (type: int *) -Function 149: ComputeCRC32() (2 input parameters) +Function 150: ComputeCRC32() (2 input parameters) Name: ComputeCRC32 Return type: unsigned int Description: Compute CRC32 hash code Param[1]: data (type: unsigned char *) Param[2]: dataSize (type: int) -Function 150: ComputeMD5() (2 input parameters) +Function 151: ComputeMD5() (2 input parameters) Name: ComputeMD5 Return type: unsigned int * Description: Compute MD5 hash code, returns static int[4] (16 bytes) Param[1]: data (type: unsigned char *) Param[2]: dataSize (type: int) -Function 151: ComputeSHA1() (2 input parameters) +Function 152: ComputeSHA1() (2 input parameters) Name: ComputeSHA1 Return type: unsigned int * Description: Compute SHA1 hash code, returns static int[5] (20 bytes) Param[1]: data (type: unsigned char *) Param[2]: dataSize (type: int) -Function 152: LoadAutomationEventList() (1 input parameters) +Function 153: LoadAutomationEventList() (1 input parameters) Name: LoadAutomationEventList Return type: AutomationEventList Description: Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS Param[1]: fileName (type: const char *) -Function 153: UnloadAutomationEventList() (1 input parameters) +Function 154: UnloadAutomationEventList() (1 input parameters) Name: UnloadAutomationEventList Return type: void Description: Unload automation events list from file Param[1]: list (type: AutomationEventList) -Function 154: ExportAutomationEventList() (2 input parameters) +Function 155: ExportAutomationEventList() (2 input parameters) Name: ExportAutomationEventList Return type: bool Description: Export automation events list as text file Param[1]: list (type: AutomationEventList) Param[2]: fileName (type: const char *) -Function 155: SetAutomationEventList() (1 input parameters) +Function 156: SetAutomationEventList() (1 input parameters) Name: SetAutomationEventList Return type: void Description: Set automation event list to record to Param[1]: list (type: AutomationEventList *) -Function 156: SetAutomationEventBaseFrame() (1 input parameters) +Function 157: SetAutomationEventBaseFrame() (1 input parameters) Name: SetAutomationEventBaseFrame Return type: void Description: Set automation event internal base frame to start recording Param[1]: frame (type: int) -Function 157: StartAutomationEventRecording() (0 input parameters) +Function 158: StartAutomationEventRecording() (0 input parameters) Name: StartAutomationEventRecording Return type: void Description: Start recording automation events (AutomationEventList must be set) No input parameters -Function 158: StopAutomationEventRecording() (0 input parameters) +Function 159: StopAutomationEventRecording() (0 input parameters) Name: StopAutomationEventRecording Return type: void Description: Stop recording automation events No input parameters -Function 159: PlayAutomationEvent() (1 input parameters) +Function 160: PlayAutomationEvent() (1 input parameters) Name: PlayAutomationEvent Return type: void Description: Play a recorded automation event Param[1]: event (type: AutomationEvent) -Function 160: IsKeyPressed() (1 input parameters) +Function 161: IsKeyPressed() (1 input parameters) Name: IsKeyPressed Return type: bool Description: Check if a key has been pressed once Param[1]: key (type: int) -Function 161: IsKeyPressedRepeat() (1 input parameters) +Function 162: IsKeyPressedRepeat() (1 input parameters) Name: IsKeyPressedRepeat Return type: bool Description: Check if a key has been pressed again Param[1]: key (type: int) -Function 162: IsKeyDown() (1 input parameters) +Function 163: IsKeyDown() (1 input parameters) Name: IsKeyDown Return type: bool Description: Check if a key is being pressed Param[1]: key (type: int) -Function 163: IsKeyReleased() (1 input parameters) +Function 164: IsKeyReleased() (1 input parameters) Name: IsKeyReleased Return type: bool Description: Check if a key has been released once Param[1]: key (type: int) -Function 164: IsKeyUp() (1 input parameters) +Function 165: IsKeyUp() (1 input parameters) Name: IsKeyUp Return type: bool Description: Check if a key is NOT being pressed Param[1]: key (type: int) -Function 165: GetKeyPressed() (0 input parameters) +Function 166: GetKeyPressed() (0 input parameters) Name: GetKeyPressed Return type: int Description: Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty No input parameters -Function 166: GetCharPressed() (0 input parameters) +Function 167: GetCharPressed() (0 input parameters) Name: GetCharPressed Return type: int Description: Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty No input parameters -Function 167: SetExitKey() (1 input parameters) +Function 168: SetExitKey() (1 input parameters) Name: SetExitKey Return type: void Description: Set a custom key to exit program (default is ESC) Param[1]: key (type: int) -Function 168: IsGamepadAvailable() (1 input parameters) +Function 169: IsGamepadAvailable() (1 input parameters) Name: IsGamepadAvailable Return type: bool Description: Check if a gamepad is available Param[1]: gamepad (type: int) -Function 169: GetGamepadName() (1 input parameters) +Function 170: GetGamepadName() (1 input parameters) Name: GetGamepadName Return type: const char * Description: Get gamepad internal name id Param[1]: gamepad (type: int) -Function 170: IsGamepadButtonPressed() (2 input parameters) +Function 171: IsGamepadButtonPressed() (2 input parameters) Name: IsGamepadButtonPressed Return type: bool Description: Check if a gamepad button has been pressed once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 171: IsGamepadButtonDown() (2 input parameters) +Function 172: IsGamepadButtonDown() (2 input parameters) Name: IsGamepadButtonDown Return type: bool Description: Check if a gamepad button is being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 172: IsGamepadButtonReleased() (2 input parameters) +Function 173: IsGamepadButtonReleased() (2 input parameters) Name: IsGamepadButtonReleased Return type: bool Description: Check if a gamepad button has been released once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 173: IsGamepadButtonUp() (2 input parameters) +Function 174: IsGamepadButtonUp() (2 input parameters) Name: IsGamepadButtonUp Return type: bool Description: Check if a gamepad button is NOT being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 174: GetGamepadButtonPressed() (0 input parameters) +Function 175: GetGamepadButtonPressed() (0 input parameters) Name: GetGamepadButtonPressed Return type: int Description: Get the last gamepad button pressed No input parameters -Function 175: GetGamepadAxisCount() (1 input parameters) +Function 176: GetGamepadAxisCount() (1 input parameters) Name: GetGamepadAxisCount Return type: int Description: Get gamepad axis count for a gamepad Param[1]: gamepad (type: int) -Function 176: GetGamepadAxisMovement() (2 input parameters) +Function 177: GetGamepadAxisMovement() (2 input parameters) Name: GetGamepadAxisMovement Return type: float Description: Get axis movement value for a gamepad axis Param[1]: gamepad (type: int) Param[2]: axis (type: int) -Function 177: SetGamepadMappings() (1 input parameters) +Function 178: SetGamepadMappings() (1 input parameters) Name: SetGamepadMappings Return type: int Description: Set internal gamepad mappings (SDL_GameControllerDB) Param[1]: mappings (type: const char *) -Function 178: SetGamepadVibration() (4 input parameters) +Function 179: SetGamepadVibration() (4 input parameters) Name: SetGamepadVibration Return type: void Description: Set gamepad vibration for both motors (duration in seconds) @@ -1949,151 +1954,151 @@ Function 178: SetGamepadVibration() (4 input parameters) Param[2]: leftMotor (type: float) Param[3]: rightMotor (type: float) Param[4]: duration (type: float) -Function 179: IsMouseButtonPressed() (1 input parameters) +Function 180: IsMouseButtonPressed() (1 input parameters) Name: IsMouseButtonPressed Return type: bool Description: Check if a mouse button has been pressed once Param[1]: button (type: int) -Function 180: IsMouseButtonDown() (1 input parameters) +Function 181: IsMouseButtonDown() (1 input parameters) Name: IsMouseButtonDown Return type: bool Description: Check if a mouse button is being pressed Param[1]: button (type: int) -Function 181: IsMouseButtonReleased() (1 input parameters) +Function 182: IsMouseButtonReleased() (1 input parameters) Name: IsMouseButtonReleased Return type: bool Description: Check if a mouse button has been released once Param[1]: button (type: int) -Function 182: IsMouseButtonUp() (1 input parameters) +Function 183: IsMouseButtonUp() (1 input parameters) Name: IsMouseButtonUp Return type: bool Description: Check if a mouse button is NOT being pressed Param[1]: button (type: int) -Function 183: GetMouseX() (0 input parameters) +Function 184: GetMouseX() (0 input parameters) Name: GetMouseX Return type: int Description: Get mouse position X No input parameters -Function 184: GetMouseY() (0 input parameters) +Function 185: GetMouseY() (0 input parameters) Name: GetMouseY Return type: int Description: Get mouse position Y No input parameters -Function 185: GetMousePosition() (0 input parameters) +Function 186: GetMousePosition() (0 input parameters) Name: GetMousePosition Return type: Vector2 Description: Get mouse position XY No input parameters -Function 186: GetMouseDelta() (0 input parameters) +Function 187: GetMouseDelta() (0 input parameters) Name: GetMouseDelta Return type: Vector2 Description: Get mouse delta between frames No input parameters -Function 187: SetMousePosition() (2 input parameters) +Function 188: SetMousePosition() (2 input parameters) Name: SetMousePosition Return type: void Description: Set mouse position XY Param[1]: x (type: int) Param[2]: y (type: int) -Function 188: SetMouseOffset() (2 input parameters) +Function 189: SetMouseOffset() (2 input parameters) Name: SetMouseOffset Return type: void Description: Set mouse offset Param[1]: offsetX (type: int) Param[2]: offsetY (type: int) -Function 189: SetMouseScale() (2 input parameters) +Function 190: SetMouseScale() (2 input parameters) Name: SetMouseScale Return type: void Description: Set mouse scaling Param[1]: scaleX (type: float) Param[2]: scaleY (type: float) -Function 190: GetMouseWheelMove() (0 input parameters) +Function 191: GetMouseWheelMove() (0 input parameters) Name: GetMouseWheelMove Return type: float Description: Get mouse wheel movement for X or Y, whichever is larger No input parameters -Function 191: GetMouseWheelMoveV() (0 input parameters) +Function 192: GetMouseWheelMoveV() (0 input parameters) Name: GetMouseWheelMoveV Return type: Vector2 Description: Get mouse wheel movement for both X and Y No input parameters -Function 192: SetMouseCursor() (1 input parameters) +Function 193: SetMouseCursor() (1 input parameters) Name: SetMouseCursor Return type: void Description: Set mouse cursor Param[1]: cursor (type: int) -Function 193: GetTouchX() (0 input parameters) +Function 194: GetTouchX() (0 input parameters) Name: GetTouchX Return type: int Description: Get touch position X for touch point 0 (relative to screen size) No input parameters -Function 194: GetTouchY() (0 input parameters) +Function 195: GetTouchY() (0 input parameters) Name: GetTouchY Return type: int Description: Get touch position Y for touch point 0 (relative to screen size) No input parameters -Function 195: GetTouchPosition() (1 input parameters) +Function 196: GetTouchPosition() (1 input parameters) Name: GetTouchPosition Return type: Vector2 Description: Get touch position XY for a touch point index (relative to screen size) Param[1]: index (type: int) -Function 196: GetTouchPointId() (1 input parameters) +Function 197: GetTouchPointId() (1 input parameters) Name: GetTouchPointId Return type: int Description: Get touch point identifier for given index Param[1]: index (type: int) -Function 197: GetTouchPointCount() (0 input parameters) +Function 198: GetTouchPointCount() (0 input parameters) Name: GetTouchPointCount Return type: int Description: Get number of touch points No input parameters -Function 198: SetGesturesEnabled() (1 input parameters) +Function 199: SetGesturesEnabled() (1 input parameters) Name: SetGesturesEnabled Return type: void Description: Enable a set of gestures using flags Param[1]: flags (type: unsigned int) -Function 199: IsGestureDetected() (1 input parameters) +Function 200: IsGestureDetected() (1 input parameters) Name: IsGestureDetected Return type: bool Description: Check if a gesture have been detected Param[1]: gesture (type: unsigned int) -Function 200: GetGestureDetected() (0 input parameters) +Function 201: GetGestureDetected() (0 input parameters) Name: GetGestureDetected Return type: int Description: Get latest detected gesture No input parameters -Function 201: GetGestureHoldDuration() (0 input parameters) +Function 202: GetGestureHoldDuration() (0 input parameters) Name: GetGestureHoldDuration Return type: float Description: Get gesture hold time in seconds No input parameters -Function 202: GetGestureDragVector() (0 input parameters) +Function 203: GetGestureDragVector() (0 input parameters) Name: GetGestureDragVector Return type: Vector2 Description: Get gesture drag vector No input parameters -Function 203: GetGestureDragAngle() (0 input parameters) +Function 204: GetGestureDragAngle() (0 input parameters) Name: GetGestureDragAngle Return type: float Description: Get gesture drag angle No input parameters -Function 204: GetGesturePinchVector() (0 input parameters) +Function 205: GetGesturePinchVector() (0 input parameters) Name: GetGesturePinchVector Return type: Vector2 Description: Get gesture pinch delta No input parameters -Function 205: GetGesturePinchAngle() (0 input parameters) +Function 206: GetGesturePinchAngle() (0 input parameters) Name: GetGesturePinchAngle Return type: float Description: Get gesture pinch angle No input parameters -Function 206: UpdateCamera() (2 input parameters) +Function 207: UpdateCamera() (2 input parameters) Name: UpdateCamera Return type: void Description: Update camera position for selected mode Param[1]: camera (type: Camera *) Param[2]: mode (type: int) -Function 207: UpdateCameraPro() (4 input parameters) +Function 208: UpdateCameraPro() (4 input parameters) Name: UpdateCameraPro Return type: void Description: Update camera movement/rotation @@ -2101,36 +2106,36 @@ Function 207: UpdateCameraPro() (4 input parameters) Param[2]: movement (type: Vector3) Param[3]: rotation (type: Vector3) Param[4]: zoom (type: float) -Function 208: SetShapesTexture() (2 input parameters) +Function 209: SetShapesTexture() (2 input parameters) Name: SetShapesTexture Return type: void Description: Set texture and rectangle to be used on shapes drawing Param[1]: texture (type: Texture2D) Param[2]: source (type: Rectangle) -Function 209: GetShapesTexture() (0 input parameters) +Function 210: GetShapesTexture() (0 input parameters) Name: GetShapesTexture Return type: Texture2D Description: Get texture that is used for shapes drawing No input parameters -Function 210: GetShapesTextureRectangle() (0 input parameters) +Function 211: GetShapesTextureRectangle() (0 input parameters) Name: GetShapesTextureRectangle Return type: Rectangle Description: Get texture source rectangle that is used for shapes drawing No input parameters -Function 211: DrawPixel() (3 input parameters) +Function 212: DrawPixel() (3 input parameters) Name: DrawPixel Return type: void Description: Draw a pixel using geometry [Can be slow, use with care] Param[1]: posX (type: int) Param[2]: posY (type: int) Param[3]: color (type: Color) -Function 212: DrawPixelV() (2 input parameters) +Function 213: DrawPixelV() (2 input parameters) Name: DrawPixelV Return type: void Description: Draw a pixel using geometry (Vector version) [Can be slow, use with care] Param[1]: position (type: Vector2) Param[2]: color (type: Color) -Function 213: DrawLine() (5 input parameters) +Function 214: DrawLine() (5 input parameters) Name: DrawLine Return type: void Description: Draw a line @@ -2139,14 +2144,14 @@ Function 213: DrawLine() (5 input parameters) Param[3]: endPosX (type: int) Param[4]: endPosY (type: int) Param[5]: color (type: Color) -Function 214: DrawLineV() (3 input parameters) +Function 215: DrawLineV() (3 input parameters) Name: DrawLineV Return type: void Description: Draw a line (using gl lines) Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: color (type: Color) -Function 215: DrawLineEx() (4 input parameters) +Function 216: DrawLineEx() (4 input parameters) Name: DrawLineEx Return type: void Description: Draw a line (using triangles/quads) @@ -2154,14 +2159,14 @@ Function 215: DrawLineEx() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 216: DrawLineStrip() (3 input parameters) +Function 217: DrawLineStrip() (3 input parameters) Name: DrawLineStrip Return type: void Description: Draw lines sequence (using gl lines) Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 217: DrawLineBezier() (4 input parameters) +Function 218: DrawLineBezier() (4 input parameters) Name: DrawLineBezier Return type: void Description: Draw line segment cubic-bezier in-out interpolation @@ -2169,7 +2174,7 @@ Function 217: DrawLineBezier() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 218: DrawCircle() (4 input parameters) +Function 219: DrawCircle() (4 input parameters) Name: DrawCircle Return type: void Description: Draw a color-filled circle @@ -2177,7 +2182,7 @@ Function 218: DrawCircle() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 219: DrawCircleSector() (6 input parameters) +Function 220: DrawCircleSector() (6 input parameters) Name: DrawCircleSector Return type: void Description: Draw a piece of a circle @@ -2187,7 +2192,7 @@ Function 219: DrawCircleSector() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 220: DrawCircleSectorLines() (6 input parameters) +Function 221: DrawCircleSectorLines() (6 input parameters) Name: DrawCircleSectorLines Return type: void Description: Draw circle sector outline @@ -2197,7 +2202,7 @@ Function 220: DrawCircleSectorLines() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 221: DrawCircleGradient() (5 input parameters) +Function 222: DrawCircleGradient() (5 input parameters) Name: DrawCircleGradient Return type: void Description: Draw a gradient-filled circle @@ -2206,14 +2211,14 @@ Function 221: DrawCircleGradient() (5 input parameters) Param[3]: radius (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 222: DrawCircleV() (3 input parameters) +Function 223: DrawCircleV() (3 input parameters) Name: DrawCircleV Return type: void Description: Draw a color-filled circle (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 223: DrawCircleLines() (4 input parameters) +Function 224: DrawCircleLines() (4 input parameters) Name: DrawCircleLines Return type: void Description: Draw circle outline @@ -2221,14 +2226,14 @@ Function 223: DrawCircleLines() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 224: DrawCircleLinesV() (3 input parameters) +Function 225: DrawCircleLinesV() (3 input parameters) Name: DrawCircleLinesV Return type: void Description: Draw circle outline (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 225: DrawEllipse() (5 input parameters) +Function 226: DrawEllipse() (5 input parameters) Name: DrawEllipse Return type: void Description: Draw ellipse @@ -2237,7 +2242,7 @@ Function 225: DrawEllipse() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 226: DrawEllipseLines() (5 input parameters) +Function 227: DrawEllipseLines() (5 input parameters) Name: DrawEllipseLines Return type: void Description: Draw ellipse outline @@ -2246,7 +2251,7 @@ Function 226: DrawEllipseLines() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 227: DrawRing() (7 input parameters) +Function 228: DrawRing() (7 input parameters) Name: DrawRing Return type: void Description: Draw ring @@ -2257,7 +2262,7 @@ Function 227: DrawRing() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 228: DrawRingLines() (7 input parameters) +Function 229: DrawRingLines() (7 input parameters) Name: DrawRingLines Return type: void Description: Draw ring outline @@ -2268,7 +2273,7 @@ Function 228: DrawRingLines() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 229: DrawRectangle() (5 input parameters) +Function 230: DrawRectangle() (5 input parameters) Name: DrawRectangle Return type: void Description: Draw a color-filled rectangle @@ -2277,20 +2282,20 @@ Function 229: DrawRectangle() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 230: DrawRectangleV() (3 input parameters) +Function 231: DrawRectangleV() (3 input parameters) Name: DrawRectangleV Return type: void Description: Draw a color-filled rectangle (Vector version) Param[1]: position (type: Vector2) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 231: DrawRectangleRec() (2 input parameters) +Function 232: DrawRectangleRec() (2 input parameters) Name: DrawRectangleRec Return type: void Description: Draw a color-filled rectangle Param[1]: rec (type: Rectangle) Param[2]: color (type: Color) -Function 232: DrawRectanglePro() (4 input parameters) +Function 233: DrawRectanglePro() (4 input parameters) Name: DrawRectanglePro Return type: void Description: Draw a color-filled rectangle with pro parameters @@ -2298,7 +2303,7 @@ Function 232: DrawRectanglePro() (4 input parameters) Param[2]: origin (type: Vector2) Param[3]: rotation (type: float) Param[4]: color (type: Color) -Function 233: DrawRectangleGradientV() (6 input parameters) +Function 234: DrawRectangleGradientV() (6 input parameters) Name: DrawRectangleGradientV Return type: void Description: Draw a vertical-gradient-filled rectangle @@ -2308,7 +2313,7 @@ Function 233: DrawRectangleGradientV() (6 input parameters) Param[4]: height (type: int) Param[5]: top (type: Color) Param[6]: bottom (type: Color) -Function 234: DrawRectangleGradientH() (6 input parameters) +Function 235: DrawRectangleGradientH() (6 input parameters) Name: DrawRectangleGradientH Return type: void Description: Draw a horizontal-gradient-filled rectangle @@ -2318,7 +2323,7 @@ Function 234: DrawRectangleGradientH() (6 input parameters) Param[4]: height (type: int) Param[5]: left (type: Color) Param[6]: right (type: Color) -Function 235: DrawRectangleGradientEx() (5 input parameters) +Function 236: DrawRectangleGradientEx() (5 input parameters) Name: DrawRectangleGradientEx Return type: void Description: Draw a gradient-filled rectangle with custom vertex colors @@ -2327,7 +2332,7 @@ Function 235: DrawRectangleGradientEx() (5 input parameters) Param[3]: bottomLeft (type: Color) Param[4]: topRight (type: Color) Param[5]: bottomRight (type: Color) -Function 236: DrawRectangleLines() (5 input parameters) +Function 237: DrawRectangleLines() (5 input parameters) Name: DrawRectangleLines Return type: void Description: Draw rectangle outline @@ -2336,14 +2341,14 @@ Function 236: DrawRectangleLines() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 237: DrawRectangleLinesEx() (3 input parameters) +Function 238: DrawRectangleLinesEx() (3 input parameters) Name: DrawRectangleLinesEx Return type: void Description: Draw rectangle outline with extended parameters Param[1]: rec (type: Rectangle) Param[2]: lineThick (type: float) Param[3]: color (type: Color) -Function 238: DrawRectangleRounded() (4 input parameters) +Function 239: DrawRectangleRounded() (4 input parameters) Name: DrawRectangleRounded Return type: void Description: Draw rectangle with rounded edges @@ -2351,7 +2356,7 @@ Function 238: DrawRectangleRounded() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 239: DrawRectangleRoundedLines() (4 input parameters) +Function 240: DrawRectangleRoundedLines() (4 input parameters) Name: DrawRectangleRoundedLines Return type: void Description: Draw rectangle lines with rounded edges @@ -2359,7 +2364,7 @@ Function 239: DrawRectangleRoundedLines() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 240: DrawRectangleRoundedLinesEx() (5 input parameters) +Function 241: DrawRectangleRoundedLinesEx() (5 input parameters) Name: DrawRectangleRoundedLinesEx Return type: void Description: Draw rectangle with rounded edges outline @@ -2368,7 +2373,7 @@ Function 240: DrawRectangleRoundedLinesEx() (5 input parameters) Param[3]: segments (type: int) Param[4]: lineThick (type: float) Param[5]: color (type: Color) -Function 241: DrawTriangle() (4 input parameters) +Function 242: DrawTriangle() (4 input parameters) Name: DrawTriangle Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -2376,7 +2381,7 @@ Function 241: DrawTriangle() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 242: DrawTriangleLines() (4 input parameters) +Function 243: DrawTriangleLines() (4 input parameters) Name: DrawTriangleLines Return type: void Description: Draw triangle outline (vertex in counter-clockwise order!) @@ -2384,21 +2389,21 @@ Function 242: DrawTriangleLines() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 243: DrawTriangleFan() (3 input parameters) +Function 244: DrawTriangleFan() (3 input parameters) Name: DrawTriangleFan Return type: void Description: Draw a triangle fan defined by points (first vertex is the center) Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 244: DrawTriangleStrip() (3 input parameters) +Function 245: DrawTriangleStrip() (3 input parameters) Name: DrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 245: DrawPoly() (5 input parameters) +Function 246: DrawPoly() (5 input parameters) Name: DrawPoly Return type: void Description: Draw a regular polygon (Vector version) @@ -2407,7 +2412,7 @@ Function 245: DrawPoly() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 246: DrawPolyLines() (5 input parameters) +Function 247: DrawPolyLines() (5 input parameters) Name: DrawPolyLines Return type: void Description: Draw a polygon outline of n sides @@ -2416,7 +2421,7 @@ Function 246: DrawPolyLines() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 247: DrawPolyLinesEx() (6 input parameters) +Function 248: DrawPolyLinesEx() (6 input parameters) Name: DrawPolyLinesEx Return type: void Description: Draw a polygon outline of n sides with extended parameters @@ -2426,7 +2431,7 @@ Function 247: DrawPolyLinesEx() (6 input parameters) Param[4]: rotation (type: float) Param[5]: lineThick (type: float) Param[6]: color (type: Color) -Function 248: DrawSplineLinear() (4 input parameters) +Function 249: DrawSplineLinear() (4 input parameters) Name: DrawSplineLinear Return type: void Description: Draw spline: Linear, minimum 2 points @@ -2434,7 +2439,7 @@ Function 248: DrawSplineLinear() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 249: DrawSplineBasis() (4 input parameters) +Function 250: DrawSplineBasis() (4 input parameters) Name: DrawSplineBasis Return type: void Description: Draw spline: B-Spline, minimum 4 points @@ -2442,7 +2447,7 @@ Function 249: DrawSplineBasis() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 250: DrawSplineCatmullRom() (4 input parameters) +Function 251: DrawSplineCatmullRom() (4 input parameters) Name: DrawSplineCatmullRom Return type: void Description: Draw spline: Catmull-Rom, minimum 4 points @@ -2450,7 +2455,7 @@ Function 250: DrawSplineCatmullRom() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 251: DrawSplineBezierQuadratic() (4 input parameters) +Function 252: DrawSplineBezierQuadratic() (4 input parameters) Name: DrawSplineBezierQuadratic Return type: void Description: Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] @@ -2458,7 +2463,7 @@ Function 251: DrawSplineBezierQuadratic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 252: DrawSplineBezierCubic() (4 input parameters) +Function 253: DrawSplineBezierCubic() (4 input parameters) Name: DrawSplineBezierCubic Return type: void Description: Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] @@ -2466,7 +2471,7 @@ Function 252: DrawSplineBezierCubic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 253: DrawSplineSegmentLinear() (4 input parameters) +Function 254: DrawSplineSegmentLinear() (4 input parameters) Name: DrawSplineSegmentLinear Return type: void Description: Draw spline segment: Linear, 2 points @@ -2474,7 +2479,7 @@ Function 253: DrawSplineSegmentLinear() (4 input parameters) Param[2]: p2 (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 254: DrawSplineSegmentBasis() (6 input parameters) +Function 255: DrawSplineSegmentBasis() (6 input parameters) Name: DrawSplineSegmentBasis Return type: void Description: Draw spline segment: B-Spline, 4 points @@ -2484,7 +2489,7 @@ Function 254: DrawSplineSegmentBasis() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 255: DrawSplineSegmentCatmullRom() (6 input parameters) +Function 256: DrawSplineSegmentCatmullRom() (6 input parameters) Name: DrawSplineSegmentCatmullRom Return type: void Description: Draw spline segment: Catmull-Rom, 4 points @@ -2494,7 +2499,7 @@ Function 255: DrawSplineSegmentCatmullRom() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 256: DrawSplineSegmentBezierQuadratic() (5 input parameters) +Function 257: DrawSplineSegmentBezierQuadratic() (5 input parameters) Name: DrawSplineSegmentBezierQuadratic Return type: void Description: Draw spline segment: Quadratic Bezier, 2 points, 1 control point @@ -2503,7 +2508,7 @@ Function 256: DrawSplineSegmentBezierQuadratic() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: thick (type: float) Param[5]: color (type: Color) -Function 257: DrawSplineSegmentBezierCubic() (6 input parameters) +Function 258: DrawSplineSegmentBezierCubic() (6 input parameters) Name: DrawSplineSegmentBezierCubic Return type: void Description: Draw spline segment: Cubic Bezier, 2 points, 2 control points @@ -2513,14 +2518,14 @@ Function 257: DrawSplineSegmentBezierCubic() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 258: GetSplinePointLinear() (3 input parameters) +Function 259: GetSplinePointLinear() (3 input parameters) Name: GetSplinePointLinear Return type: Vector2 Description: Get (evaluate) spline point: Linear Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: t (type: float) -Function 259: GetSplinePointBasis() (5 input parameters) +Function 260: GetSplinePointBasis() (5 input parameters) Name: GetSplinePointBasis Return type: Vector2 Description: Get (evaluate) spline point: B-Spline @@ -2529,7 +2534,7 @@ Function 259: GetSplinePointBasis() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 260: GetSplinePointCatmullRom() (5 input parameters) +Function 261: GetSplinePointCatmullRom() (5 input parameters) Name: GetSplinePointCatmullRom Return type: Vector2 Description: Get (evaluate) spline point: Catmull-Rom @@ -2538,7 +2543,7 @@ Function 260: GetSplinePointCatmullRom() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 261: GetSplinePointBezierQuad() (4 input parameters) +Function 262: GetSplinePointBezierQuad() (4 input parameters) Name: GetSplinePointBezierQuad Return type: Vector2 Description: Get (evaluate) spline point: Quadratic Bezier @@ -2546,7 +2551,7 @@ Function 261: GetSplinePointBezierQuad() (4 input parameters) Param[2]: c2 (type: Vector2) Param[3]: p3 (type: Vector2) Param[4]: t (type: float) -Function 262: GetSplinePointBezierCubic() (5 input parameters) +Function 263: GetSplinePointBezierCubic() (5 input parameters) Name: GetSplinePointBezierCubic Return type: Vector2 Description: Get (evaluate) spline point: Cubic Bezier @@ -2555,13 +2560,13 @@ Function 262: GetSplinePointBezierCubic() (5 input parameters) Param[3]: c3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 263: CheckCollisionRecs() (2 input parameters) +Function 264: CheckCollisionRecs() (2 input parameters) Name: CheckCollisionRecs Return type: bool Description: Check collision between two rectangles Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 264: CheckCollisionCircles() (4 input parameters) +Function 265: CheckCollisionCircles() (4 input parameters) Name: CheckCollisionCircles Return type: bool Description: Check collision between two circles @@ -2569,14 +2574,14 @@ Function 264: CheckCollisionCircles() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector2) Param[4]: radius2 (type: float) -Function 265: CheckCollisionCircleRec() (3 input parameters) +Function 266: CheckCollisionCircleRec() (3 input parameters) Name: CheckCollisionCircleRec Return type: bool Description: Check collision between circle and rectangle Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: rec (type: Rectangle) -Function 266: CheckCollisionCircleLine() (4 input parameters) +Function 267: CheckCollisionCircleLine() (4 input parameters) Name: CheckCollisionCircleLine Return type: bool Description: Check if circle collides with a line created betweeen two points [p1] and [p2] @@ -2584,20 +2589,20 @@ Function 266: CheckCollisionCircleLine() (4 input parameters) Param[2]: radius (type: float) Param[3]: p1 (type: Vector2) Param[4]: p2 (type: Vector2) -Function 267: CheckCollisionPointRec() (2 input parameters) +Function 268: CheckCollisionPointRec() (2 input parameters) Name: CheckCollisionPointRec Return type: bool Description: Check if point is inside rectangle Param[1]: point (type: Vector2) Param[2]: rec (type: Rectangle) -Function 268: CheckCollisionPointCircle() (3 input parameters) +Function 269: CheckCollisionPointCircle() (3 input parameters) Name: CheckCollisionPointCircle Return type: bool Description: Check if point is inside circle Param[1]: point (type: Vector2) Param[2]: center (type: Vector2) Param[3]: radius (type: float) -Function 269: CheckCollisionPointTriangle() (4 input parameters) +Function 270: CheckCollisionPointTriangle() (4 input parameters) Name: CheckCollisionPointTriangle Return type: bool Description: Check if point is inside a triangle @@ -2605,7 +2610,7 @@ Function 269: CheckCollisionPointTriangle() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: p3 (type: Vector2) -Function 270: CheckCollisionPointLine() (4 input parameters) +Function 271: CheckCollisionPointLine() (4 input parameters) Name: CheckCollisionPointLine Return type: bool Description: Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] @@ -2613,14 +2618,14 @@ Function 270: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 271: CheckCollisionPointPoly() (3 input parameters) +Function 272: CheckCollisionPointPoly() (3 input parameters) Name: CheckCollisionPointPoly Return type: bool Description: Check if point is within a polygon described by array of vertices Param[1]: point (type: Vector2) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) -Function 272: CheckCollisionLines() (5 input parameters) +Function 273: CheckCollisionLines() (5 input parameters) Name: CheckCollisionLines Return type: bool Description: Check the collision between two lines defined by two points each, returns collision point by reference @@ -2629,18 +2634,18 @@ Function 272: CheckCollisionLines() (5 input parameters) Param[3]: startPos2 (type: Vector2) Param[4]: endPos2 (type: Vector2) Param[5]: collisionPoint (type: Vector2 *) -Function 273: GetCollisionRec() (2 input parameters) +Function 274: GetCollisionRec() (2 input parameters) Name: GetCollisionRec Return type: Rectangle Description: Get collision rectangle for two rectangles collision Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 274: LoadImage() (1 input parameters) +Function 275: LoadImage() (1 input parameters) Name: LoadImage Return type: Image Description: Load image from file into CPU memory (RAM) Param[1]: fileName (type: const char *) -Function 275: LoadImageRaw() (5 input parameters) +Function 276: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2649,13 +2654,13 @@ Function 275: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 276: LoadImageAnim() (2 input parameters) +Function 277: LoadImageAnim() (2 input parameters) Name: LoadImageAnim Return type: Image Description: Load image sequence from file (frames appended to image.data) Param[1]: fileName (type: const char *) Param[2]: frames (type: int *) -Function 277: LoadImageAnimFromMemory() (4 input parameters) +Function 278: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2663,60 +2668,60 @@ Function 277: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 278: LoadImageFromMemory() (3 input parameters) +Function 279: LoadImageFromMemory() (3 input parameters) Name: LoadImageFromMemory Return type: Image Description: Load image from memory buffer, fileType refers to extension: i.e. '.png' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 279: LoadImageFromTexture() (1 input parameters) +Function 280: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 280: LoadImageFromScreen() (0 input parameters) +Function 281: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer and (screenshot) No input parameters -Function 281: IsImageValid() (1 input parameters) +Function 282: IsImageValid() (1 input parameters) Name: IsImageValid Return type: bool Description: Check if an image is valid (data and parameters) Param[1]: image (type: Image) -Function 282: UnloadImage() (1 input parameters) +Function 283: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 283: ExportImage() (2 input parameters) +Function 284: ExportImage() (2 input parameters) Name: ExportImage Return type: bool Description: Export image data to file, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 284: ExportImageToMemory() (3 input parameters) +Function 285: ExportImageToMemory() (3 input parameters) Name: ExportImageToMemory Return type: unsigned char * Description: Export image to memory buffer Param[1]: image (type: Image) Param[2]: fileType (type: const char *) Param[3]: fileSize (type: int *) -Function 285: ExportImageAsCode() (2 input parameters) +Function 286: ExportImageAsCode() (2 input parameters) Name: ExportImageAsCode Return type: bool Description: Export image as code file defining an array of bytes, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 286: GenImageColor() (3 input parameters) +Function 287: GenImageColor() (3 input parameters) Name: GenImageColor Return type: Image Description: Generate image: plain color Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: color (type: Color) -Function 287: GenImageGradientLinear() (5 input parameters) +Function 288: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2725,7 +2730,7 @@ Function 287: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 288: GenImageGradientRadial() (5 input parameters) +Function 289: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2734,7 +2739,7 @@ Function 288: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 289: GenImageGradientSquare() (5 input parameters) +Function 290: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2743,7 +2748,7 @@ Function 289: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 290: GenImageChecked() (6 input parameters) +Function 291: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2753,14 +2758,14 @@ Function 290: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 291: GenImageWhiteNoise() (3 input parameters) +Function 292: GenImageWhiteNoise() (3 input parameters) Name: GenImageWhiteNoise Return type: Image Description: Generate image: white noise Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: factor (type: float) -Function 292: GenImagePerlinNoise() (5 input parameters) +Function 293: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2769,45 +2774,45 @@ Function 292: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 293: GenImageCellular() (3 input parameters) +Function 294: GenImageCellular() (3 input parameters) Name: GenImageCellular Return type: Image Description: Generate image: cellular algorithm, bigger tileSize means bigger cells Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: tileSize (type: int) -Function 294: GenImageText() (3 input parameters) +Function 295: GenImageText() (3 input parameters) Name: GenImageText Return type: Image Description: Generate image: grayscale image from text data Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: text (type: const char *) -Function 295: ImageCopy() (1 input parameters) +Function 296: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 296: ImageFromImage() (2 input parameters) +Function 297: ImageFromImage() (2 input parameters) Name: ImageFromImage Return type: Image Description: Create an image from another image piece Param[1]: image (type: Image) Param[2]: rec (type: Rectangle) -Function 297: ImageFromChannel() (2 input parameters) +Function 298: ImageFromChannel() (2 input parameters) Name: ImageFromChannel Return type: Image Description: Create an image from a selected channel of another image (GRAYSCALE) Param[1]: image (type: Image) Param[2]: selectedChannel (type: int) -Function 298: ImageText() (3 input parameters) +Function 299: ImageText() (3 input parameters) Name: ImageText Return type: Image Description: Create an image from text (default font) Param[1]: text (type: const char *) Param[2]: fontSize (type: int) Param[3]: color (type: Color) -Function 299: ImageTextEx() (5 input parameters) +Function 300: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2816,76 +2821,76 @@ Function 299: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 300: ImageFormat() (2 input parameters) +Function 301: ImageFormat() (2 input parameters) Name: ImageFormat Return type: void Description: Convert image data to desired format Param[1]: image (type: Image *) Param[2]: newFormat (type: int) -Function 301: ImageToPOT() (2 input parameters) +Function 302: ImageToPOT() (2 input parameters) Name: ImageToPOT Return type: void Description: Convert image to POT (power-of-two) Param[1]: image (type: Image *) Param[2]: fill (type: Color) -Function 302: ImageCrop() (2 input parameters) +Function 303: ImageCrop() (2 input parameters) Name: ImageCrop Return type: void Description: Crop an image to a defined rectangle Param[1]: image (type: Image *) Param[2]: crop (type: Rectangle) -Function 303: ImageAlphaCrop() (2 input parameters) +Function 304: ImageAlphaCrop() (2 input parameters) Name: ImageAlphaCrop Return type: void Description: Crop image depending on alpha value Param[1]: image (type: Image *) Param[2]: threshold (type: float) -Function 304: ImageAlphaClear() (3 input parameters) +Function 305: ImageAlphaClear() (3 input parameters) Name: ImageAlphaClear Return type: void Description: Clear alpha channel to desired color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: threshold (type: float) -Function 305: ImageAlphaMask() (2 input parameters) +Function 306: ImageAlphaMask() (2 input parameters) Name: ImageAlphaMask Return type: void Description: Apply alpha mask to image Param[1]: image (type: Image *) Param[2]: alphaMask (type: Image) -Function 306: ImageAlphaPremultiply() (1 input parameters) +Function 307: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 307: ImageBlurGaussian() (2 input parameters) +Function 308: ImageBlurGaussian() (2 input parameters) Name: ImageBlurGaussian Return type: void Description: Apply Gaussian blur using a box blur approximation Param[1]: image (type: Image *) Param[2]: blurSize (type: int) -Function 308: ImageKernelConvolution() (3 input parameters) +Function 309: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply custom square convolution kernel to image Param[1]: image (type: Image *) Param[2]: kernel (type: const float *) Param[3]: kernelSize (type: int) -Function 309: ImageResize() (3 input parameters) +Function 310: ImageResize() (3 input parameters) Name: ImageResize Return type: void Description: Resize image (Bicubic scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 310: ImageResizeNN() (3 input parameters) +Function 311: ImageResizeNN() (3 input parameters) Name: ImageResizeNN Return type: void Description: Resize image (Nearest-Neighbor scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 311: ImageResizeCanvas() (6 input parameters) +Function 312: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -2895,12 +2900,12 @@ Function 311: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 312: ImageMipmaps() (1 input parameters) +Function 313: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 313: ImageDither() (5 input parameters) +Function 314: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -2909,109 +2914,109 @@ Function 313: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 314: ImageFlipVertical() (1 input parameters) +Function 315: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 315: ImageFlipHorizontal() (1 input parameters) +Function 316: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 316: ImageRotate() (2 input parameters) +Function 317: ImageRotate() (2 input parameters) Name: ImageRotate Return type: void Description: Rotate image by input angle in degrees (-359 to 359) Param[1]: image (type: Image *) Param[2]: degrees (type: int) -Function 317: ImageRotateCW() (1 input parameters) +Function 318: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 318: ImageRotateCCW() (1 input parameters) +Function 319: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 319: ImageColorTint() (2 input parameters) +Function 320: ImageColorTint() (2 input parameters) Name: ImageColorTint Return type: void Description: Modify image color: tint Param[1]: image (type: Image *) Param[2]: color (type: Color) -Function 320: ImageColorInvert() (1 input parameters) +Function 321: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 321: ImageColorGrayscale() (1 input parameters) +Function 322: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 322: ImageColorContrast() (2 input parameters) +Function 323: ImageColorContrast() (2 input parameters) Name: ImageColorContrast Return type: void Description: Modify image color: contrast (-100 to 100) Param[1]: image (type: Image *) Param[2]: contrast (type: float) -Function 323: ImageColorBrightness() (2 input parameters) +Function 324: ImageColorBrightness() (2 input parameters) Name: ImageColorBrightness Return type: void Description: Modify image color: brightness (-255 to 255) Param[1]: image (type: Image *) Param[2]: brightness (type: int) -Function 324: ImageColorReplace() (3 input parameters) +Function 325: ImageColorReplace() (3 input parameters) Name: ImageColorReplace Return type: void Description: Modify image color: replace color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: replace (type: Color) -Function 325: LoadImageColors() (1 input parameters) +Function 326: LoadImageColors() (1 input parameters) Name: LoadImageColors Return type: Color * Description: Load color data from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) -Function 326: LoadImagePalette() (3 input parameters) +Function 327: LoadImagePalette() (3 input parameters) Name: LoadImagePalette Return type: Color * Description: Load colors palette from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) Param[2]: maxPaletteSize (type: int) Param[3]: colorCount (type: int *) -Function 327: UnloadImageColors() (1 input parameters) +Function 328: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 328: UnloadImagePalette() (1 input parameters) +Function 329: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 329: GetImageAlphaBorder() (2 input parameters) +Function 330: GetImageAlphaBorder() (2 input parameters) Name: GetImageAlphaBorder Return type: Rectangle Description: Get image alpha border rectangle Param[1]: image (type: Image) Param[2]: threshold (type: float) -Function 330: GetImageColor() (3 input parameters) +Function 331: GetImageColor() (3 input parameters) Name: GetImageColor Return type: Color Description: Get image pixel color at (x, y) position Param[1]: image (type: Image) Param[2]: x (type: int) Param[3]: y (type: int) -Function 331: ImageClearBackground() (2 input parameters) +Function 332: ImageClearBackground() (2 input parameters) Name: ImageClearBackground Return type: void Description: Clear image background with given color Param[1]: dst (type: Image *) Param[2]: color (type: Color) -Function 332: ImageDrawPixel() (4 input parameters) +Function 333: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -3019,14 +3024,14 @@ Function 332: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 333: ImageDrawPixelV() (3 input parameters) +Function 334: ImageDrawPixelV() (3 input parameters) Name: ImageDrawPixelV Return type: void Description: Draw pixel within an image (Vector version) Param[1]: dst (type: Image *) Param[2]: position (type: Vector2) Param[3]: color (type: Color) -Function 334: ImageDrawLine() (6 input parameters) +Function 335: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -3036,7 +3041,7 @@ Function 334: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 335: ImageDrawLineV() (4 input parameters) +Function 336: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3044,7 +3049,7 @@ Function 335: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 336: ImageDrawLineEx() (5 input parameters) +Function 337: ImageDrawLineEx() (5 input parameters) Name: ImageDrawLineEx Return type: void Description: Draw a line defining thickness within an image @@ -3053,7 +3058,7 @@ Function 336: ImageDrawLineEx() (5 input parameters) Param[3]: end (type: Vector2) Param[4]: thick (type: int) Param[5]: color (type: Color) -Function 337: ImageDrawCircle() (5 input parameters) +Function 338: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3062,7 +3067,7 @@ Function 337: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 338: ImageDrawCircleV() (4 input parameters) +Function 339: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3070,7 +3075,7 @@ Function 338: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 339: ImageDrawCircleLines() (5 input parameters) +Function 340: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3079,7 +3084,7 @@ Function 339: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 340: ImageDrawCircleLinesV() (4 input parameters) +Function 341: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3087,7 +3092,7 @@ Function 340: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 341: ImageDrawRectangle() (6 input parameters) +Function 342: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3097,7 +3102,7 @@ Function 341: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 342: ImageDrawRectangleV() (4 input parameters) +Function 343: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3105,14 +3110,14 @@ Function 342: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 343: ImageDrawRectangleRec() (3 input parameters) +Function 344: ImageDrawRectangleRec() (3 input parameters) Name: ImageDrawRectangleRec Return type: void Description: Draw rectangle within an image Param[1]: dst (type: Image *) Param[2]: rec (type: Rectangle) Param[3]: color (type: Color) -Function 344: ImageDrawRectangleLines() (4 input parameters) +Function 345: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3120,7 +3125,7 @@ Function 344: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 345: ImageDrawTriangle() (5 input parameters) +Function 346: ImageDrawTriangle() (5 input parameters) Name: ImageDrawTriangle Return type: void Description: Draw triangle within an image @@ -3129,7 +3134,7 @@ Function 345: ImageDrawTriangle() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 346: ImageDrawTriangleEx() (7 input parameters) +Function 347: ImageDrawTriangleEx() (7 input parameters) Name: ImageDrawTriangleEx Return type: void Description: Draw triangle with interpolated colors within an image @@ -3140,7 +3145,7 @@ Function 346: ImageDrawTriangleEx() (7 input parameters) Param[5]: c1 (type: Color) Param[6]: c2 (type: Color) Param[7]: c3 (type: Color) -Function 347: ImageDrawTriangleLines() (5 input parameters) +Function 348: ImageDrawTriangleLines() (5 input parameters) Name: ImageDrawTriangleLines Return type: void Description: Draw triangle outline within an image @@ -3149,7 +3154,7 @@ Function 347: ImageDrawTriangleLines() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 348: ImageDrawTriangleFan() (4 input parameters) +Function 349: ImageDrawTriangleFan() (4 input parameters) Name: ImageDrawTriangleFan Return type: void Description: Draw a triangle fan defined by points within an image (first vertex is the center) @@ -3157,7 +3162,7 @@ Function 348: ImageDrawTriangleFan() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 349: ImageDrawTriangleStrip() (4 input parameters) +Function 350: ImageDrawTriangleStrip() (4 input parameters) Name: ImageDrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points within an image @@ -3165,7 +3170,7 @@ Function 349: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 350: ImageDraw() (5 input parameters) +Function 351: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3174,7 +3179,7 @@ Function 350: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 351: ImageDrawText() (6 input parameters) +Function 352: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3184,7 +3189,7 @@ Function 351: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 352: ImageDrawTextEx() (7 input parameters) +Function 353: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3195,79 +3200,79 @@ Function 352: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 353: LoadTexture() (1 input parameters) +Function 354: LoadTexture() (1 input parameters) Name: LoadTexture Return type: Texture2D Description: Load texture from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 354: LoadTextureFromImage() (1 input parameters) +Function 355: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 355: LoadTextureCubemap() (2 input parameters) +Function 356: LoadTextureCubemap() (2 input parameters) Name: LoadTextureCubemap Return type: TextureCubemap Description: Load cubemap from image, multiple image cubemap layouts supported Param[1]: image (type: Image) Param[2]: layout (type: int) -Function 356: LoadRenderTexture() (2 input parameters) +Function 357: LoadRenderTexture() (2 input parameters) Name: LoadRenderTexture Return type: RenderTexture2D Description: Load texture for rendering (framebuffer) Param[1]: width (type: int) Param[2]: height (type: int) -Function 357: IsTextureValid() (1 input parameters) +Function 358: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if a texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 358: UnloadTexture() (1 input parameters) +Function 359: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 359: IsRenderTextureValid() (1 input parameters) +Function 360: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if a render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 360: UnloadRenderTexture() (1 input parameters) +Function 361: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 361: UpdateTexture() (2 input parameters) +Function 362: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 362: UpdateTextureRec() (3 input parameters) +Function 363: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 363: GenTextureMipmaps() (1 input parameters) +Function 364: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 364: SetTextureFilter() (2 input parameters) +Function 365: SetTextureFilter() (2 input parameters) Name: SetTextureFilter Return type: void Description: Set texture scaling filter mode Param[1]: texture (type: Texture2D) Param[2]: filter (type: int) -Function 365: SetTextureWrap() (2 input parameters) +Function 366: SetTextureWrap() (2 input parameters) Name: SetTextureWrap Return type: void Description: Set texture wrapping mode Param[1]: texture (type: Texture2D) Param[2]: wrap (type: int) -Function 366: DrawTexture() (4 input parameters) +Function 367: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3275,14 +3280,14 @@ Function 366: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 367: DrawTextureV() (3 input parameters) +Function 368: DrawTextureV() (3 input parameters) Name: DrawTextureV Return type: void Description: Draw a Texture2D with position defined as Vector2 Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: tint (type: Color) -Function 368: DrawTextureEx() (5 input parameters) +Function 369: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3291,7 +3296,7 @@ Function 368: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 369: DrawTextureRec() (4 input parameters) +Function 370: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3299,7 +3304,7 @@ Function 369: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 370: DrawTexturePro() (6 input parameters) +Function 371: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3309,7 +3314,7 @@ Function 370: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 371: DrawTextureNPatch() (6 input parameters) +Function 372: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3319,119 +3324,119 @@ Function 371: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 372: ColorIsEqual() (2 input parameters) +Function 373: ColorIsEqual() (2 input parameters) Name: ColorIsEqual Return type: bool Description: Check if two colors are equal Param[1]: col1 (type: Color) Param[2]: col2 (type: Color) -Function 373: Fade() (2 input parameters) +Function 374: Fade() (2 input parameters) Name: Fade Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 374: ColorToInt() (1 input parameters) +Function 375: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 375: ColorNormalize() (1 input parameters) +Function 376: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 376: ColorFromNormalized() (1 input parameters) +Function 377: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 377: ColorToHSV() (1 input parameters) +Function 378: ColorToHSV() (1 input parameters) Name: ColorToHSV Return type: Vector3 Description: Get HSV values for a Color, hue [0..360], saturation/value [0..1] Param[1]: color (type: Color) -Function 378: ColorFromHSV() (3 input parameters) +Function 379: ColorFromHSV() (3 input parameters) Name: ColorFromHSV Return type: Color Description: Get a Color from HSV values, hue [0..360], saturation/value [0..1] Param[1]: hue (type: float) Param[2]: saturation (type: float) Param[3]: value (type: float) -Function 379: ColorTint() (2 input parameters) +Function 380: ColorTint() (2 input parameters) Name: ColorTint Return type: Color Description: Get color multiplied with another color Param[1]: color (type: Color) Param[2]: tint (type: Color) -Function 380: ColorBrightness() (2 input parameters) +Function 381: ColorBrightness() (2 input parameters) Name: ColorBrightness Return type: Color Description: Get color with brightness correction, brightness factor goes from -1.0f to 1.0f Param[1]: color (type: Color) Param[2]: factor (type: float) -Function 381: ColorContrast() (2 input parameters) +Function 382: ColorContrast() (2 input parameters) Name: ColorContrast Return type: Color Description: Get color with contrast correction, contrast values between -1.0f and 1.0f Param[1]: color (type: Color) Param[2]: contrast (type: float) -Function 382: ColorAlpha() (2 input parameters) +Function 383: ColorAlpha() (2 input parameters) Name: ColorAlpha Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 383: ColorAlphaBlend() (3 input parameters) +Function 384: ColorAlphaBlend() (3 input parameters) Name: ColorAlphaBlend Return type: Color Description: Get src alpha-blended into dst color with tint Param[1]: dst (type: Color) Param[2]: src (type: Color) Param[3]: tint (type: Color) -Function 384: ColorLerp() (3 input parameters) +Function 385: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 385: GetColor() (1 input parameters) +Function 386: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 386: GetPixelColor() (2 input parameters) +Function 387: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: void *) Param[2]: format (type: int) -Function 387: SetPixelColor() (3 input parameters) +Function 388: SetPixelColor() (3 input parameters) Name: SetPixelColor Return type: void Description: Set color formatted into destination pixel pointer Param[1]: dstPtr (type: void *) Param[2]: color (type: Color) Param[3]: format (type: int) -Function 388: GetPixelDataSize() (3 input parameters) +Function 389: GetPixelDataSize() (3 input parameters) Name: GetPixelDataSize Return type: int Description: Get pixel data size in bytes for certain format Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: format (type: int) -Function 389: GetFontDefault() (0 input parameters) +Function 390: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 390: LoadFont() (1 input parameters) +Function 391: LoadFont() (1 input parameters) Name: LoadFont Return type: Font Description: Load font from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 391: LoadFontEx() (4 input parameters) +Function 392: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3439,14 +3444,14 @@ Function 391: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 392: LoadFontFromImage() (3 input parameters) +Function 393: LoadFontFromImage() (3 input parameters) Name: LoadFontFromImage Return type: Font Description: Load font from Image (XNA style) Param[1]: image (type: Image) Param[2]: key (type: Color) Param[3]: firstChar (type: int) -Function 393: LoadFontFromMemory() (6 input parameters) +Function 394: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3456,12 +3461,12 @@ Function 393: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 394: IsFontValid() (1 input parameters) +Function 395: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if a font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 395: LoadFontData() (6 input parameters) +Function 396: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3471,7 +3476,7 @@ Function 395: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 396: GenImageFontAtlas() (6 input parameters) +Function 397: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3481,30 +3486,30 @@ Function 396: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 397: UnloadFontData() (2 input parameters) +Function 398: UnloadFontData() (2 input parameters) Name: UnloadFontData Return type: void Description: Unload font chars info data (RAM) Param[1]: glyphs (type: GlyphInfo *) Param[2]: glyphCount (type: int) -Function 398: UnloadFont() (1 input parameters) +Function 399: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 399: ExportFontAsCode() (2 input parameters) +Function 400: ExportFontAsCode() (2 input parameters) Name: ExportFontAsCode Return type: bool Description: Export font as code file, returns true on success Param[1]: font (type: Font) Param[2]: fileName (type: const char *) -Function 400: DrawFPS() (2 input parameters) +Function 401: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 401: DrawText() (5 input parameters) +Function 402: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3513,7 +3518,7 @@ Function 401: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 402: DrawTextEx() (6 input parameters) +Function 403: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3523,7 +3528,7 @@ Function 402: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 403: DrawTextPro() (8 input parameters) +Function 404: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3535,7 +3540,7 @@ Function 403: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 404: DrawTextCodepoint() (5 input parameters) +Function 405: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3544,7 +3549,7 @@ Function 404: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 405: DrawTextCodepoints() (7 input parameters) +Function 406: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3555,18 +3560,18 @@ Function 405: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 406: SetTextLineSpacing() (1 input parameters) +Function 407: SetTextLineSpacing() (1 input parameters) Name: SetTextLineSpacing Return type: void Description: Set vertical line spacing when drawing with line-breaks Param[1]: spacing (type: int) -Function 407: MeasureText() (2 input parameters) +Function 408: MeasureText() (2 input parameters) Name: MeasureText Return type: int Description: Measure string width for default font Param[1]: text (type: const char *) Param[2]: fontSize (type: int) -Function 408: MeasureTextEx() (4 input parameters) +Function 409: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3574,195 +3579,195 @@ Function 408: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 409: GetGlyphIndex() (2 input parameters) +Function 410: GetGlyphIndex() (2 input parameters) Name: GetGlyphIndex Return type: int Description: Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 410: GetGlyphInfo() (2 input parameters) +Function 411: GetGlyphInfo() (2 input parameters) Name: GetGlyphInfo Return type: GlyphInfo Description: Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 411: GetGlyphAtlasRec() (2 input parameters) +Function 412: GetGlyphAtlasRec() (2 input parameters) Name: GetGlyphAtlasRec Return type: Rectangle Description: Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 412: LoadUTF8() (2 input parameters) +Function 413: LoadUTF8() (2 input parameters) Name: LoadUTF8 Return type: char * Description: Load UTF-8 text encoded from codepoints array Param[1]: codepoints (type: const int *) Param[2]: length (type: int) -Function 413: UnloadUTF8() (1 input parameters) +Function 414: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 414: LoadCodepoints() (2 input parameters) +Function 415: LoadCodepoints() (2 input parameters) Name: LoadCodepoints Return type: int * Description: Load all codepoints from a UTF-8 text string, codepoints count returned by parameter Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 415: UnloadCodepoints() (1 input parameters) +Function 416: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 416: GetCodepointCount() (1 input parameters) +Function 417: GetCodepointCount() (1 input parameters) Name: GetCodepointCount Return type: int Description: Get total number of codepoints in a UTF-8 encoded string Param[1]: text (type: const char *) -Function 417: GetCodepoint() (2 input parameters) +Function 418: GetCodepoint() (2 input parameters) Name: GetCodepoint Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 418: GetCodepointNext() (2 input parameters) +Function 419: GetCodepointNext() (2 input parameters) Name: GetCodepointNext Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 419: GetCodepointPrevious() (2 input parameters) +Function 420: GetCodepointPrevious() (2 input parameters) Name: GetCodepointPrevious Return type: int Description: Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 420: CodepointToUTF8() (2 input parameters) +Function 421: CodepointToUTF8() (2 input parameters) Name: CodepointToUTF8 Return type: const char * Description: Encode one codepoint into UTF-8 byte array (array length returned as parameter) Param[1]: codepoint (type: int) Param[2]: utf8Size (type: int *) -Function 421: TextCopy() (2 input parameters) +Function 422: TextCopy() (2 input parameters) Name: TextCopy Return type: int Description: Copy one string to another, returns bytes copied Param[1]: dst (type: char *) Param[2]: src (type: const char *) -Function 422: TextIsEqual() (2 input parameters) +Function 423: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text string are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 423: TextLength() (1 input parameters) +Function 424: TextLength() (1 input parameters) Name: TextLength Return type: unsigned int Description: Get text length, checks for '\0' ending Param[1]: text (type: const char *) -Function 424: TextFormat() (2 input parameters) +Function 425: TextFormat() (2 input parameters) Name: TextFormat Return type: const char * Description: Text formatting with variables (sprintf() style) Param[1]: text (type: const char *) Param[2]: args (type: ...) -Function 425: TextSubtext() (3 input parameters) +Function 426: TextSubtext() (3 input parameters) Name: TextSubtext Return type: const char * Description: Get a piece of a text string Param[1]: text (type: const char *) Param[2]: position (type: int) Param[3]: length (type: int) -Function 426: TextReplace() (3 input parameters) +Function 427: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: replace (type: const char *) Param[3]: by (type: const char *) -Function 427: TextInsert() (3 input parameters) +Function 428: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a position (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 428: TextJoin() (3 input parameters) +Function 429: TextJoin() (3 input parameters) Name: TextJoin Return type: const char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 429: TextSplit() (3 input parameters) +Function 430: TextSplit() (3 input parameters) Name: TextSplit Return type: const char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 430: TextAppend() (3 input parameters) +Function 431: TextAppend() (3 input parameters) Name: TextAppend Return type: void Description: Append text at specific position and move cursor! Param[1]: text (type: char *) Param[2]: append (type: const char *) Param[3]: position (type: int *) -Function 431: TextFindIndex() (2 input parameters) +Function 432: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string Param[1]: text (type: const char *) Param[2]: find (type: const char *) -Function 432: TextToUpper() (1 input parameters) +Function 433: TextToUpper() (1 input parameters) Name: TextToUpper Return type: const char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 433: TextToLower() (1 input parameters) +Function 434: TextToLower() (1 input parameters) Name: TextToLower Return type: const char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 434: TextToPascal() (1 input parameters) +Function 435: TextToPascal() (1 input parameters) Name: TextToPascal Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 435: TextToSnake() (1 input parameters) +Function 436: TextToSnake() (1 input parameters) Name: TextToSnake Return type: const char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 436: TextToCamel() (1 input parameters) +Function 437: TextToCamel() (1 input parameters) Name: TextToCamel Return type: const char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 437: TextToInteger() (1 input parameters) +Function 438: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 438: TextToFloat() (1 input parameters) +Function 439: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 439: DrawLine3D() (3 input parameters) +Function 440: DrawLine3D() (3 input parameters) Name: DrawLine3D Return type: void Description: Draw a line in 3D world space Param[1]: startPos (type: Vector3) Param[2]: endPos (type: Vector3) Param[3]: color (type: Color) -Function 440: DrawPoint3D() (2 input parameters) +Function 441: DrawPoint3D() (2 input parameters) Name: DrawPoint3D Return type: void Description: Draw a point in 3D space, actually a small line Param[1]: position (type: Vector3) Param[2]: color (type: Color) -Function 441: DrawCircle3D() (5 input parameters) +Function 442: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3771,7 +3776,7 @@ Function 441: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 442: DrawTriangle3D() (4 input parameters) +Function 443: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3779,14 +3784,14 @@ Function 442: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 443: DrawTriangleStrip3D() (3 input parameters) +Function 444: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 444: DrawCube() (5 input parameters) +Function 445: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3795,14 +3800,14 @@ Function 444: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 445: DrawCubeV() (3 input parameters) +Function 446: DrawCubeV() (3 input parameters) Name: DrawCubeV Return type: void Description: Draw cube (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 446: DrawCubeWires() (5 input parameters) +Function 447: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3811,21 +3816,21 @@ Function 446: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 447: DrawCubeWiresV() (3 input parameters) +Function 448: DrawCubeWiresV() (3 input parameters) Name: DrawCubeWiresV Return type: void Description: Draw cube wires (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 448: DrawSphere() (3 input parameters) +Function 449: DrawSphere() (3 input parameters) Name: DrawSphere Return type: void Description: Draw sphere Param[1]: centerPos (type: Vector3) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 449: DrawSphereEx() (5 input parameters) +Function 450: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3834,7 +3839,7 @@ Function 449: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 450: DrawSphereWires() (5 input parameters) +Function 451: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3843,7 +3848,7 @@ Function 450: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 451: DrawCylinder() (6 input parameters) +Function 452: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3853,7 +3858,7 @@ Function 451: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 452: DrawCylinderEx() (6 input parameters) +Function 453: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3863,7 +3868,7 @@ Function 452: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 453: DrawCylinderWires() (6 input parameters) +Function 454: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3873,7 +3878,7 @@ Function 453: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 454: DrawCylinderWiresEx() (6 input parameters) +Function 455: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3883,7 +3888,7 @@ Function 454: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 455: DrawCapsule() (6 input parameters) +Function 456: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3893,7 +3898,7 @@ Function 455: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 456: DrawCapsuleWires() (6 input parameters) +Function 457: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3903,51 +3908,51 @@ Function 456: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 457: DrawPlane() (3 input parameters) +Function 458: DrawPlane() (3 input parameters) Name: DrawPlane Return type: void Description: Draw a plane XZ Param[1]: centerPos (type: Vector3) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 458: DrawRay() (2 input parameters) +Function 459: DrawRay() (2 input parameters) Name: DrawRay Return type: void Description: Draw a ray line Param[1]: ray (type: Ray) Param[2]: color (type: Color) -Function 459: DrawGrid() (2 input parameters) +Function 460: DrawGrid() (2 input parameters) Name: DrawGrid Return type: void Description: Draw a grid (centered at (0, 0, 0)) Param[1]: slices (type: int) Param[2]: spacing (type: float) -Function 460: LoadModel() (1 input parameters) +Function 461: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 461: LoadModelFromMesh() (1 input parameters) +Function 462: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 462: IsModelValid() (1 input parameters) +Function 463: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if a model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 463: UnloadModel() (1 input parameters) +Function 464: UnloadModel() (1 input parameters) Name: UnloadModel Return type: void Description: Unload model (including meshes) from memory (RAM and/or VRAM) Param[1]: model (type: Model) -Function 464: GetModelBoundingBox() (1 input parameters) +Function 465: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 465: DrawModel() (4 input parameters) +Function 466: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3955,7 +3960,7 @@ Function 465: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 466: DrawModelEx() (6 input parameters) +Function 467: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3965,7 +3970,7 @@ Function 466: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 467: DrawModelWires() (4 input parameters) +Function 468: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3973,7 +3978,7 @@ Function 467: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 468: DrawModelWiresEx() (6 input parameters) +Function 469: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3983,7 +3988,7 @@ Function 468: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 469: DrawModelPoints() (4 input parameters) +Function 470: DrawModelPoints() (4 input parameters) Name: DrawModelPoints Return type: void Description: Draw a model as points @@ -3991,7 +3996,7 @@ Function 469: DrawModelPoints() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 470: DrawModelPointsEx() (6 input parameters) +Function 471: DrawModelPointsEx() (6 input parameters) Name: DrawModelPointsEx Return type: void Description: Draw a model as points with extended parameters @@ -4001,13 +4006,13 @@ Function 470: DrawModelPointsEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 471: DrawBoundingBox() (2 input parameters) +Function 472: DrawBoundingBox() (2 input parameters) Name: DrawBoundingBox Return type: void Description: Draw bounding box (wires) Param[1]: box (type: BoundingBox) Param[2]: color (type: Color) -Function 472: DrawBillboard() (5 input parameters) +Function 473: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4016,7 +4021,7 @@ Function 472: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 473: DrawBillboardRec() (6 input parameters) +Function 474: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -4026,7 +4031,7 @@ Function 473: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 474: DrawBillboardPro() (9 input parameters) +Function 475: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -4039,13 +4044,13 @@ Function 474: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 475: UploadMesh() (2 input parameters) +Function 476: UploadMesh() (2 input parameters) Name: UploadMesh Return type: void Description: Upload mesh vertex data in GPU and provide VAO/VBO ids Param[1]: mesh (type: Mesh *) Param[2]: dynamic (type: bool) -Function 476: UpdateMeshBuffer() (5 input parameters) +Function 477: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4054,19 +4059,19 @@ Function 476: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 477: UnloadMesh() (1 input parameters) +Function 478: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 478: DrawMesh() (3 input parameters) +Function 479: DrawMesh() (3 input parameters) Name: DrawMesh Return type: void Description: Draw a 3d mesh with material and transform Param[1]: mesh (type: Mesh) Param[2]: material (type: Material) Param[3]: transform (type: Matrix) -Function 479: DrawMeshInstanced() (4 input parameters) +Function 480: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4074,35 +4079,35 @@ Function 479: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 480: GetMeshBoundingBox() (1 input parameters) +Function 481: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 481: GenMeshTangents() (1 input parameters) +Function 482: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 482: ExportMesh() (2 input parameters) +Function 483: ExportMesh() (2 input parameters) Name: ExportMesh Return type: bool Description: Export mesh data to file, returns true on success Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 483: ExportMeshAsCode() (2 input parameters) +Function 484: ExportMeshAsCode() (2 input parameters) Name: ExportMeshAsCode Return type: bool Description: Export mesh as code file (.h) defining multiple arrays of vertex attributes Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 484: GenMeshPoly() (2 input parameters) +Function 485: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 485: GenMeshPlane() (4 input parameters) +Function 486: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4110,42 +4115,42 @@ Function 485: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 486: GenMeshCube() (3 input parameters) +Function 487: GenMeshCube() (3 input parameters) Name: GenMeshCube Return type: Mesh Description: Generate cuboid mesh Param[1]: width (type: float) Param[2]: height (type: float) Param[3]: length (type: float) -Function 487: GenMeshSphere() (3 input parameters) +Function 488: GenMeshSphere() (3 input parameters) Name: GenMeshSphere Return type: Mesh Description: Generate sphere mesh (standard sphere) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 488: GenMeshHemiSphere() (3 input parameters) +Function 489: GenMeshHemiSphere() (3 input parameters) Name: GenMeshHemiSphere Return type: Mesh Description: Generate half-sphere mesh (no bottom cap) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 489: GenMeshCylinder() (3 input parameters) +Function 490: GenMeshCylinder() (3 input parameters) Name: GenMeshCylinder Return type: Mesh Description: Generate cylinder mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 490: GenMeshCone() (3 input parameters) +Function 491: GenMeshCone() (3 input parameters) Name: GenMeshCone Return type: Mesh Description: Generate cone/pyramid mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 491: GenMeshTorus() (4 input parameters) +Function 492: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4153,7 +4158,7 @@ Function 491: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 492: GenMeshKnot() (4 input parameters) +Function 493: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4161,91 +4166,91 @@ Function 492: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 493: GenMeshHeightmap() (2 input parameters) +Function 494: GenMeshHeightmap() (2 input parameters) Name: GenMeshHeightmap Return type: Mesh Description: Generate heightmap mesh from image data Param[1]: heightmap (type: Image) Param[2]: size (type: Vector3) -Function 494: GenMeshCubicmap() (2 input parameters) +Function 495: GenMeshCubicmap() (2 input parameters) Name: GenMeshCubicmap Return type: Mesh Description: Generate cubes-based map mesh from image data Param[1]: cubicmap (type: Image) Param[2]: cubeSize (type: Vector3) -Function 495: LoadMaterials() (2 input parameters) +Function 496: LoadMaterials() (2 input parameters) Name: LoadMaterials Return type: Material * Description: Load materials from model file Param[1]: fileName (type: const char *) Param[2]: materialCount (type: int *) -Function 496: LoadMaterialDefault() (0 input parameters) +Function 497: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 497: IsMaterialValid() (1 input parameters) +Function 498: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if a material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 498: UnloadMaterial() (1 input parameters) +Function 499: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 499: SetMaterialTexture() (3 input parameters) +Function 500: SetMaterialTexture() (3 input parameters) Name: SetMaterialTexture Return type: void Description: Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) Param[1]: material (type: Material *) Param[2]: mapType (type: int) Param[3]: texture (type: Texture2D) -Function 500: SetModelMeshMaterial() (3 input parameters) +Function 501: SetModelMeshMaterial() (3 input parameters) Name: SetModelMeshMaterial Return type: void Description: Set material for a mesh Param[1]: model (type: Model *) Param[2]: meshId (type: int) Param[3]: materialId (type: int) -Function 501: LoadModelAnimations() (2 input parameters) +Function 502: LoadModelAnimations() (2 input parameters) Name: LoadModelAnimations Return type: ModelAnimation * Description: Load model animations from file Param[1]: fileName (type: const char *) Param[2]: animCount (type: int *) -Function 502: UpdateModelAnimation() (3 input parameters) +Function 503: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (CPU) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 503: UpdateModelAnimationBones() (3 input parameters) +Function 504: UpdateModelAnimationBones() (3 input parameters) Name: UpdateModelAnimationBones Return type: void Description: Update model animation mesh bone matrices (GPU skinning) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 504: UnloadModelAnimation() (1 input parameters) +Function 505: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 505: UnloadModelAnimations() (2 input parameters) +Function 506: UnloadModelAnimations() (2 input parameters) Name: UnloadModelAnimations Return type: void Description: Unload animation array data Param[1]: animations (type: ModelAnimation *) Param[2]: animCount (type: int) -Function 506: IsModelAnimationValid() (2 input parameters) +Function 507: IsModelAnimationValid() (2 input parameters) Name: IsModelAnimationValid Return type: bool Description: Check model animation skeleton match Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) -Function 507: CheckCollisionSpheres() (4 input parameters) +Function 508: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4253,40 +4258,40 @@ Function 507: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 508: CheckCollisionBoxes() (2 input parameters) +Function 509: CheckCollisionBoxes() (2 input parameters) Name: CheckCollisionBoxes Return type: bool Description: Check collision between two bounding boxes Param[1]: box1 (type: BoundingBox) Param[2]: box2 (type: BoundingBox) -Function 509: CheckCollisionBoxSphere() (3 input parameters) +Function 510: CheckCollisionBoxSphere() (3 input parameters) Name: CheckCollisionBoxSphere Return type: bool Description: Check collision between box and sphere Param[1]: box (type: BoundingBox) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 510: GetRayCollisionSphere() (3 input parameters) +Function 511: GetRayCollisionSphere() (3 input parameters) Name: GetRayCollisionSphere Return type: RayCollision Description: Get collision info between ray and sphere Param[1]: ray (type: Ray) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 511: GetRayCollisionBox() (2 input parameters) +Function 512: GetRayCollisionBox() (2 input parameters) Name: GetRayCollisionBox Return type: RayCollision Description: Get collision info between ray and box Param[1]: ray (type: Ray) Param[2]: box (type: BoundingBox) -Function 512: GetRayCollisionMesh() (3 input parameters) +Function 513: GetRayCollisionMesh() (3 input parameters) Name: GetRayCollisionMesh Return type: RayCollision Description: Get collision info between ray and mesh Param[1]: ray (type: Ray) Param[2]: mesh (type: Mesh) Param[3]: transform (type: Matrix) -Function 513: GetRayCollisionTriangle() (4 input parameters) +Function 514: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4294,7 +4299,7 @@ Function 513: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 514: GetRayCollisionQuad() (5 input parameters) +Function 515: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4303,158 +4308,158 @@ Function 514: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 515: InitAudioDevice() (0 input parameters) +Function 516: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 516: CloseAudioDevice() (0 input parameters) +Function 517: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 517: IsAudioDeviceReady() (0 input parameters) +Function 518: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 518: SetMasterVolume() (1 input parameters) +Function 519: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 519: GetMasterVolume() (0 input parameters) +Function 520: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 520: LoadWave() (1 input parameters) +Function 521: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 521: LoadWaveFromMemory() (3 input parameters) +Function 522: LoadWaveFromMemory() (3 input parameters) Name: LoadWaveFromMemory Return type: Wave Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 522: IsWaveValid() (1 input parameters) +Function 523: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Checks if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 523: LoadSound() (1 input parameters) +Function 524: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 524: LoadSoundFromWave() (1 input parameters) +Function 525: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 525: LoadSoundAlias() (1 input parameters) +Function 526: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Create a new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 526: IsSoundValid() (1 input parameters) +Function 527: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Checks if a sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 527: UpdateSound() (3 input parameters) +Function 528: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 528: UnloadWave() (1 input parameters) +Function 529: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 529: UnloadSound() (1 input parameters) +Function 530: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 530: UnloadSoundAlias() (1 input parameters) +Function 531: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload a sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 531: ExportWave() (2 input parameters) +Function 532: ExportWave() (2 input parameters) Name: ExportWave Return type: bool Description: Export wave data to file, returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 532: ExportWaveAsCode() (2 input parameters) +Function 533: ExportWaveAsCode() (2 input parameters) Name: ExportWaveAsCode Return type: bool Description: Export wave sample data to code (.h), returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 533: PlaySound() (1 input parameters) +Function 534: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 534: StopSound() (1 input parameters) +Function 535: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 535: PauseSound() (1 input parameters) +Function 536: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 536: ResumeSound() (1 input parameters) +Function 537: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 537: IsSoundPlaying() (1 input parameters) +Function 538: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 538: SetSoundVolume() (2 input parameters) +Function 539: SetSoundVolume() (2 input parameters) Name: SetSoundVolume Return type: void Description: Set volume for a sound (1.0 is max level) Param[1]: sound (type: Sound) Param[2]: volume (type: float) -Function 539: SetSoundPitch() (2 input parameters) +Function 540: SetSoundPitch() (2 input parameters) Name: SetSoundPitch Return type: void Description: Set pitch for a sound (1.0 is base level) Param[1]: sound (type: Sound) Param[2]: pitch (type: float) -Function 540: SetSoundPan() (2 input parameters) +Function 541: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (0.5 is center) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 541: WaveCopy() (1 input parameters) +Function 542: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 542: WaveCrop() (3 input parameters) +Function 543: WaveCrop() (3 input parameters) Name: WaveCrop Return type: void Description: Crop a wave to defined frames range Param[1]: wave (type: Wave *) Param[2]: initFrame (type: int) Param[3]: finalFrame (type: int) -Function 543: WaveFormat() (4 input parameters) +Function 544: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4462,203 +4467,203 @@ Function 543: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 544: LoadWaveSamples() (1 input parameters) +Function 545: LoadWaveSamples() (1 input parameters) Name: LoadWaveSamples Return type: float * Description: Load samples data from wave as a 32bit float data array Param[1]: wave (type: Wave) -Function 545: UnloadWaveSamples() (1 input parameters) +Function 546: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 546: LoadMusicStream() (1 input parameters) +Function 547: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 547: LoadMusicStreamFromMemory() (3 input parameters) +Function 548: LoadMusicStreamFromMemory() (3 input parameters) Name: LoadMusicStreamFromMemory Return type: Music Description: Load music stream from data Param[1]: fileType (type: const char *) Param[2]: data (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 548: IsMusicValid() (1 input parameters) +Function 549: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Checks if a music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 549: UnloadMusicStream() (1 input parameters) +Function 550: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 550: PlayMusicStream() (1 input parameters) +Function 551: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 551: IsMusicStreamPlaying() (1 input parameters) +Function 552: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 552: UpdateMusicStream() (1 input parameters) +Function 553: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 553: StopMusicStream() (1 input parameters) +Function 554: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 554: PauseMusicStream() (1 input parameters) +Function 555: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 555: ResumeMusicStream() (1 input parameters) +Function 556: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 556: SeekMusicStream() (2 input parameters) +Function 557: SeekMusicStream() (2 input parameters) Name: SeekMusicStream Return type: void Description: Seek music to a position (in seconds) Param[1]: music (type: Music) Param[2]: position (type: float) -Function 557: SetMusicVolume() (2 input parameters) +Function 558: SetMusicVolume() (2 input parameters) Name: SetMusicVolume Return type: void Description: Set volume for music (1.0 is max level) Param[1]: music (type: Music) Param[2]: volume (type: float) -Function 558: SetMusicPitch() (2 input parameters) +Function 559: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for a music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 559: SetMusicPan() (2 input parameters) +Function 560: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for a music (0.5 is center) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 560: GetMusicTimeLength() (1 input parameters) +Function 561: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 561: GetMusicTimePlayed() (1 input parameters) +Function 562: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 562: LoadAudioStream() (3 input parameters) +Function 563: LoadAudioStream() (3 input parameters) Name: LoadAudioStream Return type: AudioStream Description: Load audio stream (to stream raw audio pcm data) Param[1]: sampleRate (type: unsigned int) Param[2]: sampleSize (type: unsigned int) Param[3]: channels (type: unsigned int) -Function 563: IsAudioStreamValid() (1 input parameters) +Function 564: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Checks if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 564: UnloadAudioStream() (1 input parameters) +Function 565: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 565: UpdateAudioStream() (3 input parameters) +Function 566: UpdateAudioStream() (3 input parameters) Name: UpdateAudioStream Return type: void Description: Update audio stream buffers with data Param[1]: stream (type: AudioStream) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 566: IsAudioStreamProcessed() (1 input parameters) +Function 567: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 567: PlayAudioStream() (1 input parameters) +Function 568: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 568: PauseAudioStream() (1 input parameters) +Function 569: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 569: ResumeAudioStream() (1 input parameters) +Function 570: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 570: IsAudioStreamPlaying() (1 input parameters) +Function 571: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 571: StopAudioStream() (1 input parameters) +Function 572: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 572: SetAudioStreamVolume() (2 input parameters) +Function 573: SetAudioStreamVolume() (2 input parameters) Name: SetAudioStreamVolume Return type: void Description: Set volume for audio stream (1.0 is max level) Param[1]: stream (type: AudioStream) Param[2]: volume (type: float) -Function 573: SetAudioStreamPitch() (2 input parameters) +Function 574: SetAudioStreamPitch() (2 input parameters) Name: SetAudioStreamPitch Return type: void Description: Set pitch for audio stream (1.0 is base level) Param[1]: stream (type: AudioStream) Param[2]: pitch (type: float) -Function 574: SetAudioStreamPan() (2 input parameters) +Function 575: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (0.5 is centered) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 575: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 576: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 576: SetAudioStreamCallback() (2 input parameters) +Function 577: SetAudioStreamCallback() (2 input parameters) Name: SetAudioStreamCallback Return type: void Description: Audio thread callback to request new data Param[1]: stream (type: AudioStream) Param[2]: callback (type: AudioCallback) -Function 577: AttachAudioStreamProcessor() (2 input parameters) +Function 578: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 578: DetachAudioStreamProcessor() (2 input parameters) +Function 579: DetachAudioStreamProcessor() (2 input parameters) Name: DetachAudioStreamProcessor Return type: void Description: Detach audio stream processor from stream Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 579: AttachAudioMixedProcessor() (1 input parameters) +Function 580: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 580: DetachAudioMixedProcessor() (1 input parameters) +Function 581: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 20cb502d8..b91874cc0 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -674,7 +674,7 @@ - + @@ -795,6 +795,8 @@ + + From ce3b121f07ae9b0aae87e3adc9a30d4a4a816924 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sun, 10 Nov 2024 13:47:15 +0100 Subject: [PATCH 015/194] build.zig: Remove addRaylib and fix raygui builds when using raylib as dep (#4475) - addRaylib just duplicates what adding raylib as dependency already does so it do not needs to exist - move raygui build to standard build process when flag is enabled. this works correctly when using raylib as dependency and having raygui as dependency as well. problem with previous approach was that raygui was in options but it was doing nothing because you had to also use addRaygui for it to be effective Signed-off-by: Tomas Slusny --- build.zig | 85 ++++++++++++++++--------------------------------------- 1 file changed, 25 insertions(+), 60 deletions(-) diff --git a/build.zig b/build.zig index c5e2f718b..9c2757364 100644 --- a/build.zig +++ b/build.zig @@ -11,36 +11,6 @@ comptime { @compileError("Raylib requires zig version " ++ min_ver); } -// NOTE(freakmangd): I don't like using a global here, but it prevents having to -// get the flags a second time when adding raygui -var raylib_flags_arr: std.ArrayListUnmanaged([]const u8) = .{}; - -// This has been tested with zig version 0.13.0 -pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile { - const raylib_dep = b.dependencyFromBuildZig(@This(), .{ - .target = target, - .optimize = optimize, - .raudio = options.raudio, - .rmodels = options.rmodels, - .rshapes = options.rshapes, - .rtext = options.rtext, - .rtextures = options.rtextures, - .platform = options.platform, - .shared = options.shared, - .linux_display_backend = options.linux_display_backend, - .opengl_version = options.opengl_version, - .config = options.config, - }); - const raylib = raylib_dep.artifact("raylib"); - - if (options.raygui) { - const raygui_dep = b.dependency(options.raygui_dependency_name, .{}); - addRaygui(b, raylib, raygui_dep); - } - - return raylib; -} - fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void { raylib.defineCMacro("PLATFORM_DESKTOP", null); @@ -107,21 +77,26 @@ const config_h_flags = outer: { }; fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile { - raylib_flags_arr.clearRetainingCapacity(); + var raylib_flags_arr = std.ArrayList([]const u8).init(b.allocator); + defer raylib_flags_arr.deinit(); - const shared_flags = &[_][]const u8{ - "-fPIC", - "-DBUILD_LIBTYPE_SHARED", - }; - try raylib_flags_arr.appendSlice(b.allocator, &[_][]const u8{ + try raylib_flags_arr.appendSlice(&[_][]const u8{ "-std=gnu99", "-D_GNU_SOURCE", "-DGL_SILENCE_DEPRECATION=199309L", "-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/3674 }); + + if (options.shared) { + try raylib_flags_arr.appendSlice(&[_][]const u8{ + "-fPIC", + "-DBUILD_LIBTYPE_SHARED", + }); + } + if (options.config.len > 0) { // Sets a flag indiciating the use of a custom `config.h` - try raylib_flags_arr.append(b.allocator, "-DEXTERNAL_CONFIG_FLAGS"); + try raylib_flags_arr.append("-DEXTERNAL_CONFIG_FLAGS"); // Splits a space-separated list of config flags into multiple flags // @@ -131,7 +106,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. // Apply config flags supplied by the user while (config_iter.next()) |config_flag| - try raylib_flags_arr.append(b.allocator, config_flag); + try raylib_flags_arr.append(config_flag); // Apply all relevant configs from `src/config.h` *except* the user-specified ones // @@ -149,14 +124,10 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. } // Otherwise, append default value from config.h to compile flags - try raylib_flags_arr.append(b.allocator, flag); + try raylib_flags_arr.append(flag); } } - if (options.shared) { - try raylib_flags_arr.appendSlice(b.allocator, shared_flags); - } - const raylib = if (options.shared) b.addSharedLibrary(.{ .name = "raylib", @@ -288,7 +259,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. } // On macos rglfw.c include Objective-C files. - try raylib_flags_arr.append(b.allocator, "-ObjC"); + try raylib_flags_arr.append("-ObjC"); raylib.root_module.addCSourceFile(.{ .file = b.path("src/rglfw.c"), .flags = raylib_flags_arr.items, @@ -327,25 +298,19 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. .flags = raylib_flags_arr.items, }); - return raylib; -} + if (options.raygui) { + const raygui_dep = b.dependency(options.raygui_dependency_name, .{}); -/// This function does not need to be called if you passed .raygui = true to addRaylib -pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency) void { - if (raylib_flags_arr.items.len == 0) { - @panic( - \\argument 2 `raylib` in `addRaygui` must come from b.dependency("raylib", ...).artifact("raylib") - ); + var gen_step = b.addWriteFiles(); + raylib.step.dependOn(&gen_step.step); + + const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); + raylib.addCSourceFile(.{ .file = raygui_c_path, .flags = raylib_flags_arr.items }); + raylib.addIncludePath(raygui_dep.path("src")); + raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); } - var gen_step = b.addWriteFiles(); - raylib.step.dependOn(&gen_step.step); - - const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); - raylib.addCSourceFile(.{ .file = raygui_c_path, .flags = raylib_flags_arr.items }); - raylib.addIncludePath(raygui_dep.path("src")); - - raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); + return raylib; } pub const Options = struct { From 85de743d1c2da8ea14a5962c9feadac32eb91151 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 10 Nov 2024 17:53:50 +0100 Subject: [PATCH 016/194] Improved logos size --- logo/raylib.ico | Bin 9752 -> 6177 bytes logo/raylib_1024x1024.png | Bin 4536 -> 4591 bytes logo/raylib_144x144.png | Bin 422 -> 475 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/logo/raylib.ico b/logo/raylib.ico index 0cedcc55cee7da0e5784256078a93f2901e5d734..8dd7bb7add704d75af0588f095ab2a5486eb8a87 100644 GIT binary patch literal 6177 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 literal 9752 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 AR{#J2 diff --git a/logo/raylib_1024x1024.png b/logo/raylib_1024x1024.png index b855a6bf64bc19ab0b04c2ce9d22e601bf17c5d6..3930aeb79e595f2571e1035391bc4c1e32bf059c 100644 GIT binary patch delta 72 zcmdm?{9bv(dO-*664!_lm(=3qqRfJl%=|otqQuIa%p`^Uw6x6R%)}gpoc#2BD+NOX YBa;dc5nGgXg#idWUHx3vIVCg!0Mic`;s5{u delta 17 YcmaE_yhC}zdO=PGPgg&ebxsLQ06iWCSpWb4 diff --git a/logo/raylib_144x144.png b/logo/raylib_144x144.png index 7c533d2de571bbe5ac2633049ffb543fc54e5b71..f89d90b23ce52f7c11155258738a45d48bb47ee5 100644 GIT binary patch delta 62 zcmZ3+e4BZKvN3~ZiEBiOOKNd)QD#9&W_}(+QDS9IW|BgFT3TjuW@3&)PJVj6m4cy( QNd*w|EoRT$sMyK~0H)Ry&Hw-a delta 10 Rcmcc3yo`B*^2Uf}MgSJt1IPdX From 2af4f317122d73dd459e0c9c3aed14192c08c186 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Sun, 10 Nov 2024 13:04:58 -0800 Subject: [PATCH 017/194] Fix the X axis of the second vertex of the Y negative cap of a cylinders, triangle fan (#4478) --- src/rmodels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 6ddb53ae4..04f7210f2 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -603,7 +603,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h for (int i = 0; i < sides; i++) { rlVertex3f(0, 0, 0); - rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+1)*angleStep)*radiusBottom, 0, cosf(DEG2RAD*(i+1)*angleStep)*radiusBottom); rlVertex3f(sinf(DEG2RAD*i*angleStep)*radiusBottom, 0, cosf(DEG2RAD*i*angleStep)*radiusBottom); } From fb69b39d548ffa3c4e89daea2dc08c09f2c3da8d Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 11 Nov 2024 10:46:54 -0800 Subject: [PATCH 018/194] Fix a typecast warning in glfw clipboard access (#4479) --- src/platforms/rcore_desktop_glfw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index e765debc1..061fe72ca 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -988,7 +988,7 @@ Image GetClipboardImage(void) } else { - image = LoadImageFromMemory(".bmp", fileData, dataSize); + image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); } return image; } From 5cc06f4ba4086c868b94034c5a3b48789d9508c0 Mon Sep 17 00:00:00 2001 From: "Everton Jr." <69195288+evertonse@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:47:25 -0300 Subject: [PATCH 019/194] [rcore]: Issue an warning instead of an error when checking SUPPORT_CLIPBOARD_IMAGE necessary support detection (#4477) --- src/rcore.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 2d1808c14..ba23df776 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -512,10 +512,27 @@ const char *TextFormat(const char *text, ...); // Formatting of tex #define PLATFORM_DESKTOP_GLFW #endif +// We're using `#pragma message` because `#warning` is not adopted by MSVC. #if defined(SUPPORT_CLIPBOARD_IMAGE) - #if !defined(SUPPORT_FILEFORMAT_BMP) || !defined(STBI_REQUIRED) || !defined(SUPPORT_MODULE_RTEXTURES) - #error "To enabled SUPPORT_CLIPBOARD_IMAGE, it also needs SUPPORT_FILEFORMAT_BMP, SUPPORT_MODULE_RTEXTURES and STBI_REQUIRED to be defined. It should have been defined earlier" + #if !defined(SUPPORT_MODULE_RTEXTURES) + #pragma message ("Warning: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly") #endif + + // It's nice to have support Bitmap on Linux as well, but not as necessary as Windows + #if !defined(SUPPORT_FILEFORMAT_BMP) && defined(_WIN32) + #pragma message ("Warning: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_FILEFORMAT_BMP, specially on Windows") + #endif + + // From what I've tested applications on Wayland saves images on clipboard as PNG. + #if (!defined(SUPPORT_FILEFORMAT_PNG) || !defined(SUPPORT_FILEFORMAT_JPG)) && !defined(_WIN32) + #pragma message ("Warning: Getting image from the clipboard might not work without SUPPORT_FILEFORMAT_PNG or SUPPORT_FILEFORMAT_JPG") + #endif + + // Not needed because `rtexture.c` will automatically defined STBI_REQUIRED when any SUPPORT_FILEFORMAT_* is defined. + // #if !defined(STBI_REQUIRED) + // #pragma message ("Warning: "STBI_REQUIRED is not defined, that means we can't load images from clipbard" + // #endif + #endif // SUPPORT_CLIPBOARD_IMAGE // Include platform-specific submodules From 10fd4de25876657f5b52d30ecbbe2ee98a88dd40 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 11 Nov 2024 10:55:33 -0800 Subject: [PATCH 020/194] Fix the example lighting shaders to use both frag and diffuse colors so they work with shapes and meshes. (#4482) --- examples/shaders/resources/shaders/glsl100/lighting.fs | 4 +++- examples/shaders/resources/shaders/glsl120/lighting.fs | 4 +++- examples/shaders/resources/shaders/glsl330/lighting.fs | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/lighting.fs b/examples/shaders/resources/shaders/glsl100/lighting.fs index 73531a8bb..f9b0bd3c1 100644 --- a/examples/shaders/resources/shaders/glsl100/lighting.fs +++ b/examples/shaders/resources/shaders/glsl100/lighting.fs @@ -40,6 +40,8 @@ void main() vec3 viewD = normalize(viewPos - fragPosition); vec3 specular = vec3(0.0); + vec4 tint = colDiffuse * fragColor; + // NOTE: Implement here your fragment shader code for (int i = 0; i < MAX_LIGHTS; i++) @@ -67,7 +69,7 @@ void main() } } - vec4 finalColor = (texelColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0))); + vec4 finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0))); finalColor += texelColor*(ambient/10.0); // Gamma correction diff --git a/examples/shaders/resources/shaders/glsl120/lighting.fs b/examples/shaders/resources/shaders/glsl120/lighting.fs index 8dda5a549..600c0f84d 100644 --- a/examples/shaders/resources/shaders/glsl120/lighting.fs +++ b/examples/shaders/resources/shaders/glsl120/lighting.fs @@ -38,6 +38,8 @@ void main() vec3 viewD = normalize(viewPos - fragPosition); vec3 specular = vec3(0.0); + vec4 tint = colDiffuse * fragColor; + // NOTE: Implement here your fragment shader code for (int i = 0; i < MAX_LIGHTS; i++) @@ -65,7 +67,7 @@ void main() } } - vec4 finalColor = (texelColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0))); + vec4 finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0))); finalColor += texelColor*(ambient/10.0); // Gamma correction diff --git a/examples/shaders/resources/shaders/glsl330/lighting.fs b/examples/shaders/resources/shaders/glsl330/lighting.fs index d1f3140a1..d2a8e8743 100644 --- a/examples/shaders/resources/shaders/glsl330/lighting.fs +++ b/examples/shaders/resources/shaders/glsl330/lighting.fs @@ -3,7 +3,7 @@ // Input vertex attributes (from vertex shader) in vec3 fragPosition; in vec2 fragTexCoord; -//in vec4 fragColor; +in vec4 fragColor; in vec3 fragNormal; // Input uniform values @@ -41,6 +41,8 @@ void main() vec3 viewD = normalize(viewPos - fragPosition); vec3 specular = vec3(0.0); + vec4 tint = colDiffuse * fragColor; + // NOTE: Implement here your fragment shader code for (int i = 0; i < MAX_LIGHTS; i++) @@ -68,8 +70,8 @@ void main() } } - finalColor = (texelColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0))); - finalColor += texelColor*(ambient/10.0)*colDiffuse; + finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0))); + finalColor += texelColor*(ambient/10.0)*tint; // Gamma correction finalColor = pow(finalColor, vec4(1.0/2.2)); From 4ddf4679b49b253846e87f8500fe28ed417986f0 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 11 Nov 2024 20:28:25 +0100 Subject: [PATCH 021/194] Update CHANGELOG --- CHANGELOG | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e0403dd63..34770bae4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,17 +7,18 @@ Current Release: raylib 5.0 (18 November 2023) Release: raylib 5.5 (November 2024?) ------------------------------------------------------------------------- KEY CHANGES: - - New rcore backend: RGFW - - New raylib project creator tool + - New rcore backends: RGFW and SDL3 - New platforms supported: Dreamcast, N64, PSP, PSVita, PS4 - - GPU Skinning (all platforms and GL versions) - - raymath C++ operators + - Added GPU Skinning support (all platforms and GL versions) + - Added raymath C++ operators + - New tool: raylib project creator Detailed changes: WIP: Last update with commit from 02-Nov-2024 [rcore] ADDED: Working directory info at initialization by @Ray +[rcore] ADDED: `GetClipboardImage()`, supported by multiple backends (#4459) by @evertonse [rcore] ADDED: `MakeDirectory()`, supporting recursive directory creation by @Ray [rcore] ADDED: `ComputeSHA1()` (#4390) by @Anthony Carbajal [rcore] ADDED: `ComputeCRC32()` and `ComputeMD5()` by @Ray @@ -203,6 +204,7 @@ WIP: Last update with commit from 02-Nov-2024 [rtextures] REVIEWED: `ImageDrawRectangleRec()` (#3721) by @Le Juez Victor [rtextures] REVIEWED: `ImageDraw()`, don't try to blend images without alpha (#4395) by @Nikolas [rtextures] REVIEWED: `GenImagePerlinNoise()` being stretched (#4276) by @Bugsia +[rtextures] REVIEWED: `GenImageGradientLinear()`, fix some angles (#4462) by @decromo [rtextures] REVIEWED: `DrawTexturePro()` to avoid negative dest rec #4316 by @Ray [rtextures] REVIEWED: `ColorToInt()`, fix undefined behaviour (#3996) by @OetkenPurveyorOfCode [rtextures] REVIEWED: Remove panorama cubemap layout option (#4425) by @Jeffery Myers @@ -258,7 +260,9 @@ WIP: Last update with commit from 02-Nov-2024 [rmodels] REVIEWED: `GenMeshSphere()`, fix artifacts (#4460) by @MikiZX1 [rmodels] REVIEWED: `GenMeshTangents()`, read uninitialized values, fix bounding case (#4066) by @kai-z99 [rmodels] REVIEWED: `GenMeshTangents()`, fixed out of bounds error (#3990) by @Salvador Galindo +[rmodels] REVIEWED: `UpdateModelAnimation()`, performance speedup (#4470) by @JettMonstersGoBoom [rmodels] REVIEWED: `DrawCylinder()`, fix drawing due to imprecise angle (#4034) by @Paul Melis +[rmodels] REVIEWED: `DrawCylinder()`, fix drawing of cap (#4478) by @JeffM2501 [rmodels] REVIEWED: `DrawMesh()`, send full matModel to shader in DrawMesh (#4005) (#4022) by @David Holland [rmodels] REVIEWED: `DrawMesh()`, fix material specular map retrieval (#3758) by @Victor Gallet [rmodels] REVIEWED: `DrawModelEx()`, simplified multiplication of colors (#4002) by @Le Juez Victor @@ -364,6 +368,7 @@ WIP: Last update with commit from 02-Nov-2024 [build] REVIEWED: build.zig, remove all uses of deps/mingw (#3805) by @Peter0x44 [build] REVIEWED: build.zig, fixed illegal instruction crash (#3682) by @WisonYe [build] REVIEWED: build.zig, fix broken build on #3863 (#3891) by @Nikolas Mauropoulos +[build] REVIEWED: build.zig, improve cross-compilation (#4468) by @deathbeam [build] REVIEWED: CMake, update to raylib 5.0 (#3623) by @Peter0x44 [build] REVIEWED: CMake, added PLATFORM option for Desktop SDL (#3809) by @mooff [build] REVIEWED: CMake, fix GRAPHICS_* check (#4359) by @Kacper Zybała From 7053970f7b4d311f41c604b10ff1b312fead0dc3 Mon Sep 17 00:00:00 2001 From: kimierik <105240664+kimierik@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:52:12 +0200 Subject: [PATCH 022/194] build.zig: remove raygui from options and re add adding raygui as a (#4485) function --- build.zig | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/build.zig b/build.zig index 9c2757364..5c2ac77cd 100644 --- a/build.zig +++ b/build.zig @@ -298,28 +298,26 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. .flags = raylib_flags_arr.items, }); - if (options.raygui) { - const raygui_dep = b.dependency(options.raygui_dependency_name, .{}); - - var gen_step = b.addWriteFiles(); - raylib.step.dependOn(&gen_step.step); - - const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); - raylib.addCSourceFile(.{ .file = raygui_c_path, .flags = raylib_flags_arr.items }); - raylib.addIncludePath(raygui_dep.path("src")); - raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); - } - return raylib; } +pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency) void { + var gen_step = b.addWriteFiles(); + raylib.step.dependOn(&gen_step.step); + + const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); + raylib.addCSourceFile(.{ .file = raygui_c_path }); + raylib.addIncludePath(raygui_dep.path("src")); + + raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); +} + pub const Options = struct { raudio: bool = true, rmodels: bool = true, rshapes: bool = true, rtext: bool = true, rtextures: bool = true, - raygui: bool = false, platform: PlatformBackend = .glfw, shared: bool = false, linux_display_backend: LinuxDisplayBackend = .Both, @@ -327,15 +325,12 @@ pub const Options = struct { /// config should be a list of space-separated cflags, eg, "-DSUPPORT_CUSTOM_FRAME_CONTROL" config: []const u8 = &.{}, - raygui_dependency_name: []const u8 = "raygui", - const defaults = Options{}; fn getOptions(b: *std.Build) Options { return .{ .platform = b.option(PlatformBackend, "platform", "Choose the platform backedn for desktop target") orelse defaults.platform, .raudio = b.option(bool, "raudio", "Compile with audio support") orelse defaults.raudio, - .raygui = b.option(bool, "raygui", "Compile with raygui support") orelse defaults.raygui, .rmodels = b.option(bool, "rmodels", "Compile with models support") orelse defaults.rmodels, .rtext = b.option(bool, "rtext", "Compile with text support") orelse defaults.rtext, .rtextures = b.option(bool, "rtextures", "Compile with textures support") orelse defaults.rtextures, From 377248b1ac3c0d1a56e1e2abea5495aa4c12ec1a Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Wed, 13 Nov 2024 18:21:10 -0300 Subject: [PATCH 023/194] Fix Makefile.Web (#4487) --- examples/Makefile.Web | 56 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 7ea7f4784..13125f22d 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -280,7 +280,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # --preload-file resources # specify a resources folder for data compilation # --source-map-base # allow debugging in browser with source map LDFLAGS += -sUSE_GLFW=3 -sEXPORTED_RUNTIME_METHODS=ccall - + # Build using asyncify ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) LDFLAGS += -sASYNCIFY @@ -383,6 +383,7 @@ CORE = \ core/core_automation_events \ core/core_basic_screen_manager \ core/core_basic_window \ + core/core_basic_window_web \ core/core_custom_frame_control \ core/core_custom_logging \ core/core_drop_files \ @@ -587,6 +588,9 @@ core/core_automation_events : core/core_automation_events.c core/core_basic_window: core/core_basic_window.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) +core/core_basic_window_web: core/core_basic_window_web.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + core/core_basic_screen_manager: core/core_basic_screen_manager.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) @@ -625,6 +629,9 @@ core/core_input_mouse_wheel: core/core_input_mouse_wheel.c core/core_input_multitouch: core/core_input_multitouch.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) +core/core_input_virtual_controls: core/core_input_virtual_controls.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + # NOTE: To use multi-threading raylib must be compiled with multi-theading support (-s USE_PTHREADS=1) # WARNING: For security reasons multi-threading is not supported on browsers, it requires cross-origin isolation (Oct.2021) # WARNING: It requires raylib to be compiled using -pthread, so atomic operations and thread-local data (if any) @@ -747,6 +754,10 @@ textures/textures_gif_player: textures/textures_gif_player.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file textures/resources/scarfy_run.gif@resources/scarfy_run.gif +textures/textures_image_channel: textures/textures_image_channel.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file textures/resources/fudesumi.png@resources/fudesumi.png + textures/textures_image_drawing: textures/textures_image_drawing.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file textures/resources/custom_jupiter_crash.png@resources/custom_jupiter_crash.png \ @@ -907,6 +918,13 @@ models/models_billboard: models/models_billboard.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file models/resources/billboard.png@resources/billboard.png +models/models_bone_socket: models/models_bone_socket.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file models/resources/models/gltf/greenman.glb@resources/models/gltf/greenman.glb \ + --preload-file models/resources/models/gltf/greenman_hat.glb@resources/models/gltf/greenman_hat.glb \ + --preload-file models/resources/models/gltf/greenman_sword.glb@resources/models/gltf/greenman_sword.glb \ + --preload-file models/resources/models/gltf/greenman_shield.glb@resources/models/gltf/greenman_shield.glb + models/models_box_collisions: models/models_box_collisions.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) @@ -961,6 +979,9 @@ models/models_mesh_picking: models/models_mesh_picking.c models/models_orthographic_projection: models/models_orthographic_projection.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) +models/models_point_rendering: models/models_point_rendering.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + models/models_rlgl_solar_system: models/models_rlgl_solar_system.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) @@ -988,6 +1009,24 @@ shaders/shaders_basic_lighting: shaders/shaders_basic_lighting.c --preload-file shaders/resources/shaders/glsl100/lighting.fs@resources/shaders/glsl100/lighting.fs \ --preload-file shaders/resources/shaders/glsl100/lighting.vs@resources/shaders/glsl100/lighting.vs +shaders/shaders_basic_pbr: shaders/shaders_basic_pbr.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file shaders/resources/shaders/glsl100/pbr.vs@resources/shaders/glsl100/pbr.vs \ + --preload-file shaders/resources/shaders/glsl120/pbr.vs@resources/shaders/glsl120/pbr.vs \ + --preload-file shaders/resources/shaders/glsl330/pbr.vs@resources/shaders/glsl330/pbr.vs \ + --preload-file shaders/resources/shaders/glsl100/pbr.fs@resources/shaders/glsl100/pbr.fs \ + --preload-file shaders/resources/shaders/glsl120/pbr.fs@resources/shaders/glsl120/pbr.fs \ + --preload-file shaders/resources/shaders/glsl330/pbr.fs@resources/shaders/glsl330/pbr.fs \ + --preload-file shaders/resources/models/old_car_new.glb@resources/models/old_car_new.glb \ + --preload-file shaders/resources/old_car_d.png@resources/old_car_d.png \ + --preload-file shaders/resources/old_car_mra.png@resources/old_car_mra.png \ + --preload-file shaders/resources/old_car_n.png@resources/old_car_n.png \ + --preload-file shaders/resources/old_car_e.png@resources/old_car_e.png \ + --preload-file shaders/resources/models/plane.glb@resources/models/plane.glb \ + --preload-file shaders/resources/road_a.png@resources/road_a.png \ + --preload-file shaders/resources/road_mra.png@resources/road_mra.png \ + --preload-file shaders/resources/road_n.png@resources/road_n.png + shaders/shaders_custom_uniform: shaders/shaders_custom_uniform.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -sTOTAL_MEMORY=67108864 \ --preload-file shaders/resources/models/barracks.obj@resources/models/barracks.obj \ @@ -1061,6 +1100,14 @@ shaders/shaders_raymarching: shaders/shaders_raymarching.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file shaders/resources/shaders/glsl100/raymarching.fs@resources/shaders/glsl100/raymarching.fs +shaders/shaders_shadowmap: shaders/shaders_shadowmap.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file shaders/resources/shaders/glsl120/shadowmap.vs@resources/shaders/glsl120/shadowmap.vs \ + --preload-file shaders/resources/shaders/glsl330/shadowmap.vs@resources/shaders/glsl330/shadowmap.vs \ + --preload-file shaders/resources/shaders/glsl120/shadowmap.fs@resources/shaders/glsl120/shadowmap.fs \ + --preload-file shaders/resources/shaders/glsl330/shadowmap.fs@resources/shaders/glsl330/shadowmap.fs \ + --preload-file shaders/resources/models/robot.glb@resources/models/robot.glb + shaders/shaders_shapes_textures: shaders/shaders_shapes_textures.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file shaders/resources/fudesumi.png@resources/fudesumi.png \ @@ -1101,6 +1148,13 @@ shaders/shaders_write_depth: shaders/shaders_write_depth.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ --preload-file shaders/resources/shaders/glsl100/write_depth.fs@resources/shaders/glsl100/write_depth.fs +shaders/shaders_vertex_displacement: shaders/shaders_vertex_displacement.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \ + --preload-file shaders/resources/shaders/glsl100/vertex_displacement.vs@resources/shaders/glsl100/vertex_displacement.vs \ + --preload-file shaders/resources/shaders/glsl330/vertex_displacement.vs@resources/shaders/glsl330/vertex_displacement.vs \ + --preload-file shaders/resources/shaders/glsl100/vertex_displacement.fs@resources/shaders/glsl100/vertex_displacement.fs \ + --preload-file shaders/resources/shaders/glsl330/vertex_displacement.fs@resources/shaders/glsl330/vertex_displacement.fs + # Compile AUDIO examples audio/audio_mixed_processor: audio/audio_mixed_processor.c From f76a5e2b10cdee694a0474f35dc629d3e9fd751c Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 10:45:19 +0100 Subject: [PATCH 024/194] Update CHANGELOG --- CHANGELOG | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 34770bae4..9cafc61c0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -117,7 +117,7 @@ WIP: Last update with commit from 02-Nov-2024 [rcore][RGFW] REVIEWED: Replace long switch with a lookup table (#4108) by @Colleague Riley [rcore][RGFW] REVIEWED: Fix MSVC build errors (#4441) by @Colleague Riley [rlgl] ADDED: More uniform data type options #4137 by @Ray -[rlgl] ADDED: Vertex normals for RLGL immediate drawing mode (#3866) by @bohonghuang +[rlgl] ADDED: Vertex normals for RLGL immediate drawing mode (#3866) by @bohonghuang -WARNING- [rlgl] ADDED: `rlCullDistance*()` variables and getters (#3912) by @KotzaBoss [rlgl] ADDED: `rlSetClipPlanes()` function (#3912) by @KotzaBoss [rlgl] ADDED: `isGpuReady` flag, allow font loading with no GPU acceleration by @Ray -WARNING- @@ -150,7 +150,7 @@ WIP: Last update with commit from 02-Nov-2024 [rcamera] REVIEWED: Cleaned away unused macros(#3762) by @Brian E [rcamera] REVIEWED: Fix for free camera mode (#3603) by @lesleyrs [rcamera] REVIEWED: `GetCameraRight()` (#3784) by @Danil -[raymath] ADDED: C++ operator overloads for common math function (#4385) by @Jeffery Myers +[raymath] ADDED: C++ operator overloads for common math function (#4385) by @Jeffery Myers -WARNING- [raymath] ADDED: Vector4 math functions and Vector2 variants of some Vector3 functions (#3828) by @Bowserinator [raymath] REVIEWED: Fix MSVC warnings/errors in C++ (#4125) by @Jeffery Myers [raymath] REVIEWED: Add extern "C" to raymath header for C++ (#3978) by @Jeffery Myers From 0c7edbc2ee220d6b23892e22295237170b684742 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 10:45:56 +0100 Subject: [PATCH 025/194] Update HISTORY.md --- HISTORY.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 6b1a5be29..f7dc14be1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -475,16 +475,34 @@ Undoubtedly, this is the **biggest raylib update in 10 years**. Many new feature notes on raylib 5.5 ------------------- -It's been **1 year** since latest raylib release and **11 years** since raylib 1.0 was officially released... +One year after raylib 5.0 release, arribes raylib 5.5, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. Some numbers for this release: - **+270** closed issues (for a TOTAL of **+1810**!) - - **+760** commits since previous RELEASE (for a TOTAL of **+7730**!) + - **+800** commits since previous RELEASE (for a TOTAL of **+7750**!) - **+30** functions ADDED to raylib API (for a TOTAL of **580**!) - **+110** functions REVIEWED with fixes and improvements - **+140** new contributors (for a TOTAL of **+640**!) Highlights for `raylib 5.5`: -TODO. + - **`NEW` raylib project creator tool**: A brand new support tool developed to help raylib users to setup new projects in a professional way. This tools generates a complete project structure with multiple build systems and ready for GitHub with CI/CD actions pre-configured. And only providing some project C files and basic properties! + + - **`NEW` Platform backend supported: RGFW**: Thanks to the `rcore` platform-split implemented in `raylib 5.0`, adding new platforms backends has been greatly simplified, new backends can be added using provided template, self-contained in a single C module, completely portable. A new platform backend has been added: `RGFW`. `RGFW` is a **new** single-file header-only (`RGFW.h`) portable library intended for platform-functionality management (windowing and inputs); in this case for desktop platforms (Windows, Linux, macOS) and also for Web platform. It adds to the already existing platform backends supporting those same platforms: `GLFW` and `SDL`. + + - **`NEW` Platform backend version supported: SDL3**: Previous `raylib 5.0` added experimental support for `SDL2` library, in this new `raylib` release some issues with SDL2 has been reviewed and it has been added support for the latest `SDL3` implementation. Now users can select at compile time the desired SDL version to use, increasing the number of potential platforms supported in the future! + + - **`NEW` Retro-console platforms supported: Dreamcast, N64, PSP, PSVita, PS4**: Thanks to the platform-split on `raylib 5.0`, supporting new platform backends is easier than ever! Along the `OpenGL 1.1` graphics option supported by raylib, it opened the door to multiple retro-consoles backend implementations! It's amazing to see raylib running on +20 year old consoles like Dreamcast or PSP, considering the hardware constraints of those platforms and proves raylib versability! Those additional platforms can be found in separate repositories (links) and have been created by Antonio Jose Ramos Marquez (@psxdev). + + - **`NEW` GPU Skinning support**: After lots of requests for this feature, it has been finally added to raylib thanks to Daniel Holden (@orangeduck) contribution. Adding GPU skinning was a tricky feature, considering it had to be available for all raylib supported platforms, including limited ones like Raspberry Pi with OpenGL ES 2.0, where some advance OpenGL features are not available (UBO, SSBO, Transform Feedback) but a multi-platform solution was found and this new advance feature was added. An [usage example] was also added and also in the process, current models animation system was greatly improved in performance, simplifiying the required math. + + - **`NEW` [`raymath`](https://github.com/raysan5/raylib/blob/master/src/raymath.h) C++ operators**: After several requested for this feature, C++ math operators for `Vector2`, `Vector3`, `Vector4`, `Quaternion` and `Matrix` has been added to `raymath` as an extension to current implementation. Despite being only available for C++ because C does not support it, this operators simplify C++ code, when doing math operations. + +Beside those new big features, `raylib 5.5` comes with MANY other improvements: **Normals support on batching system**, **clipboard images reading support**, **CRC32/MD5/SHA1 hash computation**, **gamepad vibration support**, **improved font loading (no GPU required) with BDF fonts support**, **time-based camera movement**, **improved GLTF animations loading** and much much more, including many functions reviews and new functions added! + +Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! + +**After 11 years of development, `raylib 5.5` is the best raylib ever.** + +**Enjoy programming with raylib!** :) From 8af7985ece2b8c99d9280bbf77a438fce61751d1 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 10:46:34 +0100 Subject: [PATCH 026/194] Update CHANGELOG --- CHANGELOG | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9cafc61c0..1f3f333a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,10 +1,10 @@ changelog --------- -Current Release: raylib 5.0 (18 November 2023) +Current Release: raylib 5.5 (18 November 2024) ------------------------------------------------------------------------- -Release: raylib 5.5 (November 2024?) +Release: raylib 5.5 (18 November 2024) ------------------------------------------------------------------------- KEY CHANGES: - New rcore backends: RGFW and SDL3 From 700e2c5e5db90702d7787c3cc231fc41f97d8de6 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Thu, 14 Nov 2024 06:49:35 -0300 Subject: [PATCH 027/194] Fix touch count reset (#4488) --- src/platforms/rcore_web.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index e15d3f5bf..f9d93e5a3 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -1778,11 +1778,14 @@ static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent // Gesture data is sent to gestures system for processing ProcessGestureEvent(gestureEvent); - - // Reset the pointCount for web, if it was the last Touch End event - if (eventType == EMSCRIPTEN_EVENT_TOUCHEND && CORE.Input.Touch.pointCount == 1) CORE.Input.Touch.pointCount = 0; #endif + if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) + { + CORE.Input.Touch.pointCount--; + if (CORE.Input.Touch.pointCount < 0) CORE.Input.Touch.pointCount = 0; + } + return 1; // The event was consumed by the callback handler } From 14d3bbbb8629cc6d1a837b7b22ffbdff1b5f9e1d Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 16:38:27 +0100 Subject: [PATCH 028/194] Update raygui.h --- examples/shapes/raygui.h | 76 +++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 20 deletions(-) diff --git a/examples/shapes/raygui.h b/examples/shapes/raygui.h index 16e01a28f..85c477870 100644 --- a/examples/shapes/raygui.h +++ b/examples/shapes/raygui.h @@ -998,7 +998,7 @@ typedef enum { ICON_LAYERS2 = 225, ICON_MLAYERS = 226, ICON_MAPS = 227, - ICON_228 = 228, + ICON_HOT = 228, ICON_229 = 229, ICON_230 = 230, ICON_231 = 231, @@ -1045,6 +1045,7 @@ typedef enum { #if defined(RAYGUI_IMPLEMENTATION) +#include // required for: isspace() [GuiTextBox()] #include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()] #include // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()] #include // Required for: strlen() [GuiTextBox(), GuiValueBox()], memset(), memcpy() @@ -1316,7 +1317,7 @@ static unsigned int guiIcons[RAYGUI_ICON_MAX_ICONS*RAYGUI_ICON_DATA_ELEMENTS] = 0x07fe0000, 0x1c020402, 0x74021402, 0x54025402, 0x54025402, 0x500857fe, 0x40205ff8, 0x00007fe0, // ICON_LAYERS2 0x0ffe0000, 0x3ffa0802, 0x7fea200a, 0x402a402a, 0x422a422a, 0x422e422a, 0x40384e28, 0x00007fe0, // ICON_MLAYERS 0x0ffe0000, 0x3ffa0802, 0x7fea200a, 0x402a402a, 0x5b2a512a, 0x512e552a, 0x40385128, 0x00007fe0, // ICON_MAPS - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_228 + 0x04200000, 0x1cf00c60, 0x11f019f0, 0x0f3807b8, 0x1e3c0f3c, 0x1c1c1e1c, 0x1e3c1c1c, 0x00000f70, // ICON_HOT 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_229 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_230 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // ICON_231 @@ -1639,9 +1640,9 @@ int GuiGroupBox(Rectangle bounds, const char *text) // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR))); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height - 1, bounds.width, RAYGUI_GROUPBOX_LINE_THICK }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR))); - GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - 1, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR))); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED : (int)LINE_COLOR))); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y + bounds.height - 1, bounds.width, RAYGUI_GROUPBOX_LINE_THICK }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED : (int)LINE_COLOR))); + GuiDrawRectangle(RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - 1, bounds.y, RAYGUI_GROUPBOX_LINE_THICK, bounds.height }, 0, BLANK, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED : (int)LINE_COLOR))); GuiLine(RAYGUI_CLITERAL(Rectangle){ bounds.x, bounds.y - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, bounds.width, (float)GuiGetStyle(DEFAULT, TEXT_SIZE) }, text); //-------------------------------------------------------------------- @@ -1662,7 +1663,7 @@ int GuiLine(Rectangle bounds, const char *text) int result = 0; GuiState state = guiState; - Color color = GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED : LINE_COLOR)); + Color color = GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED : (int)LINE_COLOR)); // Draw control //-------------------------------------------------------------------- @@ -1710,7 +1711,7 @@ int GuiPanel(Rectangle bounds, const char *text) //-------------------------------------------------------------------- if (text != NULL) GuiStatusBar(statusBar, text); // Draw panel header as status bar - GuiDrawRectangle(bounds, RAYGUI_PANEL_BORDER_WIDTH, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BORDER_COLOR_DISABLED: LINE_COLOR)), + GuiDrawRectangle(bounds, RAYGUI_PANEL_BORDER_WIDTH, GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? (int)BORDER_COLOR_DISABLED: (int)LINE_COLOR)), GetColor(GuiGetStyle(DEFAULT, (state == STATE_DISABLED)? BASE_COLOR_DISABLED : BACKGROUND_COLOR))); //-------------------------------------------------------------------- @@ -2603,24 +2604,59 @@ int GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) } } - // Delete codepoint from text, before current cursor position - if ((textLength > 0) && (IsKeyPressed(KEY_BACKSPACE) || (IsKeyDown(KEY_BACKSPACE) && (autoCursorCooldownCounter >= RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN)))) + // Delete related codepoints from text, before current cursor position + if ((textLength > 0) && IsKeyPressed(KEY_BACKSPACE) && (IsKeyDown(KEY_LEFT_CONTROL) || IsKeyDown(KEY_RIGHT_CONTROL))) + { + int i = textBoxCursorIndex - 1; + int accCodepointSize = 0; + + // Move cursor to the end of word if on space already + while ((i > 0) && isspace(text[i])) + { + int prevCodepointSize = 0; + GetCodepointPrevious(text + i, &prevCodepointSize); + i -= prevCodepointSize; + accCodepointSize += prevCodepointSize; + } + + // Move cursor to the start of the word + while ((i > 0) && !isspace(text[i])) + { + int prevCodepointSize = 0; + GetCodepointPrevious(text + i, &prevCodepointSize); + i -= prevCodepointSize; + accCodepointSize += prevCodepointSize; + } + + // Move forward text from cursor position + for (int j = (textBoxCursorIndex - accCodepointSize); j < textLength; j++) text[j] = text[j + accCodepointSize]; + + // Prevent cursor index from decrementing past 0 + if (textBoxCursorIndex > 0) + { + textBoxCursorIndex -= accCodepointSize; + textLength -= accCodepointSize; + } + + // Make sure text last character is EOL + text[textLength] = '\0'; + } + else if ((textLength > 0) && (IsKeyPressed(KEY_BACKSPACE) || (IsKeyDown(KEY_BACKSPACE) && (autoCursorCooldownCounter >= RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN)))) { autoCursorDelayCounter++; if (IsKeyPressed(KEY_BACKSPACE) || (autoCursorDelayCounter%RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY) == 0) // Delay every movement some frames { int prevCodepointSize = 0; - GetCodepointPrevious(text + textBoxCursorIndex, &prevCodepointSize); - - // Move backward text from cursor position - for (int i = (textBoxCursorIndex - prevCodepointSize); i < textLength; i++) text[i] = text[i + prevCodepointSize]; - - // TODO Check: >= cursor+codepointsize and <= length-codepointsize // Prevent cursor index from decrementing past 0 if (textBoxCursorIndex > 0) { + GetCodepointPrevious(text + textBoxCursorIndex, &prevCodepointSize); + + // Move backward text from cursor position + for (int i = (textBoxCursorIndex - prevCodepointSize); i < textLength; i++) text[i] = text[i + prevCodepointSize]; + textBoxCursorIndex -= codepointSize; textLength -= codepointSize; } @@ -2638,7 +2674,7 @@ int GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode) if (IsKeyPressed(KEY_LEFT) || (autoCursorDelayCounter%RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY) == 0) // Delay every movement some frames { int prevCodepointSize = 0; - GetCodepointPrevious(text + textBoxCursorIndex, &prevCodepointSize); + if (textBoxCursorIndex > 0) GetCodepointPrevious(text + textBoxCursorIndex, &prevCodepointSize); if (textBoxCursorIndex >= prevCodepointSize) textBoxCursorIndex -= prevCodepointSize; } @@ -3426,7 +3462,7 @@ int GuiListViewEx(Rectangle bounds, const char **text, int count, int *scrollInd // Draw control //-------------------------------------------------------------------- - GuiDrawRectangle(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), GetColor(GuiGetStyle(LISTVIEW, BORDER + state*3)), GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background + GuiDrawRectangle(bounds, GuiGetStyle(LISTVIEW, BORDER_WIDTH), GetColor(GuiGetStyle(LISTVIEW, BORDER + state*3)), GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR))); // Draw background // Draw visible items for (int i = 0; ((i < visibleItems) && (text != NULL)); i++) @@ -3881,7 +3917,7 @@ int GuiMessageBox(Rectangle bounds, const char *title, const char *message, cons buttonBounds.width = (bounds.width - RAYGUI_MESSAGEBOX_BUTTON_PADDING*(buttonCount + 1))/buttonCount; buttonBounds.height = RAYGUI_MESSAGEBOX_BUTTON_HEIGHT; - int textWidth = GetTextWidth(message) + 2; + //int textWidth = GetTextWidth(message) + 2; Rectangle textBounds = { 0 }; textBounds.x = bounds.x + RAYGUI_MESSAGEBOX_BUTTON_PADDING; @@ -4485,7 +4521,7 @@ static void GuiLoadStyleFromMemory(const unsigned char *fileData, int dataSize) // NOTE: All DEFAULT properties should be defined first in the file GuiSetStyle(0, (int)propertyId, propertyValue); - if (propertyId < RAYGUI_MAX_PROPS_BASE) for (int i = 1; i < RAYGUI_MAX_CONTROLS; i++) GuiSetStyle(i, (int)propertyId, propertyValue); + if (propertyId < RAYGUI_MAX_PROPS_BASE) for (int j = 1; j < RAYGUI_MAX_CONTROLS; j++) GuiSetStyle(j, (int)propertyId, propertyValue); } else GuiSetStyle((int)controlId, (int)propertyId, propertyValue); } @@ -5718,4 +5754,4 @@ static int GetCodepointNext(const char *text, int *codepointSize) } #endif // RAYGUI_STANDALONE -#endif // RAYGUI_IMPLEMENTATION \ No newline at end of file +#endif // RAYGUI_IMPLEMENTATION From 637debb62d5781f47c2e2811b4439995211eff7f Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 16:38:55 +0100 Subject: [PATCH 029/194] Updated Notepad++ autocomplete list for raylib 5.5 --- projects/Notepad++/npes_saved_w64devkit.txt | Bin 8604 -> 10400 bytes .../raylib_npp_parser/raylib_npp.xml | 430 +++++++++++++----- .../raylib_npp_parser/raylib_to_parse.h | 193 ++++---- 3 files changed, 432 insertions(+), 191 deletions(-) diff --git a/projects/Notepad++/npes_saved_w64devkit.txt b/projects/Notepad++/npes_saved_w64devkit.txt index 92375c24aec58c21a1137c86acd9d3b108a1888d..767fa274d9778860a26893655eef4c4b026e8590 100644 GIT binary patch delta 493 zcma)3!7c+)6uo0w9qlO9PRgR~OIVN^-H3>-l?c@k6_Hdssv25DTd9SlU64p@^e!w| z_y8Ko{DF-XD<9!AoHx1?iN(u%_uO;NJ@37T#mCIcl}}AkiZ6ZVfhNt<9GO_N-1b>K zVZ^zsc32y zg1Ron{2WgACgtQLM~%EGznt6AsPkd81~{(oa!ViS7(xDuZ1ZYDgau7f3075Uha?tF z-JUG*+Nj2#i3LN@AoA8CKQWHTzy-3|Zof?Xu3VsMx*2W05ZCT|fM5Iv zpN^oNhNrx78U7`lv%m`2Ef=jLMFrIgCLE$8XG+z~50BeoEM@}zli}P6ufk877An9( pjJ@*QC6-`Z2lHUUv$KSW3sA;NkUXArW@Wvw_;TsuuY}Wt) delta 239 zcmZ1wILCQI8~bD-j=0G$*rg^LuyaiQq`qpi6lWUiVuJ zV8&pd6OFz zohKhqW~tX_&}UF!aAGKB$YjW2NCC1Ffw&mR%VS6filhR0sSFiB(OiZCD8CdgufR|Q zl&J)YXEG!KO+r;!3>5JN%4Y+`)4=AZGVn5R0Y&v0R2VdXa*mVrl}aZsV4em5tK&JF diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml index c869a1a18..3c642ad31 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml @@ -23,16 +23,16 @@ - + - + - + - + @@ -43,7 +43,7 @@ - + @@ -53,38 +53,38 @@ - + - + - + - + - + - + - + - + - + @@ -113,12 +113,12 @@ - + - + @@ -139,7 +139,7 @@ - + @@ -190,6 +190,9 @@ + + + @@ -315,8 +318,8 @@ - - + + @@ -370,20 +373,18 @@ - - - + + + - - + + + - - - - - + + @@ -392,12 +393,6 @@ - - - - - - @@ -412,6 +407,22 @@ + + + + + + + + + + + + + + + + @@ -430,6 +441,9 @@ + + + @@ -484,6 +498,8 @@ + + @@ -575,6 +591,7 @@ + @@ -629,6 +646,11 @@ + + + + + @@ -639,13 +661,18 @@ + + + + + - + @@ -701,6 +728,25 @@ + + + + + + + + + + + + + + + + + + + @@ -710,7 +756,7 @@ - + @@ -752,7 +798,7 @@ - + @@ -837,6 +883,14 @@ + + + + + + + + @@ -939,7 +993,7 @@ - + @@ -984,17 +1038,23 @@ + + + + + + - + - + @@ -1025,7 +1085,7 @@ - + @@ -1071,8 +1131,8 @@ - - + + @@ -1173,8 +1233,8 @@ - - + + @@ -1183,17 +1243,17 @@ - - + + - - - - + + + + @@ -1221,6 +1281,14 @@ + + + + + + + + @@ -1247,14 +1315,14 @@ - + - + @@ -1291,7 +1359,7 @@ - + @@ -1299,7 +1367,7 @@ - + @@ -1307,7 +1375,7 @@ - + @@ -1315,7 +1383,7 @@ - + @@ -1323,7 +1391,7 @@ - + @@ -1443,6 +1511,14 @@ + + + + + + + + @@ -1464,10 +1540,18 @@ + + + + + + + + - + @@ -1480,14 +1564,6 @@ - - - - - - - - @@ -1515,19 +1591,20 @@ - - - - - - - + + + + + + + + @@ -1543,8 +1620,8 @@ - - + + @@ -1661,6 +1738,12 @@ + + + + + + @@ -1725,6 +1808,13 @@ + + + + + + + @@ -1901,6 +1991,15 @@ + + + + + + + + + @@ -1968,6 +2067,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2023,8 +2167,8 @@ - - + + @@ -2033,8 +2177,8 @@ - - + + @@ -2131,6 +2275,12 @@ + + + + + + @@ -2138,7 +2288,7 @@ - + @@ -2195,6 +2345,13 @@ + + + + + + + @@ -2228,7 +2385,7 @@ - + @@ -2252,8 +2409,8 @@ - - + + @@ -2480,7 +2637,7 @@ - + @@ -2534,11 +2691,27 @@ + + + + + + + + + + + + + + + + @@ -2577,7 +2750,7 @@ - + @@ -2734,8 +2907,8 @@ - - + + @@ -2787,6 +2960,24 @@ + + + + + + + + + + + + + + + + + + @@ -2798,7 +2989,7 @@ - + @@ -2822,7 +3013,7 @@ - + @@ -2862,12 +3053,6 @@ - - - - - - @@ -2878,6 +3063,18 @@ + + + + + + + + + + + + @@ -2968,8 +3165,8 @@ - - + + @@ -3001,7 +3198,14 @@ - + + + + + + + + @@ -3121,8 +3325,8 @@ - - + + @@ -3141,8 +3345,8 @@ - - + + @@ -3231,10 +3435,10 @@ - + - - + + @@ -3269,8 +3473,8 @@ - - + + @@ -3352,8 +3556,8 @@ - - + + @@ -3430,7 +3634,7 @@ - + @@ -3443,7 +3647,7 @@ - + diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 0a3c2417d..19bf37135 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -8,36 +8,36 @@ RLAPI void CloseWindow(void); // Close windo RLAPI bool WindowShouldClose(void); // Check if application should close (KEY_ESCAPE pressed or windows close icon clicked) RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen -RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) -RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) -RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) +RLAPI bool IsWindowHidden(void); // Check if window is currently hidden +RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized +RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized +RLAPI bool IsWindowFocused(void); // Check if window is currently focused RLAPI bool IsWindowResized(void); // Check if window has been resized last frame RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled -RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP) +RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags -RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) -RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed (only PLATFORM_DESKTOP) -RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) -RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) -RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) -RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP) -RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) -RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) -RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) +RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed, resizes monitor to match window resolution +RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution +RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable +RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable +RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized +RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit) +RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit) +RLAPI void SetWindowTitle(const char *title); // Set title for window +RLAPI void SetWindowPosition(int x, int y); // Set window position on screen RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowMaxSize(int width, int height); // Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowSize(int width, int height); // Set window dimensions -RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) -RLAPI void SetWindowFocused(void); // Set window focused (only PLATFORM_DESKTOP) +RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] +RLAPI void SetWindowFocused(void); // Set window focused RLAPI void *GetWindowHandle(void); // Get native window handle RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI) RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI) RLAPI int GetMonitorCount(void); // Get number of connected monitors -RLAPI int GetCurrentMonitor(void); // Get current connected monitor +RLAPI int GetCurrentMonitor(void); // Get current monitor where window is placed RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor) RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor) @@ -49,6 +49,7 @@ RLAPI Vector2 GetWindowScaleDPI(void); // Get window RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor RLAPI void SetClipboardText(const char *text); // Set clipboard text content RLAPI const char *GetClipboardText(void); // Get clipboard text content +RLAPI Image GetClipboardImage(void); // Get clipboard image RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling @@ -87,7 +88,7 @@ RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR s // NOTE: Shader functionality is not available on OpenGL 1.1 RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations -RLAPI bool IsShaderReady(Shader shader); // Check if a shader is ready +RLAPI bool IsShaderValid(Shader shader); // Check if a shader is valid (loaded on GPU) RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value @@ -97,13 +98,15 @@ RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture) RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) // Screen-space-related functions -RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position -RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) -RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix -RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position -RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position +#define GetMouseRay GetScreenToWorldRay // Compatibility hack for previous raylib versions +RLAPI Ray GetScreenToWorldRay(Vector2 position, Camera camera); // Get a ray trace from screen position (i.e mouse) +RLAPI Ray GetScreenToWorldRayEx(Vector2 position, Camera camera, int width, int height); // Get a ray trace from screen position (i.e mouse) in a viewport +RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position -RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position +RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position +RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position +RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix) +RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix // Timing-related functions RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) @@ -112,6 +115,9 @@ RLAPI double GetTime(void); // Get elapsed RLAPI int GetFPS(void); // Get current FPS // Custom frame control functions +// NOTE: Those functions are intended for advanced users that want full control over the frame processing +// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents() +// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing) RLAPI void PollInputEvents(void); // Register all input events RLAPI void WaitTime(double seconds); // Wait for some time (halt program execution) @@ -127,6 +133,8 @@ RLAPI void TakeScreenshot(const char *fileName); // Takes a scr RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) +// NOTE: Following functions implemented in module [utils] +//------------------------------------------------------------------ RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level RLAPI void *MemAlloc(unsigned int size); // Internal memory allocator @@ -149,6 +157,7 @@ RLAPI bool ExportDataAsCode(const unsigned char *data, int dataSize, const char RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success +//------------------------------------------------------------------ // File system functions RLAPI bool FileExists(const char *fileName); // Check if file exists @@ -162,10 +171,12 @@ RLAPI const char *GetDirectoryPath(const char *filePath); // Get full pa RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) +RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory +RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths -RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan +RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths @@ -177,10 +188,14 @@ RLAPI unsigned char *CompressData(const unsigned char *data, int dataSize, int * RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree() RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree() RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() +RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code +RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes) +RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) + // Automation events functionality RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS -RLAPI void UnloadAutomationEventList(AutomationEventList *list); // Unload automation events list from file +RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording @@ -194,7 +209,7 @@ RLAPI void PlayAutomationEvent(AutomationEvent event); // Input-related functions: keyboard RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once -RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again (Only PLATFORM_DESKTOP) +RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again RLAPI bool IsKeyDown(int key); // Check if a key is being pressed RLAPI bool IsKeyReleased(int key); // Check if a key has been released once RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed @@ -203,16 +218,17 @@ RLAPI int GetCharPressed(void); // Get char presse RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) // Input-related functions: gamepads -RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available -RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id -RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once -RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed -RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once -RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed -RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed -RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad -RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis -RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) +RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available +RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id +RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once +RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed +RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once +RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed +RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed +RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad +RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis +RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) +RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds) // Input-related functions: mouse RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once @@ -243,7 +259,7 @@ RLAPI int GetTouchPointCount(void); // Get number of t RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected RLAPI int GetGestureDetected(void); // Get latest detected gesture -RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds +RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in seconds RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector RLAPI float GetGestureDragAngle(void); // Get gesture drag angle RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta @@ -262,19 +278,21 @@ RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, f // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing +RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing +RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing // Basic shapes drawing functions -RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel -RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) +RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel using geometry [Can be slow, use with care] +RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel using geometry (Vector version) [Can be slow, use with care] RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (using gl lines) RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line (using triangles/quads) -RLAPI void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines) +RLAPI void DrawLineStrip(const Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines) RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw line segment cubic-bezier in-out interpolation RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline -RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle +RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer); // Draw a gradient-filled circle RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline RLAPI void DrawCircleLinesV(Vector2 center, float radius, Color color); // Draw circle outline (Vector version) @@ -286,27 +304,28 @@ RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color) RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters -RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle -RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle -RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors +RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle +RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle +RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges +RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) -RLAPI void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) -RLAPI void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) +RLAPI void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters // Splines drawing functions -RLAPI void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points -RLAPI void DrawSplineBasis(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points -RLAPI void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points -RLAPI void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] -RLAPI void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] +RLAPI void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points +RLAPI void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points +RLAPI void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points +RLAPI void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] +RLAPI void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] RLAPI void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color); // Draw spline segment: Linear, 2 points RLAPI void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: B-Spline, 4 points RLAPI void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: Catmull-Rom, 4 points @@ -324,12 +343,13 @@ RLAPI Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vect RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle +RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2] RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle -RLAPI bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices -RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] +RLAPI bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices +RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision //------------------------------------------------------------------------------------ @@ -340,12 +360,12 @@ RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // NOTE: These functions do not require GPU access RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data -RLAPI Image LoadImageSvg(const char *fileNameOrString, int width, int height); // Load image from SVG file data or string with specified size RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) +RLAPI Image LoadImageAnimFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int *frames); // Load image sequence from memory buffer RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data RLAPI Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) -RLAPI bool IsImageReady(Image image); // Check if an image is ready +RLAPI bool IsImageValid(Image image); // Check if an image is valid (data and parameters) RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success RLAPI unsigned char *ExportImageToMemory(Image image, const char *fileType, int *fileSize); // Export image to memory buffer @@ -365,6 +385,7 @@ RLAPI Image GenImageText(int width, int height, const char *text); // Image manipulation functions RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece +RLAPI Image ImageFromChannel(Image image, int selectedChannel); // Create an image from a selected channel of another image (GRAYSCALE) RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format @@ -375,10 +396,10 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation -RLAPI void ImageKernelConvolution(Image *image, float* kernel, int kernelSize); // Apply Custom Square image convolution kernel +RLAPI void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize); // Apply custom square convolution kernel to image RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) -RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color +RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically @@ -406,6 +427,7 @@ RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) +RLAPI void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color); // Draw a line defining thickness within an image RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version) RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image @@ -414,6 +436,11 @@ RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int hei RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image +RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image +RLAPI void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image +RLAPI void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image +RLAPI void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center) +RLAPI void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) @@ -424,9 +451,9 @@ RLAPI Texture2D LoadTexture(const char *fileName); RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) -RLAPI bool IsTextureReady(Texture2D texture); // Check if a texture is ready +RLAPI bool IsTextureValid(Texture2D texture); // Check if a texture is valid (loaded in GPU) RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) -RLAPI bool IsRenderTextureReady(RenderTexture2D target); // Check if a render texture is ready +RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU) RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data @@ -445,8 +472,9 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, V RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely // Color/pixel related functions +RLAPI bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f -RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color +RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color (0xRRGGBBAA) RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] @@ -456,6 +484,7 @@ RLAPI Color ColorBrightness(Color color, float factor); // G RLAPI Color ColorContrast(Color color, float contrast); // Get color with contrast correction, contrast values between -1.0f and 1.0f RLAPI Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint +RLAPI Color ColorLerp(Color color1, Color color2, float factor); // Get color lerp interpolation between two colors, factor [0.0f..1.0f] RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer @@ -468,10 +497,10 @@ RLAPI int GetPixelDataSize(int width, int height, int format); // G // Font loading/unloading functions RLAPI Font GetFontDefault(void); // Get the default Font RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set +RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' -RLAPI bool IsFontReady(Font font); // Check if a font is ready +RLAPI bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked) RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type); // Load font data for further use RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM) @@ -512,7 +541,7 @@ RLAPI bool TextIsEqual(const char *text1, const char *text2); RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string -RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) +RLAPI char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings @@ -521,7 +550,11 @@ RLAPI int TextFindIndex(const char *text, const char *find); RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI const char *TextToSnake(const char *text); // Get Snake case notation version of provided string +RLAPI const char *TextToCamel(const char *text); // Get Camel case notation version of provided string + RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) +RLAPI float TextToFloat(const char *text); // Get float value from text (negative values not supported) //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) @@ -532,7 +565,7 @@ RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawTriangleStrip3D(const Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires @@ -557,7 +590,7 @@ RLAPI void DrawGrid(int slices, float spacing); // Model management functions RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -RLAPI bool IsModelReady(Model model); // Check if a model is ready +RLAPI bool IsModelValid(Model model); // Check if a model is valid (loaded in GPU, VAO/VBOs) RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) @@ -566,8 +599,10 @@ RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawModelPoints(Model model, Vector3 position, float scale, Color tint); // Draw a model as points +RLAPI void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) -RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture +RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation @@ -577,9 +612,10 @@ RLAPI void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform RLAPI void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms -RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits RLAPI void GenMeshTangents(Mesh *mesh); // Compute mesh tangents +RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success +RLAPI bool ExportMeshAsCode(Mesh mesh, const char *fileName); // Export mesh as code file (.h) defining multiple arrays of vertex attributes // Mesh generation functions RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh @@ -597,14 +633,15 @@ RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Material loading/unloading functions RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI bool IsMaterialReady(Material material); // Check if a material is ready +RLAPI bool IsMaterialValid(Material material); // Check if a material is valid (shader assigned, map textures loaded in GPU) RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh // Model animations loading/unloading functions RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file -RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose (CPU) +RLAPI void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning) RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match @@ -634,11 +671,11 @@ RLAPI float GetMasterVolume(void); // Get mas // Wave/Sound loading/unloading functions RLAPI Wave LoadWave(const char *fileName); // Load wave data from file RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' -RLAPI bool IsWaveReady(Wave wave); // Checks if wave data is ready +RLAPI bool IsWaveValid(Wave wave); // Checks if wave data is valid (data loaded and parameters) RLAPI Sound LoadSound(const char *fileName); // Load sound from file RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data RLAPI Sound LoadSoundAlias(Sound source); // Create a new sound that shares the same sample data as the source sound, does not own the sound data -RLAPI bool IsSoundReady(Sound sound); // Checks if a sound is ready +RLAPI bool IsSoundValid(Sound sound); // Checks if a sound is valid (data loaded and buffers initialized) RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound @@ -656,7 +693,7 @@ RLAPI void SetSoundVolume(Sound sound, float volume); // Set vol RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center) RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave -RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range +RLAPI void WaveCrop(Wave *wave, int initFrame, int finalFrame); // Crop a wave to defined frames range RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() @@ -664,7 +701,7 @@ RLAPI void UnloadWaveSamples(float *samples); // Unload // Music management functions RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data -RLAPI bool IsMusicReady(Music music); // Checks if a music stream is ready +RLAPI bool IsMusicValid(Music music); // Checks if a music stream is valid (context and buffers initialized) RLAPI void UnloadMusicStream(Music music); // Unload music stream RLAPI void PlayMusicStream(Music music); // Start music playing RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing @@ -681,7 +718,7 @@ RLAPI float GetMusicTimePlayed(Music music); // Get cur // AudioStream management functions RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) -RLAPI bool IsAudioStreamReady(AudioStream stream); // Checks if an audio stream is ready +RLAPI bool IsAudioStreamValid(AudioStream stream); // Checks if an audio stream is valid (buffers initialized) RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill @@ -696,9 +733,9 @@ RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams RLAPI void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data -RLAPI void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream, receives the samples as s +RLAPI void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream, receives the samples as 'float' RLAPI void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Detach audio stream processor from stream -RLAPI void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives the samples as s +RLAPI void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' RLAPI void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline From 928535a828ad10c2fe76c440224246c40bdfba0c Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 16:39:38 +0100 Subject: [PATCH 030/194] Commented code issuing warnings on w64devkit (GCC) Tested with w64devkit/MSVC and all seem to work as expected --- src/platforms/rcore_desktop_glfw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 061fe72ca..baf2967fe 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -66,9 +66,9 @@ #if defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP) // NOTE: Those functions require linking with winmm library - #pragma warning(disable: 4273) - unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); - #pragma warning(default: 4273) + //#pragma warning(disable: 4273) + __declspec(dllimport) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); + //#pragma warning(default: 4273) #endif #endif #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) From 15eb8221e316f5f2a873e3c996b6ffa219975941 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 16:39:58 +0100 Subject: [PATCH 031/194] Updated raylib resource data --- src/raylib.dll.rc | 2 +- src/raylib.dll.rc.data | Bin 11246 -> 11318 bytes src/raylib.rc | 6 +++--- src/raylib.rc.data | Bin 11182 -> 11302 bytes 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/raylib.dll.rc b/src/raylib.dll.rc index b0c2f58f8..2f02b495c 100644 --- a/src/raylib.dll.rc +++ b/src/raylib.dll.rc @@ -9,7 +9,7 @@ BEGIN //BLOCK "080904E4" // English UK BLOCK "040904E4" // English US BEGIN - //VALUE "CompanyName", "raylib technologies" + VALUE "CompanyName", "raylib technologies" VALUE "FileDescription", "raylib dynamic library (www.raylib.com)" VALUE "FileVersion", "5.5.0" VALUE "InternalName", "raylib.dll" diff --git a/src/raylib.dll.rc.data b/src/raylib.dll.rc.data index 3c87c5ca34644547b4c229bfdd185df4174c5954..64d2a1cd5708166afa50efa2611b82ee528088e0 100644 GIT binary patch delta 158 zcmaDCzAb_)rHzpR1Qc{8a!E-vXfrU_0C{_WGzf43u>*sF!$unyCUya4u-N4N^5UE4 zG4ZJ}2{2DyrxC?iFquiN`Rut3>iRG`9QIJhIF8KDns#RN6ocN01xgSF#rGn delta 88 zcmdlM@h+SzrHzpR1a4?g*s_fsHmUOzbC^z+#j4%ZqQG h$Hb?`bb@K}I*lksjmeyv%8V?Nbv4B|_h_zS0st;16I}oR diff --git a/src/raylib.rc b/src/raylib.rc index 5076b4a26..327b2c4de 100644 --- a/src/raylib.rc +++ b/src/raylib.rc @@ -9,12 +9,12 @@ BEGIN //BLOCK "080904E4" // English UK BLOCK "040904E4" // English US BEGIN - //VALUE "CompanyName", "raylib technologies" + VALUE "CompanyName", "raylib technologies" VALUE "FileDescription", "raylib application (www.raylib.com)" VALUE "FileVersion", "5.5.0" - VALUE "InternalName", "raylib app" + VALUE "InternalName", "raylib" VALUE "LegalCopyright", "(c) 2024 Ramon Santamaria (@raysan5)" - //VALUE "OriginalFilename", "raylib_app" + VALUE "OriginalFilename", "raylib" VALUE "ProductName", "raylib app" VALUE "ProductVersion", "5.5.0" END diff --git a/src/raylib.rc.data b/src/raylib.rc.data index 5a9aa4ea0603f67448db688d502efe5173e92e11..ceeafa6822baa8ea52830c5c46ba6883212cc2f6 100644 GIT binary patch delta 189 zcmZ1%zAS<(rHzpR1O#*@a!GL(XfrU_0C{UR>IO5hGcbdtChwOQ-#m|rPmPIzdGb1q zD5eCa$y}OBOg2oD^)$tVJs3n77#W-y@)>d&3K$X@@)#;7&(@L_FJVY!NM^_Y^79#T zfH<8Y6DU$V*->*ovmOKcecplT2=7f3Sz SIsv>5?lwI^%< delta 95 zcmZ1$u`Zk|rHzpR1ZHSYTWNj_Y$p Date: Thu, 14 Nov 2024 16:40:04 +0100 Subject: [PATCH 032/194] Update raylib.ico --- src/raylib.ico | Bin 9752 -> 6177 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/raylib.ico b/src/raylib.ico index 0cedcc55cee7da0e5784256078a93f2901e5d734..8dd7bb7add704d75af0588f095ab2a5486eb8a87 100644 GIT binary patch literal 6177 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 literal 9752 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 AR{#J2 From 5e6cdf3a73cb8e92c98393aadb4a8c2335f65621 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 14 Nov 2024 18:41:37 +0100 Subject: [PATCH 033/194] Update emsdk path on Windows to match new raylib installer package --- examples/Makefile | 2 +- examples/Makefile.Web | 2 +- projects/4coder/Makefile | 2 +- projects/VSCode/Makefile | 2 +- src/Makefile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index a47911b5e..a65a4961e 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -156,7 +156,7 @@ RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM_OS),WINDOWS) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 13125f22d..dd5dc6881 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -119,7 +119,7 @@ RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src ifeq ($(PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM_OS),WINDOWS) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index 8e64702a6..641731291 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -114,7 +114,7 @@ endif ifeq ($(PLATFORM),PLATFORM_WEB) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index 65a6f9544..72b850d9b 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -117,7 +117,7 @@ endif ifeq ($(PLATFORM),PLATFORM_WEB) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH = $(EMSDK_PATH)/upstream/bin PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-nuget_64bit diff --git a/src/Makefile b/src/Makefile index 265f95ca0..7dde52fbd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -183,7 +183,7 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM_OS), WINDOWS) # Emscripten required variables - EMSDK_PATH ?= C:/emsdk + EMSDK_PATH ?= C:/raylib/emsdk EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten CLANG_PATH := $(EMSDK_PATH)/upstream/bin PYTHON_PATH := $(EMSDK_PATH)/python/3.9.2-nuget_64bit From a2f6ae6796bc4e341ec16c014c1c106a95a6270d Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Thu, 14 Nov 2024 23:25:09 -0800 Subject: [PATCH 034/194] Fix warnings in examples (#4492) Move shapes/shapes_rectangle_advanced to the correct folder in MSVC project Add core_input_virtual_controls.vcxproj back into sln file --- examples/core/core_input_gamepad.c | 10 +- examples/core/core_input_virtual_controls.c | 28 +- examples/shapes/shapes_rectangle_advanced.c | 16 +- .../core_input_virtual_controls.vcxproj | 390 ++++++++++++++++++ .../shapes_rectangle_advanced.vcxproj | 4 +- projects/VS2022/raylib.sln | 55 ++- 6 files changed, 455 insertions(+), 48 deletions(-) create mode 100644 projects/VS2022/examples/core_input_virtual_controls.vcxproj diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index 538e1c389..f9310fdc3 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -196,7 +196,7 @@ int main(void) { // Draw background: generic - DrawRectangleRounded((Rectangle){ 175, 110, 460, 220}, 0.3f, 0.0f, DARKGRAY); + DrawRectangleRounded((Rectangle){ 175, 110, 460, 220}, 0.3f, 16, DARKGRAY); // Draw buttons: basic DrawCircle(365, 170, 12, RAYWHITE); @@ -225,10 +225,10 @@ int main(void) if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_FACE_RIGHT)) DrawRectangle(217 + 54, 176, 30, 25, RED); // Draw buttons: left-right back - DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 0.0f, DARKGRAY); - DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 0.0f, DARKGRAY); - if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 0.0f, RED); - if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 0.0f, RED); + DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 16, DARKGRAY); + DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 16, DARKGRAY); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_LEFT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 215, 98, 100, 10}, 0.5f, 16, RED); + if (IsGamepadButtonDown(gamepad, GAMEPAD_BUTTON_RIGHT_TRIGGER_1)) DrawRectangleRounded((Rectangle){ 495, 98, 100, 10}, 0.5f, 16, RED); // Draw axis: left joystick Color leftGamepadColor = BLACK; diff --git a/examples/core/core_input_virtual_controls.c b/examples/core/core_input_virtual_controls.c index 2d2b91e67..bbbad208f 100644 --- a/examples/core/core_input_virtual_controls.c +++ b/examples/core/core_input_virtual_controls.c @@ -29,19 +29,19 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [core] example - input virtual controls"); - const int dpadX = 90; - const int dpadY = 300; - const int dpadRad = 25;//radius of each pad + const float dpadX = 90; + const float dpadY = 300; + const float dpadRad = 25.0f;//radius of each pad Color dpadColor = BLUE; int dpadKeydown = -1;//-1 if not down, else 0,1,2,3 const float dpadCollider[4][2]= // collider array with x,y position { - {dpadX,dpadY-dpadRad*1.5},//up - {dpadX-dpadRad*1.5,dpadY},//left - {dpadX+dpadRad*1.5,dpadY},//right - {dpadX,dpadY+dpadRad*1.5}//down + {dpadX,dpadY-dpadRad*1.5f},//up + {dpadX-dpadRad*1.5f,dpadY},//left + {dpadX+dpadRad*1.5f,dpadY},//right + {dpadX,dpadY+dpadRad*1.5f}//down }; const char dpadLabel[4]="XYBA";//label of Dpad @@ -57,8 +57,8 @@ int main(void) // Update //-------------------------------------------------------------------------- dpadKeydown = -1; //reset - float inputX=0; - float inputY=0; + int inputX = 0; + int inputY = 0; if(GetTouchPointCount()>0) {//use touch pos inputX = GetTouchX(); @@ -97,18 +97,18 @@ int main(void) for(int i=0;i<4;i++) { //draw all pad - DrawCircle(dpadCollider[i][0],dpadCollider[i][1],dpadRad,dpadColor); + DrawCircleV((Vector2) { dpadCollider[i][0], dpadCollider[i][1] }, dpadRad, dpadColor); if(i!=dpadKeydown) { //draw label DrawText(TextSubtext(dpadLabel,i,1), - dpadCollider[i][0]-7, - dpadCollider[i][1]-8,20,BLACK); + (int)dpadCollider[i][0]-7, + (int)dpadCollider[i][1]-8,20,BLACK); } } - DrawRectangle(playerX-4,playerY-4,75,28,RED); - DrawText("Player",playerX,playerY,20,WHITE); + DrawRectangleRec((Rectangle) { playerX - 4, playerY - 4, 75, 28 }, RED); + DrawText("Player", (int)playerX, (int)playerY, 20, WHITE); EndDrawing(); //-------------------------------------------------------------------------- } diff --git a/examples/shapes/shapes_rectangle_advanced.c b/examples/shapes/shapes_rectangle_advanced.c index a103e82a1..e885a10ee 100644 --- a/examples/shapes/shapes_rectangle_advanced.c +++ b/examples/shapes/shapes_rectangle_advanced.c @@ -290,10 +290,10 @@ int main(int argc, char *argv[]) { // Update rectangle bounds //---------------------------------------------------------------------------------- - double width = GetScreenWidth()/2.0, height = GetScreenHeight()/6.0; + float width = GetScreenWidth()/2.0f, height = GetScreenHeight()/6.0f; Rectangle rec = { - GetScreenWidth() / 2.0 - width/2, - GetScreenHeight() / 2.0 - (5)*(height/2), + GetScreenWidth() / 2.0f - width/2, + GetScreenHeight() / 2.0f - (5)*(height/2), width, height }; //-------------------------------------------------------------------------------------- @@ -304,19 +304,19 @@ int main(int argc, char *argv[]) ClearBackground(RAYWHITE); // Draw All Rectangles with different roundess for each side and different gradients - DrawRectangleRoundedGradientH(rec, 0.8, 0.8, 36, BLUE, RED); + DrawRectangleRoundedGradientH(rec, 0.8f, 0.8f, 36, BLUE, RED); rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 0.5, 1.0, 36, RED, PINK); + DrawRectangleRoundedGradientH(rec, 0.5f, 1.0f, 36, RED, PINK); rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 1.0, 0.5, 36, RED, BLUE); + DrawRectangleRoundedGradientH(rec, 1.0f, 0.5f, 36, RED, BLUE); rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 0.0, 1.0, 36, BLUE, BLACK); + DrawRectangleRoundedGradientH(rec, 0.0f, 1.0f, 36, BLUE, BLACK); rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 1.0, 0.0, 36, BLUE, PINK); + DrawRectangleRoundedGradientH(rec, 1.0f, 0.0f, 36, BLUE, PINK); EndDrawing(); //-------------------------------------------------------------------------------------- } diff --git a/projects/VS2022/examples/core_input_virtual_controls.vcxproj b/projects/VS2022/examples/core_input_virtual_controls.vcxproj new file mode 100644 index 000000000..c5a043b74 --- /dev/null +++ b/projects/VS2022/examples/core_input_virtual_controls.vcxproj @@ -0,0 +1,390 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {0981CA28-E4A5-4DF1-987F-A41D09131EFC} + Win32Proj + core_input_virtual_controls + 10.0 + core_input_virtual_controls + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\core + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2022/examples/shapes_rectangle_advanced.vcxproj b/projects/VS2022/examples/shapes_rectangle_advanced.vcxproj index 9e5a04710..7ec07e4b3 100644 --- a/projects/VS2022/examples/shapes_rectangle_advanced.vcxproj +++ b/projects/VS2022/examples/shapes_rectangle_advanced.vcxproj @@ -35,7 +35,7 @@ - {703BE7BA-5B99-4F70-806D-3A259F6A991E} + {FAFEE2F9-24B0-4AF1-B512-433E9590033F} Win32Proj shapes_rectangle_advanced 10.0 @@ -387,4 +387,4 @@ - + \ No newline at end of file diff --git a/projects/VS2022/raylib.sln b/projects/VS2022/raylib.sln index e2f512d81..4d03db808 100644 --- a/projects/VS2022/raylib.sln +++ b/projects/VS2022/raylib.sln @@ -297,13 +297,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_splines_drawing", "e EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_top_down_lights", "examples\shapes_top_down_lights.vcxproj", "{703BE7BA-5B99-4F70-806D-3A259F6A991E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_rectangle_advanced", "examples\shapes_rectangle_advanced.vcxproj", "{703BE7BA-5B99-4F70-806D-3A259F6A991E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_rectangle_advanced", "examples\shapes_rectangle_advanced.vcxproj", "{FAFEE2F9-24B0-4AF1-B512-433E9590033F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_gpu_skinning", "examples\models_gpu_skinning.vcxproj", "{8245DAD9-D402-4D5C-8F45-32229CD3B263}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_shadowmap", "examples\shaders_shadowmap.vcxproj", "{41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_virtual_controls", "examples\core_input_virtual_controls.vcxproj", "{92B64AE7-D773-6F03-89F1-CE59BBF4F053}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_virtual_controls", "examples\core_input_virtual_controls.vcxproj", "{0981CA28-E4A5-4DF1-987F-A41D09131EFC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -2521,6 +2521,22 @@ Global {703BE7BA-5B99-4F70-806D-3A259F6A991E}.Release|x64.Build.0 = Release|x64 {703BE7BA-5B99-4F70-806D-3A259F6A991E}.Release|x86.ActiveCfg = Release|Win32 {703BE7BA-5B99-4F70-806D-3A259F6A991E}.Release|x86.Build.0 = Release|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug|x64.ActiveCfg = Debug|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug|x64.Build.0 = Debug|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug|x86.ActiveCfg = Debug|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Debug|x86.Build.0 = Debug|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release|x64.ActiveCfg = Release|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release|x64.Build.0 = Release|x64 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release|x86.ActiveCfg = Release|Win32 + {FAFEE2F9-24B0-4AF1-B512-433E9590033F}.Release|x86.Build.0 = Release|Win32 {8245DAD9-D402-4D5C-8F45-32229CD3B263}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 {8245DAD9-D402-4D5C-8F45-32229CD3B263}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 {8245DAD9-D402-4D5C-8F45-32229CD3B263}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 @@ -2553,22 +2569,22 @@ Global {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x64.Build.0 = Release|x64 {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x86.ActiveCfg = Release|Win32 {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629}.Release|x86.Build.0 = Release|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug|x64.ActiveCfg = Debug|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug|x64.Build.0 = Debug|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug|x86.ActiveCfg = Debug|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Debug|x86.Build.0 = Debug|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release.DLL|x64.Build.0 = Release.DLL|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release.DLL|x86.Build.0 = Release.DLL|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release|x64.ActiveCfg = Release|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release|x64.Build.0 = Release|x64 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release|x86.ActiveCfg = Release|Win32 - {92B64AE7-D773-6F03-89F1-CE59BBF4F053}.Release|x86.Build.0 = Release|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.ActiveCfg = Debug|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug|x64.Build.0 = Debug|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.ActiveCfg = Debug|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.Build.0 = Debug|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.ActiveCfg = Release|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.Build.0 = Release|x64 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 + {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2719,9 +2735,10 @@ Global {EFA150D4-F93B-4D7D-A69C-9E8B4663BECD} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} {DF25E545-00FF-4E64-844C-7DF98991F901} = {278D8859-20B1-428F-8448-064F46E1F021} {703BE7BA-5B99-4F70-806D-3A259F6A991E} = {278D8859-20B1-428F-8448-064F46E1F021} + {FAFEE2F9-24B0-4AF1-B512-433E9590033F} = {278D8859-20B1-428F-8448-064F46E1F021} {8245DAD9-D402-4D5C-8F45-32229CD3B263} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} - {92B64AE7-D773-6F03-89F1-CE59BBF4F053} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {0981CA28-E4A5-4DF1-987F-A41D09131EFC} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} From 4f091f44a8d91d51019aa65c12da570435de450b Mon Sep 17 00:00:00 2001 From: Oussama Teyib Date: Fri, 15 Nov 2024 07:26:22 +0000 Subject: [PATCH 035/194] Fix typo in BINDINGS.md (#4493) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 576d9b463..fd9bddcb6 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -87,7 +87,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers ### Utility Wrapers -These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm. +These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's paradigm. | Name | raylib Version | Language | License | | ---------------------------------------------------- | :------------: | :------------------------------------------: | :-----: | | [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | From 7c5d74e98e22e6095a21720f0f7b1e965a6d3ea3 Mon Sep 17 00:00:00 2001 From: Eike Decker Date: Fri, 15 Nov 2024 16:40:14 +0100 Subject: [PATCH 036/194] Fixing an OBJ loader bug that fragmented the loaded meshes (#4494) The nextShapeEnd integer is a pointer in the OBJ data structures. The faceVertIndex is a vertex index counter for the mesh we are about to create. Both integers are not compatible, which causes the code to finish the meshes too early, thus writing the OBJ data incompletely into the target meshes. It wasn't noticed because for the last mesh, it process all remaining data, causing the last mesh to contain all remaining triangles. This would have been noticed if the OBJ meshes used different textures for each mesh. --- src/rmodels.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 04f7210f2..b5830b2c0 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4244,7 +4244,7 @@ static Model LoadOBJ(const char *fileName) // walk all the faces for (unsigned int faceId = 0; faceId < objAttributes.num_faces; faceId++) { - if (faceVertIndex >= nextShapeEnd) + if (faceId >= nextShapeEnd) { // try to find the last vert in the next shape nextShape++; @@ -4295,7 +4295,7 @@ static Model LoadOBJ(const char *fileName) for (unsigned int faceId = 0; faceId < objAttributes.num_faces; faceId++) { bool newMesh = false; // do we need a new mesh? - if (faceVertIndex >= nextShapeEnd) + if (faceId >= nextShapeEnd) { // try to find the last vert in the next shape nextShape++; @@ -4357,7 +4357,7 @@ static Model LoadOBJ(const char *fileName) for (unsigned int faceId = 0; faceId < objAttributes.num_faces; faceId++) { bool newMesh = false; // do we need a new mesh? - if (faceVertIndex >= nextShapeEnd) + if (faceId >= nextShapeEnd) { // try to find the last vert in the next shape nextShape++; From 816b60505458d922f6279b474d3ee4647c3460c8 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 13:18:04 +0100 Subject: [PATCH 037/194] Update CHANGELOG --- CHANGELOG | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1f3f333a3..61e12a3d4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,11 +7,11 @@ Current Release: raylib 5.5 (18 November 2024) Release: raylib 5.5 (18 November 2024) ------------------------------------------------------------------------- KEY CHANGES: + - New tool: raylib project creator - New rcore backends: RGFW and SDL3 - New platforms supported: Dreamcast, N64, PSP, PSVita, PS4 - Added GPU Skinning support (all platforms and GL versions) - Added raymath C++ operators - - New tool: raylib project creator Detailed changes: @@ -241,6 +241,7 @@ WIP: Last update with commit from 02-Nov-2024 [rmodels] REVIEWED: Multiple updates to gltf loading, improved macro (#4373) by @Harald Scheirich [rmodels] REVIEWED: `LoadOBJ()`, correctly split obj meshes by material (#4285) by @Jeffery Myers [rmodels] REVIEWED: `LoadOBJ()`, add warning when loading an OBJ with multiple materials (#4271) by @Jeffery Myers +[rmodels] REVIEWED: `LoadOBJ()`, fix bug that fragmented the loaded meshes (#4494) by @Eike Decker [rmodels] REVIEWED: `LoadIQM()`, set model.meshMaterial[] (#4092) by @SuperUserNameMan [rmodels] REVIEWED: `LoadIQM()`, attempt to load texture from IQM at loadtime (#4029) by @Jett [rmodels] REVIEWED: `LoadM3D(), fix vertex colors for m3d files (#3859) by @Jeffery Myers @@ -387,8 +388,9 @@ WIP: Last update with commit from 02-Nov-2024 [build] REVIEWED: CMake, bump version required to avoid deprecated #3639 by @Ray [build] REVIEWED: CMake, fix examples linking -DPLATFORM=SDL (#3825) by @Peter0x44 [build] REVIEWED: CMake, don't build for wayland by default (#4432) by @Peter0x44 -[build] REVIEWED: VS2022 project by @Ray +[build] REVIEWED: VS2022, misc improvements by @Ray [build] REVIEWED: VS2022, fix build warnings (#4095) by @Jeffery Myers +[build] REVIEWED: VS2022, added new examples (#4492) by @Jeffery Myers [build] REVIEWED: Fix fix-build-paths (#3849) by @Caleb Barger [build] REVIEWED: Fix build paths (#3835) by @Steve Biedermann [build] REVIEWED: Fix VSCode sample project for macOS (#3666) by @Tim Romero From d567b35d9a50dbd26e94608795f6bf28dec9bc29 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 17:57:00 +0100 Subject: [PATCH 038/194] Update HISTORY.md --- HISTORY.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index f7dc14be1..feefbc13b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -480,28 +480,38 @@ One year after raylib 5.0 release, arribes raylib 5.5, the next big revision of Some numbers for this release: - **+270** closed issues (for a TOTAL of **+1810**!) - - **+800** commits since previous RELEASE (for a TOTAL of **+7750**!) + - **+800** commits since previous RELEASE (for a TOTAL of **+7770**!) - **+30** functions ADDED to raylib API (for a TOTAL of **580**!) - **+110** functions REVIEWED with fixes and improvements - **+140** new contributors (for a TOTAL of **+640**!) Highlights for `raylib 5.5`: - - **`NEW` raylib project creator tool**: A brand new support tool developed to help raylib users to setup new projects in a professional way. This tools generates a complete project structure with multiple build systems and ready for GitHub with CI/CD actions pre-configured. And only providing some project C files and basic properties! + - **`NEW` raylib project creator tool**: A brand new tool developed to help raylib users to **setup new projects in a professional way**. `raylib project creator` generates a complete project structure with **multiple build systems ready-to-use** and **GitHub CI/CD actions pre-configured**. It only requires providing some C files and basic project parameters! The tools is [free and open-source](https://raysan5.itch.io/raylib-project-creator), and [it can be used online](https://raysan5.itch.io/raylib-project-creator)!. - - **`NEW` Platform backend supported: RGFW**: Thanks to the `rcore` platform-split implemented in `raylib 5.0`, adding new platforms backends has been greatly simplified, new backends can be added using provided template, self-contained in a single C module, completely portable. A new platform backend has been added: `RGFW`. `RGFW` is a **new** single-file header-only (`RGFW.h`) portable library intended for platform-functionality management (windowing and inputs); in this case for desktop platforms (Windows, Linux, macOS) and also for Web platform. It adds to the already existing platform backends supporting those same platforms: `GLFW` and `SDL`. + - **`NEW` Platform backend supported: RGFW**: Thanks to the `rcore` platform-split implemented in `raylib 5.0`, **adding new platforms backends has been greatly simplified**, new backends can be added using provided template, self-contained in a single C module, completely portable. A new platform backend has been added: [`RGFW`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_rgfw.c). `RGFW` is a **new single-file header-only portable library** ([`RGFW.h`](https://github.com/ColleagueRiley/RGFW)) intended for platform-functionality management (windowing and inputs); in this case for **desktop platforms** (Windows, Linux, macOS) but also for **Web platform**. It adds a new alternative to the already existing `GLFW` and `SDL` platform backends. - - **`NEW` Platform backend version supported: SDL3**: Previous `raylib 5.0` added experimental support for `SDL2` library, in this new `raylib` release some issues with SDL2 has been reviewed and it has been added support for the latest `SDL3` implementation. Now users can select at compile time the desired SDL version to use, increasing the number of potential platforms supported in the future! + - **`NEW` Platform backend version supported: SDL3**: Previous `raylib 5.0` added support for `SDL2` library, and `raylib 5.5` not only improves SDL2 functionality, with several issues reviewed, but also adds support for the recently released big SDL update in years: [`SDL3`](https://wiki.libsdl.org/SDL3/FrontPage). Now users can **select at compile time the desired SDL version to use**, increasing the number of potential platforms supported in the future! - - **`NEW` Retro-console platforms supported: Dreamcast, N64, PSP, PSVita, PS4**: Thanks to the platform-split on `raylib 5.0`, supporting new platform backends is easier than ever! Along the `OpenGL 1.1` graphics option supported by raylib, it opened the door to multiple retro-consoles backend implementations! It's amazing to see raylib running on +20 year old consoles like Dreamcast or PSP, considering the hardware constraints of those platforms and proves raylib versability! Those additional platforms can be found in separate repositories (links) and have been created by Antonio Jose Ramos Marquez (@psxdev). + - **`NEW` Retro-console platforms supported: Dreamcast, N64, PSP, PSVita, PS4**: Thanks to the platform-split on `raylib 5.0`, **supporting new platform backends is easier than ever!** Along the raylib `rlgl` module support for the `OpenGL 1.1` graphics API, it opened the door to [**multiple homebrew retro-consoles backend implementations!**](https://github.com/raylib4Consoles) It's amazing to see raylib running on +20 year old consoles like [Dreamcast](https://github.com/raylib4Consoles/raylib4Dreamcast), [PSP](https://github.com/raylib4Consoles/raylib4Psp) or [PSVita](https://github.com/psp2dev/raylib4Vita), considering the hardware constraints of those platforms and proves **raylib outstanding versability!** Those additional platforms can be found in separate repositories and have been created by the amazing programmer Antonio Jose Ramos Marquez (@psxdev). - - **`NEW` GPU Skinning support**: After lots of requests for this feature, it has been finally added to raylib thanks to Daniel Holden (@orangeduck) contribution. Adding GPU skinning was a tricky feature, considering it had to be available for all raylib supported platforms, including limited ones like Raspberry Pi with OpenGL ES 2.0, where some advance OpenGL features are not available (UBO, SSBO, Transform Feedback) but a multi-platform solution was found and this new advance feature was added. An [usage example] was also added and also in the process, current models animation system was greatly improved in performance, simplifiying the required math. + - **`NEW` GPU Skinning support**: After lots of requests for this feature, it has been finally added to raylib thanks to the contributor Daniel Holden (@orangeduck), probably the developer that has further pushed models animations with raylib, developing two amazing tools to visualize and test animations: [GenoView](https://github.com/orangeduck/GenoView) and [BVHView](https://github.com/orangeduck/BVHView). Adding GPU skinning was a tricky feature, considering it had to be **available for all raylib supported platforms**, including limited ones like Raspberry Pi with OpenGL ES 2.0, where some advance OpenGL features are not available (UBO, SSBO, Transform Feedback) but a multi-platform solution was found to make it possible. A new example, [`models_gpu_skinning`](https://github.com/raysan5/raylib/blob/master/examples/models/models_gpu_skinning.c) has been added to illustrate this new functionality. As an extra, previous existing CPU animation system has been greatly improved, multiplying performance by a factor (simplifiying required maths). - - **`NEW` [`raymath`](https://github.com/raysan5/raylib/blob/master/src/raymath.h) C++ operators**: After several requested for this feature, C++ math operators for `Vector2`, `Vector3`, `Vector4`, `Quaternion` and `Matrix` has been added to `raymath` as an extension to current implementation. Despite being only available for C++ because C does not support it, this operators simplify C++ code, when doing math operations. + - **`NEW` [`raymath`](https://github.com/raysan5/raylib/blob/master/src/raymath.h) C++ operators**: After several requested for this feature, C++ math operators for `Vector2`, `Vector3`, `Vector4`, `Quaternion` and `Matrix` has been added to `raymath` as an extension to current implementation. Despite being only available for C++ because C does not support it, these operators **simplify C++ code when doing math operations**. -Beside those new big features, `raylib 5.5` comes with MANY other improvements: **Normals support on batching system**, **clipboard images reading support**, **CRC32/MD5/SHA1 hash computation**, **gamepad vibration support**, **improved font loading (no GPU required) with BDF fonts support**, **time-based camera movement**, **improved GLTF animations loading** and much much more, including many functions reviews and new functions added! +Beside those new big features, `raylib 5.5` comes with MANY other improvements: + +- Normals support on batching system +- Clipboard images reading support +- CRC32/MD5/SHA1 hash computation +- Gamepad vibration support +- Improved font loading (no GPU required) with BDF fonts support +- Time-based camera movement +- Improved GLTF animations loading + +...and [much much more](https://github.com/raysan5/raylib/blob/master/CHANGELOG), including **many functions reviews and new functions added!** -Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! +Make sure to check raylib [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) for a detailed list of changes! **After 11 years of development, `raylib 5.5` is the best raylib ever.** From dd688d81a6a08bd205d57111a17f533705a3c4d1 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 18:16:00 +0100 Subject: [PATCH 039/194] =?UTF-8?q?Thanks=20@everyone=20for=20everything?= =?UTF-8?q?=20=F0=9F=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index feefbc13b..2c93e9c54 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -513,6 +513,10 @@ Beside those new big features, `raylib 5.5` comes with MANY other improvements: Make sure to check raylib [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) for a detailed list of changes! +To end with, I want to **thank all the contributors (+640!**) that along the years have **greatly improved raylib** and pushed it further and better day after day. Thanks to all of them, raylib is the amazing library it is today. + +Last but not least, I want to thank **raylib sponsors and all the raylib community** for their support and continuous engagement with the library, creating and sharing amazing raylib projects on a daily basis. **Thanks for making raylib a great platform to enjoy games/tools/graphic programming!** + **After 11 years of development, `raylib 5.5` is the best raylib ever.** **Enjoy programming with raylib!** :) From da7ab040526cae4ed759f7774a59470de7661e6e Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 18:44:48 +0100 Subject: [PATCH 040/194] Update HISTORY.md --- HISTORY.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 2c93e9c54..af158bada 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -475,7 +475,7 @@ Undoubtedly, this is the **biggest raylib update in 10 years**. Many new feature notes on raylib 5.5 ------------------- -One year after raylib 5.0 release, arribes raylib 5.5, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. +One year after raylib 5.0 release, arribes `raylib 5.5`, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. Some numbers for this release: @@ -487,6 +487,8 @@ Some numbers for this release: Highlights for `raylib 5.5`: + - **`NEW` raylib pre-configured Windows package**: The new raylib **postable and self-contained Windows package** for `raylib 5.5`, intended for nobel devs that start in programming world, comes with one big addition: support for **C code building for Web platform with one-single-mouse-click!** For the last 10 years, the pre-configured raylib Windows package allowed to edit simple C projects on Notepad++ and easely compile Windows executables with an automatic script; this new release adds the possibility to compile the same C projects for Web platform with a simple mouse click. This new addition **greatly simplifies C to WebAssembly project building for new users**. The `raylib Windows Installer` package can be downloaded for free from [raylib on itch.io](https://raysan5.itch.io/raylib). + - **`NEW` raylib project creator tool**: A brand new tool developed to help raylib users to **setup new projects in a professional way**. `raylib project creator` generates a complete project structure with **multiple build systems ready-to-use** and **GitHub CI/CD actions pre-configured**. It only requires providing some C files and basic project parameters! The tools is [free and open-source](https://raysan5.itch.io/raylib-project-creator), and [it can be used online](https://raysan5.itch.io/raylib-project-creator)!. - **`NEW` Platform backend supported: RGFW**: Thanks to the `rcore` platform-split implemented in `raylib 5.0`, **adding new platforms backends has been greatly simplified**, new backends can be added using provided template, self-contained in a single C module, completely portable. A new platform backend has been added: [`RGFW`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_rgfw.c). `RGFW` is a **new single-file header-only portable library** ([`RGFW.h`](https://github.com/ColleagueRiley/RGFW)) intended for platform-functionality management (windowing and inputs); in this case for **desktop platforms** (Windows, Linux, macOS) but also for **Web platform**. It adds a new alternative to the already existing `GLFW` and `SDL` platform backends. From 162efc1ec7d52cc1297258e50c53aea836a35cfb Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 18:45:12 +0100 Subject: [PATCH 041/194] Update core_basic_window.c --- examples/core/core_basic_window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/core/core_basic_window.c b/examples/core/core_basic_window.c index 81bea16b8..3cf2c7c5d 100644 --- a/examples/core/core_basic_window.c +++ b/examples/core/core_basic_window.c @@ -4,9 +4,12 @@ * * Welcome to raylib! * -* To test examples, just press F6 and execute raylib_compile_execute script +* To test examples, just press F6 and execute 'raylib_compile_execute' script * Note that compiled executable is placed in the same folder as .c file * +* To test the examples on Web, press F6 and execute 'raylib_compile_execute_web' script +* Web version of the program is generated 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 * From 938b805bfb575613d49e3ba57e2f3c9829614e45 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 18:45:16 +0100 Subject: [PATCH 042/194] Update raylib.h --- src/raylib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raylib.h b/src/raylib.h index 02b3ee731..a26b8ce6b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1011,7 +1011,7 @@ RLAPI Vector2 GetWindowScaleDPI(void); // Get window RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor RLAPI void SetClipboardText(const char *text); // Set clipboard text content RLAPI const char *GetClipboardText(void); // Get clipboard text content -RLAPI Image GetClipboardImage(void); // Get clipboard image +RLAPI Image GetClipboardImage(void); // Get clipboard image content RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling From 88c922f4335b9b8fb2c7d19a4ee22df29c6df963 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 16 Nov 2024 17:45:33 +0000 Subject: [PATCH 043/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 2 +- parser/output/raylib_api.lua | 2 +- parser/output/raylib_api.txt | 2 +- parser/output/raylib_api.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index aa86d3f71..0921ed40e 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -3522,7 +3522,7 @@ }, { "name": "GetClipboardImage", - "description": "Get clipboard image", + "description": "Get clipboard image content", "returnType": "Image" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index e5a20049e..a8e242ac7 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -3399,7 +3399,7 @@ return { }, { name = "GetClipboardImage", - description = "Get clipboard image", + description = "Get clipboard image content", returnType = "Image" }, { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index e38495559..a9cfa005c 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -1230,7 +1230,7 @@ Function 046: GetClipboardText() (0 input parameters) Function 047: GetClipboardImage() (0 input parameters) Name: GetClipboardImage Return type: Image - Description: Get clipboard image + Description: Get clipboard image content No input parameters Function 048: EnableEventWaiting() (0 input parameters) Name: EnableEventWaiting diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index b91874cc0..dcc079f10 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -795,7 +795,7 @@ - + From 68503ed96ff66702ba8b7ca1de917f2fa1a77cee Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 16 Nov 2024 19:00:28 +0100 Subject: [PATCH 044/194] Update webassembly.yml --- .github/workflows/webassembly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml index f676877fd..c3a392215 100644 --- a/.github/workflows/webassembly.yml +++ b/.github/workflows/webassembly.yml @@ -29,7 +29,7 @@ jobs: - name: Setup emsdk uses: mymindstorm/setup-emsdk@v14 with: - version: 3.1.64 + version: 3.1.71 actions-cache-folder: 'emsdk-cache' - name: Setup Release Version From c1ab645ca298a2801097931d1079b10ff7eb9df8 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 18 Nov 2024 13:21:10 +0100 Subject: [PATCH 045/194] Update HISTORY.md --- HISTORY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index af158bada..3cecb2a67 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -487,7 +487,7 @@ Some numbers for this release: Highlights for `raylib 5.5`: - - **`NEW` raylib pre-configured Windows package**: The new raylib **postable and self-contained Windows package** for `raylib 5.5`, intended for nobel devs that start in programming world, comes with one big addition: support for **C code building for Web platform with one-single-mouse-click!** For the last 10 years, the pre-configured raylib Windows package allowed to edit simple C projects on Notepad++ and easely compile Windows executables with an automatic script; this new release adds the possibility to compile the same C projects for Web platform with a simple mouse click. This new addition **greatly simplifies C to WebAssembly project building for new users**. The `raylib Windows Installer` package can be downloaded for free from [raylib on itch.io](https://raysan5.itch.io/raylib). + - **`NEW` raylib pre-configured Windows package**: The new raylib **portable and self-contained Windows package** for `raylib 5.5`, intended for nobel devs that start in programming world, comes with one big addition: support for **C code building for Web platform with one-single-mouse-click!** For the last 10 years, the pre-configured raylib Windows package allowed to edit simple C projects on Notepad++ and easely compile Windows executables with an automatic script; this new release adds the possibility to compile the same C projects for Web platform with a simple mouse click. This new addition **greatly simplifies C to WebAssembly project building for new users**. The `raylib Windows Installer` package can be downloaded for free from [raylib on itch.io](https://raysan5.itch.io/raylib). - **`NEW` raylib project creator tool**: A brand new tool developed to help raylib users to **setup new projects in a professional way**. `raylib project creator` generates a complete project structure with **multiple build systems ready-to-use** and **GitHub CI/CD actions pre-configured**. It only requires providing some C files and basic project parameters! The tools is [free and open-source](https://raysan5.itch.io/raylib-project-creator), and [it can be used online](https://raysan5.itch.io/raylib-project-creator)!. From 71e0b8b5813fb1d2916c81c8e6db42d12d9274ab Mon Sep 17 00:00:00 2001 From: Gunko Vadim Date: Mon, 18 Nov 2024 18:38:28 +0500 Subject: [PATCH 046/194] Update BINDINGS.md (#4504) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index fd9bddcb6..8f68c66d3 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -51,7 +51,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT | | [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **5.0** | [OCaml](https://ocaml.org) | MIT | | [TurboRaylib](https://github.com/turborium/TurboRaylib) | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT | -| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib | +| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.5** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib | | [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib | | [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib | | [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | 4.2 | [Python](https://www.python.org) | EPL-2.0 | From 8375581f870ec1c4bcf17fdf842c608463a46b68 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 00:19:39 +0100 Subject: [PATCH 047/194] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 29173d665..29f0f61ff 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html) [![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/5.0)](https://github.com/raysan5/raylib/commits/master) +[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/5.5)](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) From fde3779ebd58e69f84b61cb4c3f941235e418881 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 18 Nov 2024 18:37:33 -0500 Subject: [PATCH 048/194] BINDINGS: raylib-cpp supports raylib 5.5 (#4511) [raylib-cpp](https://github.com/RobLoach/raylib-cpp) has been updated to use the new raylib 5.5 functions. This is a great release! Thanks so much. --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 8f68c66d3..7f79cb8d5 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -90,7 +90,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's paradigm. | Name | raylib Version | Language | License | | ---------------------------------------------------- | :------------: | :------------------------------------------: | :-----: | -| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.0** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | +| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.5** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | | [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | | [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT | From 05b2603c456eab3d12f37de0d4271bed869dc717 Mon Sep 17 00:00:00 2001 From: Steven Schveighoffer Date: Tue, 19 Nov 2024 03:03:39 -0500 Subject: [PATCH 049/194] Update raylib-d binding to 5.5 (#4506) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 7f79cb8d5..e5aa66815 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -23,7 +23,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [dart-raylib](https://gitlab.com/wolfenrain/dart-raylib) | 4.0 | [Dart](https://dart.dev) | MIT | | [bindbc-raylib3](https://github.com/o3o/bindbc-raylib3) | **5.0** | [D](https://dlang.org) | BSL-1.0 | | [dray](https://github.com/redthing1/dray) | **5.0** | [D](https://dlang.org) | Apache-2.0 | -| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.0** | [D](https://dlang.org) | Zlib | +| [raylib-d](https://github.com/schveiguy/raylib-d) | **5.5** | [D](https://dlang.org) | Zlib | | [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 | | [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 4.5 | [Factor](https://factorcode.org) | BSD | | [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT | From f979cc62eeff9bd510eadb99d4937ac6da353f0f Mon Sep 17 00:00:00 2001 From: Mute Date: Tue, 19 Nov 2024 08:04:14 +0000 Subject: [PATCH 050/194] Fixed grammar mistakes in core_3d_camera_first_person.c (#4508) Changed line 118 from, "// For advance camera controls, it's reecommended to compute camera movement manually", to, "// For advanced camera controls, it's recommended to compute camera movement manually". --- examples/core/core_3d_camera_first_person.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/core/core_3d_camera_first_person.c b/examples/core/core_3d_camera_first_person.c index 35b18ace4..2b36c598b 100644 --- a/examples/core/core_3d_camera_first_person.c +++ b/examples/core/core_3d_camera_first_person.c @@ -115,7 +115,7 @@ int main(void) // 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 + // For advanced camera controls, it's recommended to compute camera movement manually UpdateCamera(&camera, cameraMode); // Update camera /* @@ -203,4 +203,4 @@ int main(void) //-------------------------------------------------------------------------------------- return 0; -} \ No newline at end of file +} From 65f955a4dc967c1a9c0c0935724cc5117f5c3d9e Mon Sep 17 00:00:00 2001 From: kovidomi Date: Tue, 19 Nov 2024 09:05:09 +0100 Subject: [PATCH 051/194] Add missing VS2022 example projects for models_bone_socket and shaders_vertex_displacement (#4510) --- .../examples/models_bone_socket.vcxproj | 387 ++++++++++++++++++ .../shaders_vertex_displacement.vcxproj | 387 ++++++++++++++++++ projects/VS2022/raylib.sln | 38 ++ 3 files changed, 812 insertions(+) create mode 100644 projects/VS2022/examples/models_bone_socket.vcxproj create mode 100644 projects/VS2022/examples/shaders_vertex_displacement.vcxproj diff --git a/projects/VS2022/examples/models_bone_socket.vcxproj b/projects/VS2022/examples/models_bone_socket.vcxproj new file mode 100644 index 000000000..9d89856b0 --- /dev/null +++ b/projects/VS2022/examples/models_bone_socket.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F} + Win32Proj + models_bone_socket + 10.0 + models_bone_socket + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\models + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2022/examples/shaders_vertex_displacement.vcxproj b/projects/VS2022/examples/shaders_vertex_displacement.vcxproj new file mode 100644 index 000000000..294d5f76d --- /dev/null +++ b/projects/VS2022/examples/shaders_vertex_displacement.vcxproj @@ -0,0 +1,387 @@ + + + + + Debug.DLL + Win32 + + + Debug.DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release.DLL + Win32 + + + Release.DLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {CCA63A76-D9FC-4130-9F67-4D97F9770D53} + Win32Proj + shaders_vertex_displacement + 10.0 + shaders_vertex_displacement + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + true + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\ + $(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\ + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + $(SolutionDir)..\..\examples\shaders + WindowsLocalDebugger + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + /FS %(AdditionalOptions) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + Copy Debug DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + + + xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" + + + Copy Release DLL to output directory + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2022/raylib.sln b/projects/VS2022/raylib.sln index 4d03db808..5142c14a1 100644 --- a/projects/VS2022/raylib.sln +++ b/projects/VS2022/raylib.sln @@ -305,6 +305,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_shadowmap", "exampl EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_input_virtual_controls", "examples\core_input_virtual_controls.vcxproj", "{0981CA28-E4A5-4DF1-987F-A41D09131EFC}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "models_bone_socket", "examples\models_bone_socket.vcxproj", "{3A7FE53D-35F7-49DC-9C9A-A5204A53523F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_vertex_displacement", "examples\shaders_vertex_displacement.vcxproj", "{CCA63A76-D9FC-4130-9F67-4D97F9770D53}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug.DLL|x64 = Debug.DLL|x64 @@ -2585,6 +2589,38 @@ Global {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.Build.0 = Release|x64 {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 {0981CA28-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug|x64.ActiveCfg = Debug|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug|x64.Build.0 = Debug|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug|x86.ActiveCfg = Debug|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Debug|x86.Build.0 = Debug|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release|x64.ActiveCfg = Release|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release|x64.Build.0 = Release|x64 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release|x86.ActiveCfg = Release|Win32 + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F}.Release|x86.Build.0 = Release|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug|x64.ActiveCfg = Debug|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug|x64.Build.0 = Debug|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug|x86.ActiveCfg = Debug|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Debug|x86.Build.0 = Debug|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release.DLL|x64.Build.0 = Release.DLL|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x64.ActiveCfg = Release|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x64.Build.0 = Release|x64 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x86.ActiveCfg = Release|Win32 + {CCA63A76-D9FC-4130-9F67-4D97F9770D53}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2739,6 +2775,8 @@ Global {8245DAD9-D402-4D5C-8F45-32229CD3B263} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} {41BBCC10-6FDE-48A1-B2E0-A0EC6A668629} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} {0981CA28-E4A5-4DF1-987F-A41D09131EFC} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035} + {3A7FE53D-35F7-49DC-9C9A-A5204A53523F} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C} + {CCA63A76-D9FC-4130-9F67-4D97F9770D53} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} From 21575856f4fb35e9138cc4947e23caa6bd55a1ba Mon Sep 17 00:00:00 2001 From: Alexandre B A Villares <3694604+villares@users.noreply.github.com> Date: Tue, 19 Nov 2024 05:05:39 -0300 Subject: [PATCH 052/194] Update BINDINGS.md: raylib-python-cffi is on v5.0 (#4512) According to https://github.com/electronstudio/raylib-python-cffi --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index e5aa66815..62c01d86c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -54,7 +54,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.5** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib | | [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib | | [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib | -| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | 4.2 | [Python](https://www.python.org) | EPL-2.0 | +| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | 5.0 | [Python](https://www.python.org) | EPL-2.0 | | [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 4.5 | [Python](https://www.python.org) | MIT | | [raylib-py](https://github.com/overdev/raylib-py) | **5.0b1** | [Python](https://www.python.org) | MIT | | [raylib-python-ctypes](https://github.com/sDos280/raylib-python-ctypes) | 4.6-dev | [Python](https://www.python.org) | MIT | From 7127cba5cc7c217a747096b500bfae795aa5e6c0 Mon Sep 17 00:00:00 2001 From: Andrew Dunbar Date: Tue, 19 Nov 2024 16:33:36 +0700 Subject: [PATCH 053/194] typo/spello: arribes->arrives (#4515) --- HISTORY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 3cecb2a67..02e226437 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -475,7 +475,7 @@ Undoubtedly, this is the **biggest raylib update in 10 years**. Many new feature notes on raylib 5.5 ------------------- -One year after raylib 5.0 release, arribes `raylib 5.5`, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. +One year after raylib 5.0 release, arrives `raylib 5.5`, the next big revision of the library. It's been **11 years** since raylib 1.0 release and in all this time it has never stopped growing and improving. With an outstanding number of new contributors and improvements, it's, again, the biggest raylib release to date. Some numbers for this release: From bd706dfcf240355cb4e0fd8b84b554f601016d2d Mon Sep 17 00:00:00 2001 From: Jannis Date: Tue, 19 Nov 2024 09:35:10 +0000 Subject: [PATCH 054/194] Update BINDINGS.md for raylib-beef (#4514) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 62c01d86c..b3aef1293 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -7,7 +7,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | Name | raylib Version | Language | License | | :--------------------------------------------------------------------------------------- | :--------------: | :------------------------------------------------------------------: | :------------------: | | [raylib](https://github.com/raysan5/raylib) | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | -| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.0** | [Beef](https://www.beeflang.org) | MIT | +| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT | | [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT | | [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | | [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | From 95e766472f0b71c66b97e2fb7d612b335194da17 Mon Sep 17 00:00:00 2001 From: mikeemm <42421968+mikeemm@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:35:47 +0100 Subject: [PATCH 055/194] [rmodels] Improve OBJ vertex data precision and lower memory usage by ExportMesh() (#4496) * increased vertex data precision to match blender exports * modified memory allocation to better fit higher precision data * now accounting for newline characters during allocation * now accounting for potentially higher vertex counts * removed unnecessary final newline --- src/rmodels.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index b5830b2c0..05ad8083c 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1943,13 +1943,14 @@ bool ExportMesh(Mesh mesh, const char *fileName) if (IsFileExtension(fileName, ".obj")) { // Estimated data size, it should be enough... - int dataSize = mesh.vertexCount*(int)strlen("v 0000.00f 0000.00f 0000.00f") + - mesh.vertexCount*(int)strlen("vt 0.000f 0.00f") + - mesh.vertexCount*(int)strlen("vn 0.000f 0.00f 0.00f") + - mesh.triangleCount*(int)strlen("f 00000/00000/00000 00000/00000/00000 00000/00000/00000"); + int vc = mesh.vertexCount; + int dataSize = vc*(int)strlen("v -0000.000000f -0000.000000f -0000.000000f\n") + + vc*(int)strlen("vt -0.000000f -0.000000f\n") + + vc*(int)strlen("vn -0.0000f -0.0000f -0.0000f\n") + + mesh.triangleCount*snprintf(NULL, 0, "f %i/%i/%i %i/%i/%i %i/%i/%i\n", vc, vc, vc, vc, vc, vc, vc, vc, vc); // NOTE: Text data buffer size is estimated considering mesh data size - char *txtData = (char *)RL_CALLOC(dataSize*2 + 2000, sizeof(char)); + char *txtData = (char *)RL_CALLOC(dataSize + 1000, sizeof(char)); int byteCount = 0; byteCount += sprintf(txtData + byteCount, "# //////////////////////////////////////////////////////////////////////////////////\n"); @@ -1969,17 +1970,17 @@ bool ExportMesh(Mesh mesh, const char *fileName) for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 3) { - byteCount += sprintf(txtData + byteCount, "v %.2f %.2f %.2f\n", mesh.vertices[v], mesh.vertices[v + 1], mesh.vertices[v + 2]); + byteCount += sprintf(txtData + byteCount, "v %.6f %.6f %.6f\n", mesh.vertices[v], mesh.vertices[v + 1], mesh.vertices[v + 2]); } for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 2) { - byteCount += sprintf(txtData + byteCount, "vt %.3f %.3f\n", mesh.texcoords[v], mesh.texcoords[v + 1]); + byteCount += sprintf(txtData + byteCount, "vt %.6f %.6f\n", mesh.texcoords[v], mesh.texcoords[v + 1]); } for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 3) { - byteCount += sprintf(txtData + byteCount, "vn %.3f %.3f %.3f\n", mesh.normals[v], mesh.normals[v + 1], mesh.normals[v + 2]); + byteCount += sprintf(txtData + byteCount, "vn %.4f %.4f %.4f\n", mesh.normals[v], mesh.normals[v + 1], mesh.normals[v + 2]); } if (mesh.indices != NULL) @@ -2000,8 +2001,6 @@ bool ExportMesh(Mesh mesh, const char *fileName) } } - byteCount += sprintf(txtData + byteCount, "\n"); - // NOTE: Text data length exported is determined by '\0' (NULL) character success = SaveFileText(fileName, txtData); From 10789a4d496128492d190877f2506b6fa728325d Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 12:31:14 +0100 Subject: [PATCH 056/194] Update rlgl.h --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index 756656e58..3bb996add 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3,7 +3,7 @@ * rlgl v5.0 - A multi-OpenGL abstraction layer with an immediate-mode style API * * DESCRIPTION: -* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0) +* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0, ES 3.0) * that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...) * * ADDITIONAL NOTES: From c78757a95957adb3c3b3437d99e31273c1e361ea Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 12:31:49 +0100 Subject: [PATCH 057/194] REVIEWED: `GetClipboardImage()`, make symbol available on all platforms --- src/config.h | 51 ++++++++++++++---------------- src/platforms/rcore_android.c | 10 ++++++ src/platforms/rcore_desktop_glfw.c | 29 ++++++++--------- src/platforms/rcore_desktop_rgfw.c | 43 ++++++++++++------------- src/platforms/rcore_drm.c | 10 ++++++ src/platforms/rcore_template.c | 10 ++++++ src/platforms/rcore_web.c | 10 ++++++ 7 files changed, 97 insertions(+), 66 deletions(-) diff --git a/src/config.h b/src/config.h index e3749c560..d8f7112eb 100644 --- a/src/config.h +++ b/src/config.h @@ -71,6 +71,30 @@ // Enabling this flag allows manual control of the frame processes, use at your own risk //#define SUPPORT_CUSTOM_FRAME_CONTROL 1 +// Support for clipboard image loading +// NOTE: Only working on SDL3, GLFW (Windows) and RGFW (Windows) +#define SUPPORT_CLIPBOARD_IMAGE 1 + +// NOTE: Clipboard image loading requires support for some image file formats +// TODO: Those defines should probably be removed from here, I prefer to let the user manage them +#if defined(SUPPORT_CLIPBOARD_IMAGE) + #ifndef SUPPORT_MODULE_RTEXTURES + #define SUPPORT_MODULE_RTEXTURES 1 + #endif + #ifndef STBI_REQUIRED + #define STBI_REQUIRED + #endif + #ifndef SUPPORT_FILEFORMAT_BMP // For clipboard image on Windows + #define SUPPORT_FILEFORMAT_BMP 1 + #endif + #ifndef SUPPORT_FILEFORMAT_PNG // Wayland uses png for prints, at least it was on 22 LTS ubuntu + #define SUPPORT_FILEFORMAT_PNG 1 + #endif + #ifndef SUPPORT_FILEFORMAT_JPG + #define SUPPORT_FILEFORMAT_JPG 1 + #endif +#endif + // rcore: Configuration values //------------------------------------------------------------------------------------ @@ -273,31 +297,4 @@ //------------------------------------------------------------------------------------ #define MAX_TRACELOG_MSG_LENGTH 256 // Max length of one trace-log message - -// Enable partial support for clipboard image, only working on SDL3 or -// being on both Windows OS + GLFW or Windows OS + RGFW -#define SUPPORT_CLIPBOARD_IMAGE 1 - -#if defined(SUPPORT_CLIPBOARD_IMAGE) - #ifndef STBI_REQUIRED - #define STBI_REQUIRED - #endif - - #ifndef SUPPORT_FILEFORMAT_BMP // For clipboard image on Windows - #define SUPPORT_FILEFORMAT_BMP 1 - #endif - - #ifndef SUPPORT_FILEFORMAT_PNG // Wayland uses png for prints, at least it was on 22 LTS ubuntu - #define SUPPORT_FILEFORMAT_PNG 1 - #endif - - #ifndef SUPPORT_FILEFORMAT_JPG - #define SUPPORT_FILEFORMAT_JPG 1 - #endif - - #ifndef SUPPORT_MODULE_RTEXTURES - #define SUPPORT_MODULE_RTEXTURES 1 - #endif -#endif - #endif // CONFIG_H diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 85ce82a3a..401e2a067 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -515,6 +515,16 @@ const char *GetClipboardText(void) return NULL; } +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = { 0 }; + + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); + + return image; +} + // Show mouse cursor void ShowCursor(void) { diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index baf2967fe..839852d9f 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -967,32 +967,29 @@ const char *GetClipboardText(void) return glfwGetClipboardString(platform.handle); } -#if defined(SUPPORT_CLIPBOARD_IMAGE) // Get clipboard image Image GetClipboardImage(void) { - Image image = {0}; + Image image = { 0 }; + +#if defined(SUPPORT_CLIPBOARD_IMAGE) +#if defined(_WIN32) unsigned long long int dataSize = 0; - void* fileData = NULL; - -#ifdef _WIN32 - int width, height; + void *fileData = NULL; + int width = 0; + int height = 0; + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); + + if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); + else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); #else - TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_GLFW doesn't implement `GetClipboardImage` for this OS"); + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); #endif +#endif // SUPPORT_CLIPBOARD_IMAGE - if (fileData == NULL) - { - TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); - } - else - { - image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); - } return image; } -#endif // SUPPORT_CLIPBOARD_IMAGE // Show mouse cursor void ShowCursor(void) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index f3f26e3e8..7a2ea9c0d 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -664,42 +664,39 @@ const char *GetClipboardText(void) return RGFW_readClipboard(NULL); } - #if defined(SUPPORT_CLIPBOARD_IMAGE) - -#ifdef _WIN32 -# define WIN32_CLIPBOARD_IMPLEMENTATION -# define WINUSER_ALREADY_INCLUDED -# define WINBASE_ALREADY_INCLUDED -# define WINGDI_ALREADY_INCLUDED -# include "../external/win32_clipboard.h" +#if defined(_WIN32) + #define WIN32_CLIPBOARD_IMPLEMENTATION + #define WINUSER_ALREADY_INCLUDED + #define WINBASE_ALREADY_INCLUDED + #define WINGDI_ALREADY_INCLUDED + #include "../external/win32_clipboard.h" #endif +#endif // SUPPORT_CLIPBOARD_IMAGE // Get clipboard image Image GetClipboardImage(void) { - Image image = {0}; + Image image = { 0 }; + +#if defined(SUPPORT_CLIPBOARD_IMAGE) +#if defined(_WIN32) unsigned long long int dataSize = 0; - void* fileData = NULL; - -#ifdef _WIN32 - int width, height; + void *fileData = NULL; + int width = 0; + int height = 0; + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); + + if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); + else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); #else - TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement `GetClipboardImage` for this OS"); + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); #endif +#endif // SUPPORT_CLIPBOARD_IMAGE - if (fileData == NULL) - { - TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); - } - else - { - image = LoadImageFromMemory(".bmp", fileData, dataSize); - } return image; } -#endif // SUPPORT_CLIPBOARD_IMAGE // Show mouse cursor void ShowCursor(void) diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index eb8ef0103..e53f6e86d 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -509,6 +509,16 @@ const char *GetClipboardText(void) return NULL; } +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = { 0 }; + + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); + + return image; +} + // Show mouse cursor void ShowCursor(void) { diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index 6bc3432eb..83994e30f 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -292,6 +292,16 @@ const char *GetClipboardText(void) return NULL; } +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = { 0 }; + + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); + + return image; +} + // Show mouse cursor void ShowCursor(void) { diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index f9d93e5a3..aea9fef83 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -805,6 +805,16 @@ const char *GetClipboardText(void) return NULL; } +// Get clipboard image +Image GetClipboardImage(void) +{ + Image image = { 0 }; + + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); + + return image; +} + // Show mouse cursor void ShowCursor(void) { From 9e4f513a43a953b17203cab2c1257573850ab918 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 12:31:57 +0100 Subject: [PATCH 058/194] Reviewed formating --- src/platforms/rcore_desktop_sdl.c | 147 +++++++++++++++--------------- 1 file changed, 75 insertions(+), 72 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index a201f2cde..0b8406c7d 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -74,7 +74,6 @@ #endif #endif - //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- @@ -240,7 +239,7 @@ static const int CursorsLUT[] = { // SDL3 Migration Layer made to avoid `ifdefs` inside functions when we can. -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: // SDL_WINDOW_FULLSCREEN_DESKTOP has been removed, @@ -249,7 +248,6 @@ static const int CursorsLUT[] = { // or the borderless fullscreen desktop mode will be used #define SDL_WINDOW_FULLSCREEN_DESKTOP SDL_WINDOW_FULLSCREEN - #define SDL_IGNORE false #define SDL_DISABLE false #define SDL_ENABLE true @@ -260,27 +258,29 @@ static const int CursorsLUT[] = { // SDL3 Migration: The SDL_WINDOW_SHOWN flag has been removed. Windows are shown by default and can be created hidden by using the SDL_WINDOW_HIDDEN flag. #define SDL_WINDOW_SHOWN 0x0 // It's a flag, so no problem in setting it to zero if we use in a bitor (|) -// // SDL3 Migration: Renamed -// IMPORTANT: -// Might need to call SDL_CleanupEvent somewhere see :https://github.com/libsdl-org/SDL/issues/3540#issuecomment-1793449852 -// +// IMPORTANT: Might need to call SDL_CleanupEvent somewhere see :https://github.com/libsdl-org/SDL/issues/3540#issuecomment-1793449852 #define SDL_DROPFILE SDL_EVENT_DROP_FILE - -const char* SDL_GameControllerNameForIndex(int joystickIndex) +// SDL2 implementation for SDL3 function +const char *SDL_GameControllerNameForIndex(int joystickIndex) { // NOTE: SDL3 uses the IDs itself (SDL_JoystickID) instead of SDL2 joystick_index - const char* name = NULL; + const char *name = NULL; int numJoysticks = 0; SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); - if (joysticks) { - if (joystickIndex < numJoysticks) { + + if (joysticks) + { + if (joystickIndex < numJoysticks) + { SDL_JoystickID instance_id = joysticks[joystickIndex]; name = SDL_GetGamepadNameForID(instance_id); } + SDL_free(joysticks); } + return name; } @@ -288,45 +288,40 @@ int SDL_GetNumVideoDisplays(void) { int monitorCount = 0; SDL_DisplayID *displays = SDL_GetDisplays(&monitorCount); - // Safe because If `mem` is NULL, SDL_free does nothing. + + // Safe because If `mem` is NULL, SDL_free does nothing SDL_free(displays); return monitorCount; } - -// SLD3 Migration: -// To emulate SDL2 this function should return `SDL_DISABLE` or `SDL_ENABLE` -// representing the *processing state* of the event before this function makes any changes to it. -Uint8 SDL_EventState(Uint32 type, int state) { - +// SLD3 Migration: To emulate SDL2 this function should return `SDL_DISABLE` or `SDL_ENABLE` +// representing the *processing state* of the event before this function makes any changes to it +Uint8 SDL_EventState(Uint32 type, int state) +{ Uint8 stateBefore = SDL_EventEnabled(type); + switch (state) { case SDL_DISABLE: SDL_SetEventEnabled(type, false); break; case SDL_ENABLE: SDL_SetEventEnabled(type, true); break; default: TRACELOG(LOG_WARNING, "Event sate: unknow type"); } + return stateBefore; } void SDL_GetCurrentDisplayMode_Adapter(SDL_DisplayID displayID, SDL_DisplayMode* mode) { const SDL_DisplayMode* currMode = SDL_GetCurrentDisplayMode(displayID); - if (currMode == NULL) - { - TRACELOG(LOG_WARNING, "No current display mode"); - } - else - { - *mode = *currMode; - } + + if (currMode == NULL) TRACELOG(LOG_WARNING, "No current display mode"); + else *mode = *currMode; } // SDL3 Migration: Renamed #define SDL_GetCurrentDisplayMode SDL_GetCurrentDisplayMode_Adapter - SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { return SDL_CreateSurface(width, height, SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask)); @@ -337,11 +332,14 @@ SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth // not reliable across platforms, approximately replaced by multiplying // SDL_GetWindowDisplayScale() times 160 on iPhone and Android, and 96 on other platforms. // returns 0 on success or a negative error code on failure -int SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi) { - float dpi = SDL_GetWindowDisplayScale(platform.window) * 96.0; +int SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi) +{ + float dpi = SDL_GetWindowDisplayScale(platform.window)*96.0; + if (ddpi != NULL) *ddpi = dpi; if (hdpi != NULL) *hdpi = dpi; if (vdpi != NULL) *vdpi = dpi; + return 0; } @@ -368,17 +366,13 @@ int SDL_NumJoysticks(void) return numJoysticks; } - // SDL_SetRelativeMouseMode // returns 0 on success or a negative error code on failure // If relative mode is not supported, this returns -1. int SDL_SetRelativeMouseMode_Adapter(SDL_bool enabled) { - - // // SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled) // \returns true on success or false on failure; call SDL_GetError() for more - // if (SDL_SetWindowRelativeMouseMode(platform.window, enabled)) { return 0; // success @@ -398,7 +392,6 @@ bool SDL_GetRelativeMouseMode_Adapter(void) #define SDL_GetRelativeMouseMode SDL_GetRelativeMouseMode_Adapter - int SDL_GetNumTouchFingers(SDL_TouchID touchID) { // SDL_Finger **SDL_GetTouchFingers(SDL_TouchID touchID, int *count) @@ -412,16 +405,16 @@ int SDL_GetNumTouchFingers(SDL_TouchID touchID) // Since SDL2 doesn't have this function we leave a stub // SDL_GetClipboardData function is available since SDL 3.1.3. (e.g. SDL3) -void* SDL_GetClipboardData(const char *mime_type, size_t *size) { +void* SDL_GetClipboardData(const char *mime_type, size_t *size) +{ TRACELOG(LOG_WARNING, "Getting clipboard data that is not text is only available in SDL3"); + // We could possibly implement it ourselves in this case for some easier platforms return NULL; } #endif // PLATFORM_DESKTOP_SDL3 - - //---------------------------------------------------------------------------------- // Module Internal Functions Declaration //---------------------------------------------------------------------------------- @@ -452,7 +445,7 @@ void ToggleFullscreen(void) const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); -#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure +#if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure if ((monitor > 0) && (monitor <= monitorCount)) #else if ((monitor >= 0) && (monitor < monitorCount)) @@ -479,7 +472,8 @@ void ToggleBorderlessWindowed(void) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); -#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + +#if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure if ((monitor > 0) && (monitor <= monitorCount)) #else if ((monitor >= 0) && (monitor < monitorCount)) @@ -532,7 +526,8 @@ void SetWindowState(unsigned int flags) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); - #ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + + #if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure if ((monitor > 0) && (monitor <= monitorCount)) #else if ((monitor >= 0) && (monitor < monitorCount)) @@ -595,7 +590,8 @@ void SetWindowState(unsigned int flags) { const int monitor = SDL_GetWindowDisplayIndex(platform.window); const int monitorCount = SDL_GetNumVideoDisplays(); - #ifdef PLATFORM_DESKTOP_SDL3 // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure + + #if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: Monitor is an id instead of index now, returns 0 on failure if ((monitor > 0) && (monitor <= monitorCount)) #else if ((monitor >= 0) && (monitor < monitorCount)) @@ -818,7 +814,8 @@ void SetWindowMonitor(int monitor) const int screenWidth = CORE.Window.screen.width; const int screenHeight = CORE.Window.screen.height; SDL_Rect usableBounds; - #ifdef PLATFORM_DESKTOP_SDL3 // Different style for success checking + + #if defined(PLATFORM_DESKTOP_SDL3) // Different style for success checking if (SDL_GetDisplayUsableBounds(monitor, &usableBounds)) #else if (SDL_GetDisplayUsableBounds(monitor, &usableBounds) == 0) @@ -933,7 +930,8 @@ Vector2 GetMonitorPosition(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { SDL_Rect displayBounds; - #ifdef PLATFORM_DESKTOP_SDL3 + + #if defined(PLATFORM_DESKTOP_SDL3) if (SDL_GetDisplayUsableBounds(monitor, &displayBounds)) #else if (SDL_GetDisplayUsableBounds(monitor, &displayBounds) == 0) @@ -1104,53 +1102,55 @@ const char *GetClipboardText(void) return buffer; } - -#if defined(SUPPORT_CLIPBOARD_IMAGE) // Get clipboard image Image GetClipboardImage(void) { + Image image = { 0 }; + +#if defined(SUPPORT_CLIPBOARD_IMAGE) // Let's hope compiler put these arrays in static memory - const char *image_formats[] = { + const char *imageFormats[] = { "image/bmp", "image/png", "image/jpg", "image/tiff", }; - const char *image_extensions[] = { + const char *imageExtensions[] = { ".bmp", ".png", ".jpg", ".tiff", }; - - Image image = {0}; size_t dataSize = 0; void *fileData = NULL; - for (int i = 0; i < SDL_arraysize(image_formats); ++i) + + for (int i = 0; i < SDL_arraysize(imageFormats); ++i) { - // NOTE: This pointer should be free with SDL_free() at some point. - fileData = SDL_GetClipboardData(image_formats[i], &dataSize); - if (fileData) { - image = LoadImageFromMemory(image_extensions[i], fileData, dataSize); + // NOTE: This pointer should be free with SDL_free() at some point + fileData = SDL_GetClipboardData(imageFormats[i], &dataSize); + + if (fileData) + { + image = LoadImageFromMemory(imageExtensions[i], fileData, dataSize); if (IsImageValid(image)) { - TRACELOG(LOG_INFO, "Clipboard image: Got image from clipboard as a `%s` successfully", image_extensions[i]); + TRACELOG(LOG_INFO, "Clipboard image: Got image from clipboard as a `%s` successfully", imageExtensions[i]); return image; } } } - TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data. %s", SDL_GetError()); - return image; -} + if (!IsImageValid(image)) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data. Error: %s", SDL_GetError()); #endif + return image; +} // Show mouse cursor void ShowCursor(void) { -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) SDL_ShowCursor(); #else SDL_ShowCursor(SDL_ENABLE); @@ -1161,7 +1161,7 @@ void ShowCursor(void) // Hides mouse cursor void HideCursor(void) { -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) SDL_HideCursor(); #else SDL_ShowCursor(SDL_DISABLE); @@ -1174,7 +1174,7 @@ void EnableCursor(void) { SDL_SetRelativeMouseMode(SDL_FALSE); -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) // SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible() SDL_ShowCursor(); #else @@ -1275,7 +1275,7 @@ const char *GetKeyName(int key) static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) { -#ifdef PLATFORM_DESKTOP_SDL3 // SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) // SDL3 int count = 0; SDL_Finger **fingers = SDL_GetTouchFingers(event.touchID, &count); CORE.Input.Touch.pointCount = count; @@ -1288,7 +1288,9 @@ static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) CORE.Input.Touch.position[i].y = finger->y*CORE.Window.screen.height; CORE.Input.Touch.currentTouchState[i] = 1; } + SDL_free(fingers); + #else // SDL2 CORE.Input.Touch.pointCount = SDL_GetNumTouchFingers(event.touchId); @@ -1393,7 +1395,8 @@ void PollInputEvents(void) CORE.Window.dropFilepaths = (char **)RL_CALLOC(1024, sizeof(char *)); CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - #ifdef PLATFORM_DESKTOP_SDL3 + + #if defined(PLATFORM_DESKTOP_SDL3) // const char *data; /**< The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events */ // Event memory is now managed by SDL, so you should not free the data in SDL_EVENT_DROP_FILE, and if you want to hold onto the text in SDL_EVENT_TEXT_EDITING and SDL_EVENT_TEXT_INPUT events, you should make a copy of it. SDL_TEXTINPUTEVENT_TEXT_SIZE is no longer necessary and has been removed. strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); @@ -1407,7 +1410,8 @@ void PollInputEvents(void) else if (CORE.Window.dropFileCount < 1024) { CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - #ifdef PLATFORM_DESKTOP_SDL3 + + #if defined(PLATFORM_DESKTOP_SDL3) strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); #else strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.file); @@ -1460,7 +1464,7 @@ void PollInputEvents(void) case SDL_WINDOWEVENT_FOCUS_GAINED: case SDL_WINDOWEVENT_MAXIMIZED: case SDL_WINDOWEVENT_RESTORED: - #ifdef PLATFORM_DESKTOP_SDL3 + #if defined(PLATFORM_DESKTOP_SDL3) break; #else default: break; @@ -1471,7 +1475,7 @@ void PollInputEvents(void) // Keyboard events case SDL_KEYDOWN: { - #ifdef PLATFORM_DESKTOP_SDL3 + #if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: The following structures have been removed: * SDL_Keysym KeyboardKey key = ConvertScancodeToKey(event.key.scancode); #else @@ -1502,7 +1506,7 @@ void PollInputEvents(void) case SDL_KEYUP: { - #ifdef PLATFORM_DESKTOP_SDL3 + #if defined(PLATFORM_DESKTOP_SDL3) KeyboardKey key = ConvertScancodeToKey(event.key.scancode); #else KeyboardKey key = ConvertScancodeToKey(event.key.keysym.scancode); @@ -1858,7 +1862,7 @@ int InitPlatform(void) } // Init window -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) platform.window = SDL_CreateWindow(CORE.Window.title, CORE.Window.screen.width, CORE.Window.screen.height, flags); #else platform.window = SDL_CreateWindow(CORE.Window.title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, CORE.Window.screen.width, CORE.Window.screen.height, flags); @@ -1946,11 +1950,10 @@ int InitPlatform(void) CORE.Storage.basePath = SDL_GetBasePath(); // Alternative: GetWorkingDirectory(); //---------------------------------------------------------------------------- - -#ifdef PLATFORM_DESKTOP_SDL3 +#if defined(PLATFORM_DESKTOP_SDL3) TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL3): Initialized successfully"); #else - TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL): Initialized successfully"); + TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (SDL2): Initialized successfully"); #endif return 0; From 26548c10620c4ae6937cf8b506c777a006b33c16 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Nov 2024 12:33:13 +0100 Subject: [PATCH 059/194] Remove trail-spaces --- src/platforms/rcore_android.c | 2 +- src/platforms/rcore_desktop_glfw.c | 8 +++---- src/platforms/rcore_desktop_rgfw.c | 14 ++++++------ src/platforms/rcore_desktop_sdl.c | 36 +++++++++++++++--------------- src/platforms/rcore_drm.c | 2 +- src/platforms/rcore_template.c | 2 +- src/platforms/rcore_web.c | 2 +- src/rlgl.h | 4 ++-- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 401e2a067..47dc5cabc 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -519,7 +519,7 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); return image; diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 839852d9f..5caf17ead 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -68,7 +68,7 @@ // NOTE: Those functions require linking with winmm library //#pragma warning(disable: 4273) __declspec(dllimport) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); - //#pragma warning(default: 4273) + //#pragma warning(default: 4273) #endif #endif #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) @@ -971,16 +971,16 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + #if defined(SUPPORT_CLIPBOARD_IMAGE) #if defined(_WIN32) unsigned long long int dataSize = 0; void *fileData = NULL; int width = 0; int height = 0; - + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); - + if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); #else diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 7a2ea9c0d..1d3ddf60f 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -246,7 +246,7 @@ bool WindowShouldClose(void) // Toggle fullscreen mode void ToggleFullscreen(void) -{ +{ RGFW_window_maximize(platform.window); ToggleBorderlessWindowed(); } @@ -678,16 +678,16 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + #if defined(SUPPORT_CLIPBOARD_IMAGE) #if defined(_WIN32) unsigned long long int dataSize = 0; void *fileData = NULL; int width = 0; int height = 0; - + fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); - + if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); #else @@ -1194,7 +1194,7 @@ void PollInputEvents(void) int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER)? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2; int pressed = (value > 0.1f); CORE.Input.Gamepad.currentButtonState[event->joystick][button] = pressed; - + if (pressed) CORE.Input.Gamepad.lastButtonPressed = button; else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; } @@ -1286,8 +1286,8 @@ int InitPlatform(void) RGFW_area screenSize = RGFW_getScreenSize(); CORE.Window.display.width = screenSize.w; CORE.Window.display.height = screenSize.h; - /* - I think this is needed by Raylib now ? + /* + I think this is needed by Raylib now ? If so, rcore_destkop_sdl should be updated too */ SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height); diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 0b8406c7d..99de9af22 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -244,7 +244,7 @@ static const int CursorsLUT[] = { // SDL3 Migration: // SDL_WINDOW_FULLSCREEN_DESKTOP has been removed, // and you can call SDL_GetWindowFullscreenMode() -// to see whether an exclusive fullscreen mode will be used +// to see whether an exclusive fullscreen mode will be used // or the borderless fullscreen desktop mode will be used #define SDL_WINDOW_FULLSCREEN_DESKTOP SDL_WINDOW_FULLSCREEN @@ -269,7 +269,7 @@ const char *SDL_GameControllerNameForIndex(int joystickIndex) const char *name = NULL; int numJoysticks = 0; SDL_JoystickID *joysticks = SDL_GetJoysticks(&numJoysticks); - + if (joysticks) { if (joystickIndex < numJoysticks) @@ -277,10 +277,10 @@ const char *SDL_GameControllerNameForIndex(int joystickIndex) SDL_JoystickID instance_id = joysticks[joystickIndex]; name = SDL_GetGamepadNameForID(instance_id); } - + SDL_free(joysticks); } - + return name; } @@ -288,7 +288,7 @@ int SDL_GetNumVideoDisplays(void) { int monitorCount = 0; SDL_DisplayID *displays = SDL_GetDisplays(&monitorCount); - + // Safe because If `mem` is NULL, SDL_free does nothing SDL_free(displays); @@ -300,21 +300,21 @@ int SDL_GetNumVideoDisplays(void) Uint8 SDL_EventState(Uint32 type, int state) { Uint8 stateBefore = SDL_EventEnabled(type); - + switch (state) { case SDL_DISABLE: SDL_SetEventEnabled(type, false); break; case SDL_ENABLE: SDL_SetEventEnabled(type, true); break; default: TRACELOG(LOG_WARNING, "Event sate: unknow type"); } - + return stateBefore; } void SDL_GetCurrentDisplayMode_Adapter(SDL_DisplayID displayID, SDL_DisplayMode* mode) { const SDL_DisplayMode* currMode = SDL_GetCurrentDisplayMode(displayID); - + if (currMode == NULL) TRACELOG(LOG_WARNING, "No current display mode"); else *mode = *currMode; } @@ -335,11 +335,11 @@ SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth int SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi) { float dpi = SDL_GetWindowDisplayScale(platform.window)*96.0; - + if (ddpi != NULL) *ddpi = dpi; if (hdpi != NULL) *hdpi = dpi; if (vdpi != NULL) *vdpi = dpi; - + return 0; } @@ -408,7 +408,7 @@ int SDL_GetNumTouchFingers(SDL_TouchID touchID) void* SDL_GetClipboardData(const char *mime_type, size_t *size) { TRACELOG(LOG_WARNING, "Getting clipboard data that is not text is only available in SDL3"); - + // We could possibly implement it ourselves in this case for some easier platforms return NULL; } @@ -930,7 +930,7 @@ Vector2 GetMonitorPosition(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { SDL_Rect displayBounds; - + #if defined(PLATFORM_DESKTOP_SDL3) if (SDL_GetDisplayUsableBounds(monitor, &displayBounds)) #else @@ -1124,12 +1124,12 @@ Image GetClipboardImage(void) size_t dataSize = 0; void *fileData = NULL; - + for (int i = 0; i < SDL_arraysize(imageFormats); ++i) { // NOTE: This pointer should be free with SDL_free() at some point fileData = SDL_GetClipboardData(imageFormats[i], &dataSize); - + if (fileData) { image = LoadImageFromMemory(imageExtensions[i], fileData, dataSize); @@ -1288,9 +1288,9 @@ static void UpdateTouchPointsSDL(SDL_TouchFingerEvent event) CORE.Input.Touch.position[i].y = finger->y*CORE.Window.screen.height; CORE.Input.Touch.currentTouchState[i] = 1; } - + SDL_free(fingers); - + #else // SDL2 CORE.Input.Touch.pointCount = SDL_GetNumTouchFingers(event.touchId); @@ -1395,7 +1395,7 @@ void PollInputEvents(void) CORE.Window.dropFilepaths = (char **)RL_CALLOC(1024, sizeof(char *)); CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - + #if defined(PLATFORM_DESKTOP_SDL3) // const char *data; /**< The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events */ // Event memory is now managed by SDL, so you should not free the data in SDL_EVENT_DROP_FILE, and if you want to hold onto the text in SDL_EVENT_TEXT_EDITING and SDL_EVENT_TEXT_INPUT events, you should make a copy of it. SDL_TEXTINPUTEVENT_TEXT_SIZE is no longer necessary and has been removed. @@ -1410,7 +1410,7 @@ void PollInputEvents(void) else if (CORE.Window.dropFileCount < 1024) { CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); - + #if defined(PLATFORM_DESKTOP_SDL3) strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event.drop.data); #else diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index e53f6e86d..e9a236868 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -513,7 +513,7 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); return image; diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index 83994e30f..891c4ab34 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -296,7 +296,7 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); return image; diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index aea9fef83..859b2c1f3 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -809,7 +809,7 @@ const char *GetClipboardText(void) Image GetClipboardImage(void) { Image image = { 0 }; - + TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); return image; diff --git a/src/rlgl.h b/src/rlgl.h index 3bb996add..92971df62 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3417,9 +3417,9 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mi { if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB) { - if ((format == RL_PIXELFORMAT_UNCOMPRESSED_R32) || + if ((format == RL_PIXELFORMAT_UNCOMPRESSED_R32) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32) || - (format == RL_PIXELFORMAT_UNCOMPRESSED_R16) || + (format == RL_PIXELFORMAT_UNCOMPRESSED_R16) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16)) TRACELOG(RL_LOG_WARNING, "TEXTURES: Cubemap requested format not supported"); else glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mipmapLevel, glInternalFormat, mipSize, mipSize, 0, glFormat, glType, NULL); } From 481095226daedfc2a2254372cdb5f5ff225915d7 Mon Sep 17 00:00:00 2001 From: Alexandre B A Villares <3694604+villares@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:41:14 -0300 Subject: [PATCH 060/194] Update BINDINGS.md: github.com/electronstudio/raylib-python-cffi now 5.5 (#4517) --- BINDINGS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index b3aef1293..f82a66be7 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -54,9 +54,9 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **5.5** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib | | [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib | | [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib | -| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | 5.0 | [Python](https://www.python.org) | EPL-2.0 | +| [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | **5.5** | [Python](https://www.python.org) | EPL-2.0 | | [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 4.5 | [Python](https://www.python.org) | MIT | -| [raylib-py](https://github.com/overdev/raylib-py) | **5.0b1** | [Python](https://www.python.org) | MIT | +| [raylib-py](https://github.com/overdev/raylib-py) | 5.0b1 | [Python](https://www.python.org) | MIT | | [raylib-python-ctypes](https://github.com/sDos280/raylib-python-ctypes) | 4.6-dev | [Python](https://www.python.org) | MIT | | [raylib-pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) | 4.6-dev | [pocketpy](https://pocketpy.dev) | MIT | | [raylib-php](https://github.com/joseph-montanez/raylib-php) | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | From a145779e215772cbcbb7d68e74fdf927264facc1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 19 Nov 2024 21:42:34 +0000 Subject: [PATCH 061/194] Update BINDINGS.md: fortran-raylib is on v5.5 (#4518) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index f82a66be7..5c2170373 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -27,7 +27,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 | | [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 4.5 | [Factor](https://factorcode.org) | BSD | | [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT | -| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | 4.5 | [Fortran](https://fortran-lang.org) | ISC | +| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | **5.5** | [Fortran](https://fortran-lang.org) | ISC | | [raylib-go](https://github.com/gen2brain/raylib-go) | **5.0** | [Go](https://golang.org) | Zlib | | [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib | | [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** | From 57edbc3bab77e89b88e157f6f31ee29d9f62a040 Mon Sep 17 00:00:00 2001 From: "Jorge A. Gomes" Date: Wed, 20 Nov 2024 07:24:47 -0300 Subject: [PATCH 062/194] Update BINDINGS.md for raylib-py 5.5 (#4519) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 5c2170373..919bc51ca 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -56,7 +56,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib | | [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | **5.5** | [Python](https://www.python.org) | EPL-2.0 | | [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 4.5 | [Python](https://www.python.org) | MIT | -| [raylib-py](https://github.com/overdev/raylib-py) | 5.0b1 | [Python](https://www.python.org) | MIT | +| [raylib-py](https://github.com/overdev/raylib-py) | 5.5 | [Python](https://www.python.org) | MIT | | [raylib-python-ctypes](https://github.com/sDos280/raylib-python-ctypes) | 4.6-dev | [Python](https://www.python.org) | MIT | | [raylib-pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) | 4.6-dev | [pocketpy](https://pocketpy.dev) | MIT | | [raylib-php](https://github.com/joseph-montanez/raylib-php) | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | From 6af664c04ee4d75cff31c563967d75f0295a7325 Mon Sep 17 00:00:00 2001 From: devdad Date: Wed, 20 Nov 2024 11:25:31 +0100 Subject: [PATCH 063/194] Update shaders_basic_pbr example to work on web (#4516) * basic pbr example pbr implementation includes rpbr.h and few shader files header only file, which self contain everything needed for pbr rendering. Few textures and one model of the car which is under free licence which is included inside basic_pbr.c example file currently supported shader versions are 120 and 330 , version 100 has small issue which I have to resolve * Unloading PBRMAterial I forgot unloading PBRMaterial * fix small issue with texOffset assigment. value was Vector4 at first but I found out it would be unclear for and users, so I change to have two Vector2 instead, but forgot to assign offset . * Changed size of textures and file name changed Changed size of textures from 2048x2048 to 1024x1024 and file name changed to shaders_basic_pbr.c , Added the function PBRModel PBRModelLoadFromMesh(Mesh mesh); but GenMeshPlane(2, 2.0, 3, 3) culdn't be used because it crash once GenMeshTangents() is used with that plane mesh * Update to 5.5 version of eexample and fix to work in web set GLSL_VERSION 100 set precision highp float; removed in keyword fix for loop has to use only constant * Update shader_basic_pbr example to work on web changed to GLSL_VERSION 100 update glsl100 shader set float precision to highp removed keyword in change for loop tu use constant value gives an error * Update shader_basic_pbr example to work on web changed to GLSL_VERSION 100 update glsl100 shader set float precision to highp removed keyword in change for loop tu use constant value gives an error * removed rpbr.h removed rpbr.h --- .../shaders/resources/shaders/glsl100/pbr.fs | 16 ++++++++-------- examples/shaders/shaders_basic_pbr.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/pbr.fs b/examples/shaders/resources/shaders/glsl100/pbr.fs index 1ada83317..27d496968 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.fs +++ b/examples/shaders/resources/shaders/glsl100/pbr.fs @@ -1,6 +1,6 @@ #version 100 -precision mediump float; +precision highp float; #define MAX_LIGHTS 4 #define LIGHT_DIRECTIONAL 0 @@ -17,12 +17,12 @@ struct Light { }; // Input vertex attributes (from vertex shader) -varying in vec3 fragPosition; -varying in vec2 fragTexCoord; -varying in vec4 fragColor; -varying in vec3 fragNormal; -varying in vec4 shadowPos; -varying in mat3 TBN; +varying vec3 fragPosition; +varying vec2 fragTexCoord; +varying vec4 fragColor; +varying vec3 fragNormal; +varying vec4 shadowPos; +varying mat3 TBN; // Input uniform values @@ -113,7 +113,7 @@ vec3 pbr(){ vec3 baseRefl = mix(vec3(0.04),albedo.rgb,metallic); vec3 Lo = vec3(0.0); // acumulate lighting lum - for(int i=0;i // Required for: NULL From 532167d28baade92a50c1020c127f2d060cd392f Mon Sep 17 00:00:00 2001 From: kimierik <105240664+kimierik@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:26:29 +0200 Subject: [PATCH 064/194] build.zig: fix raygui inclusion in windows crosscompilation (#4489) --- build.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.zig b/build.zig index 5c2ac77cd..4cc412bc5 100644 --- a/build.zig +++ b/build.zig @@ -302,12 +302,14 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. } pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency) void { + const raylib_dep = b.dependencyFromBuildZig(@This(), .{}); var gen_step = b.addWriteFiles(); raylib.step.dependOn(&gen_step.step); const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n"); raylib.addCSourceFile(.{ .file = raygui_c_path }); raylib.addIncludePath(raygui_dep.path("src")); + raylib.addIncludePath(raylib_dep.path("src")); raylib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h"); } From 415a98965a9d8ca1538e890367f27ec08c95f05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gael=20P=C3=A9rez?= Date: Wed, 20 Nov 2024 04:27:14 -0600 Subject: [PATCH 065/194] update raymath.h: add Vector2CrossProduct function (#4520) --- src/raymath.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/raymath.h b/src/raymath.h index e522113b1..06865e199 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -304,6 +304,14 @@ RMAPI float Vector2DotProduct(Vector2 v1, Vector2 v2) return result; } +// Calculate two vectors cross product +RMAPI float Vector2CrossProduct(Vector2 v1, Vector2 v2) +{ + float result = (v1.x*v2.y - v1.y*v2.x); + + return result; +} + // Calculate distance between two vectors RMAPI float Vector2Distance(Vector2 v1, Vector2 v2) { From 11429b48eb244c8e153838cf7d876d75da992815 Mon Sep 17 00:00:00 2001 From: veins1 <19636663+veins1@users.noreply.github.com> Date: Thu, 21 Nov 2024 01:28:46 +0500 Subject: [PATCH 066/194] Fix for #4521 (#4523) --- src/raudio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/raudio.c b/src/raudio.c index 15859a661..33c0c4e04 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1855,6 +1855,8 @@ void SeekMusicStream(Music music, float position) ma_mutex_lock(&AUDIO.System.lock); music.stream.buffer->framesProcessed = positionInFrames; + music.stream.buffer->isSubBufferProcessed[0] = true; + music.stream.buffer->isSubBufferProcessed[1] = true; ma_mutex_unlock(&AUDIO.System.lock); } From 0d39e7137b28980f05843bd505ef3e74d8772d03 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 21 Nov 2024 12:38:29 +0100 Subject: [PATCH 067/194] Fix #4527 --- .../shaders/glsl330/hybrid_raster.fs | 12 +++++++-- .../resources/shaders/glsl330/sobel.fs | 26 +++++++++---------- .../resources/shaders/glsl330/swirl.fs | 2 +- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl330/hybrid_raster.fs b/examples/shaders/resources/shaders/glsl330/hybrid_raster.fs index 85ef492c0..26c7e8f26 100644 --- a/examples/shaders/resources/shaders/glsl330/hybrid_raster.fs +++ b/examples/shaders/resources/shaders/glsl330/hybrid_raster.fs @@ -1,14 +1,22 @@ -#version 330 +#version 330 +// Input vertex attributes (from vertex shader) in vec2 fragTexCoord; in vec4 fragColor; +// Input uniform values uniform sampler2D texture0; uniform vec4 colDiffuse; +// Output fragment color +//out vec4 finalColor; + +// NOTE: Add here your custom variables + void main() { - vec4 texelColor = texture2D(texture0, fragTexCoord); + vec4 texelColor = texture(texture0, fragTexCoord); + gl_FragColor = texelColor*colDiffuse*fragColor; gl_FragDepth = gl_FragCoord.z; } \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/sobel.fs b/examples/shaders/resources/shaders/glsl330/sobel.fs index f76e9cab9..80883710d 100644 --- a/examples/shaders/resources/shaders/glsl330/sobel.fs +++ b/examples/shaders/resources/shaders/glsl330/sobel.fs @@ -20,22 +20,22 @@ void main() float y = 1.0/resolution.y; vec4 horizEdge = vec4(0.0); - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; - horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; - horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + horizEdge -= texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + horizEdge -= texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0; + horizEdge -= texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + horizEdge += texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + horizEdge += texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0; + horizEdge += texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; vec4 vertEdge = vec4(0.0); - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; - vertEdge -= texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; - vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; + vertEdge -= texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0; + vertEdge -= texture(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0; + vertEdge -= texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0; + vertEdge += texture(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0; + vertEdge += texture(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0; + vertEdge += texture(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0; vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb)); - finalColor = vec4(edge, texture2D(texture0, fragTexCoord).a); + finalColor = vec4(edge, texture(texture0, fragTexCoord).a); } \ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/swirl.fs b/examples/shaders/resources/shaders/glsl330/swirl.fs index bb0732c55..6a71e3696 100644 --- a/examples/shaders/resources/shaders/glsl330/swirl.fs +++ b/examples/shaders/resources/shaders/glsl330/swirl.fs @@ -41,7 +41,7 @@ void main() } tc += center; - vec4 color = texture2D(texture0, tc/texSize)*colDiffuse*fragColor;; + vec4 color = texture(texture0, tc/texSize)*colDiffuse*fragColor;; finalColor = vec4(color.rgb, 1.0);; } \ No newline at end of file From a53a8958f293c0cc5760021cce616574408aee50 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Fri, 22 Nov 2024 06:52:55 -0300 Subject: [PATCH 068/194] Add implementation to GetWindowScaleDPI() for PLATFORM_WEB (#4526) --- src/platforms/rcore_web.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 859b2c1f3..d0be02514 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -771,8 +771,11 @@ Vector2 GetWindowPosition(void) // Get window scale DPI factor for current monitor Vector2 GetWindowScaleDPI(void) { - TRACELOG(LOG_WARNING, "GetWindowScaleDPI() not implemented on target platform"); - return (Vector2){ 1.0f, 1.0f }; + // NOTE: Returned scale is relative to the current monitor where the browser window is located + Vector2 scale = { 1.0f, 1.0f }; + scale.x = (float)EM_ASM_DOUBLE( { return window.devicePixelRatio; } ); + scale.y = scale.x; + return scale; } // Set clipboard text content From 50a2afff9ebf4f76c61fcf84c046586c9e9b6355 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 22 Nov 2024 11:01:10 +0100 Subject: [PATCH 069/194] Update raylib version to 5.6-dev to avoid confusions with release --- src/raylib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index a26b8ce6b..e548f6def 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1,6 +1,6 @@ /********************************************************************************************** * -* raylib v5.5 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) +* raylib v5.6-dev - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) * * FEATURES: * - NO external dependencies, all required libraries included with raylib @@ -88,9 +88,9 @@ #include // Required for: va_list - Only used by TraceLogCallback #define RAYLIB_VERSION_MAJOR 5 -#define RAYLIB_VERSION_MINOR 5 +#define RAYLIB_VERSION_MINOR 6 #define RAYLIB_VERSION_PATCH 0 -#define RAYLIB_VERSION "5.5" +#define RAYLIB_VERSION "5.6-dev" // Function specifiers in case library is build/used as a shared library // NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll From 65e0d2cfda9a53a00b8b9e9350544867896817d1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 Nov 2024 10:01:29 +0000 Subject: [PATCH 070/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 4 ++-- parser/output/raylib_api.lua | 4 ++-- parser/output/raylib_api.txt | 4 ++-- parser/output/raylib_api.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 0921ed40e..8561bc343 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -15,7 +15,7 @@ { "name": "RAYLIB_VERSION_MINOR", "type": "INT", - "value": 5, + "value": 6, "description": "" }, { @@ -27,7 +27,7 @@ { "name": "RAYLIB_VERSION", "type": "STRING", - "value": "5.5", + "value": "5.6-dev", "description": "" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index a8e242ac7..9ff6c1a9c 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -15,7 +15,7 @@ return { { name = "RAYLIB_VERSION_MINOR", type = "INT", - value = 5, + value = 6, description = "" }, { @@ -27,7 +27,7 @@ return { { name = "RAYLIB_VERSION", type = "STRING", - value = "5.5", + value = "5.6-dev", description = "" }, { diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index a9cfa005c..e7d04cb46 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -14,7 +14,7 @@ Define 002: RAYLIB_VERSION_MAJOR Define 003: RAYLIB_VERSION_MINOR Name: RAYLIB_VERSION_MINOR Type: INT - Value: 5 + Value: 6 Description: Define 004: RAYLIB_VERSION_PATCH Name: RAYLIB_VERSION_PATCH @@ -24,7 +24,7 @@ Define 004: RAYLIB_VERSION_PATCH Define 005: RAYLIB_VERSION Name: RAYLIB_VERSION Type: STRING - Value: "5.5" + Value: "5.6-dev" Description: Define 006: __declspec(x) Name: __declspec(x) diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index dcc079f10..6a5cecf5e 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -3,9 +3,9 @@ - + - + From da6fa1d756b4fac76881250089dc48f6e9d2ac1c Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 22 Nov 2024 11:06:34 +0100 Subject: [PATCH 071/194] Fix #4529 --- src/rtext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rtext.c b/src/rtext.c index 81bfe1a8a..999557d38 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1339,6 +1339,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing int GetGlyphIndex(Font font, int codepoint) { int index = 0; + if (!IsFontValid(font)) return index; #define SUPPORT_UNORDERED_CHARSET #if defined(SUPPORT_UNORDERED_CHARSET) From a9aa6b498834925509ed9176d71ad9e96033cc4d Mon Sep 17 00:00:00 2001 From: HaxSam Date: Sun, 24 Nov 2024 16:22:51 +0100 Subject: [PATCH 072/194] [build.zig] improve build system for zig (#4531) Is now possible to switch platform Is now possible to diable raudio, rmodels, and so on Made getOptions public so it can be used for zig wrappers --- build.zig | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/build.zig b/build.zig index 4cc412bc5..866e70034 100644 --- a/build.zig +++ b/build.zig @@ -12,8 +12,6 @@ comptime { } fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void { - raylib.defineCMacro("PLATFORM_DESKTOP", null); - switch (platform) { .glfw => raylib.defineCMacro("PLATFORM_DESKTOP_GLFW", null), .rgfw => raylib.defineCMacro("PLATFORM_DESKTOP_RGFW", null), @@ -58,6 +56,7 @@ const config_h_flags = outer: { var lines = std.mem.tokenizeScalar(u8, config_h, '\n'); while (lines.next()) |line| { if (!std.mem.containsAtLeast(u8, line, 1, "SUPPORT")) continue; + if (std.mem.containsAtLeast(u8, line, 1, "MODULE")) continue; if (std.mem.startsWith(u8, line, "//")) continue; if (std.mem.startsWith(u8, line, "#if")) continue; @@ -94,10 +93,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. }); } + // Sets a flag indiciating the use of a custom `config.h` + try raylib_flags_arr.append("-DEXTERNAL_CONFIG_FLAGS"); if (options.config.len > 0) { - // Sets a flag indiciating the use of a custom `config.h` - try raylib_flags_arr.append("-DEXTERNAL_CONFIG_FLAGS"); - // Splits a space-separated list of config flags into multiple flags // // Note: This means certain flags like `-x c++` won't be processed properly. @@ -126,6 +124,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. // Otherwise, append default value from config.h to compile flags try raylib_flags_arr.append(flag); } + } else { + // Set default config if no custome config got set + try raylib_flags_arr.appendSlice(&config_h_flags); } const raylib = if (options.shared) @@ -150,26 +151,32 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. var c_source_files = try std.ArrayList([]const u8).initCapacity(b.allocator, 2); c_source_files.appendSliceAssumeCapacity(&.{ "src/rcore.c", "src/utils.c" }); - if (options.raudio) { - try c_source_files.append("src/raudio.c"); - } - if (options.rmodels) { - try c_source_files.append("src/rmodels.c"); - } if (options.rshapes) { try c_source_files.append("src/rshapes.c"); - } - if (options.rtext) { - try c_source_files.append("src/rtext.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RSHAPES"); } if (options.rtextures) { try c_source_files.append("src/rtextures.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RTEXTURES"); + } + if (options.rtext) { + try c_source_files.append("src/rtext.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RTEXT"); + } + if (options.rmodels) { + try c_source_files.append("src/rmodels.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RMODELS"); + } + if (options.raudio) { + try c_source_files.append("src/raudio.c"); + try raylib_flags_arr.append("-DSUPPORT_MODULE_RAUDIO"); } if (options.opengl_version != .auto) { raylib.defineCMacro(options.opengl_version.toCMacroStr(), null); } + raylib.addIncludePath(b.path("src/platforms")); switch (target.result.os.tag) { .windows => { try c_source_files.append("src/rglfw.c"); @@ -329,7 +336,7 @@ pub const Options = struct { const defaults = Options{}; - fn getOptions(b: *std.Build) Options { + pub fn getOptions(b: *std.Build) Options { return .{ .platform = b.option(PlatformBackend, "platform", "Choose the platform backedn for desktop target") orelse defaults.platform, .raudio = b.option(bool, "raudio", "Compile with audio support") orelse defaults.raudio, From e494c545b879fa80f55aae13772316fd5c25daac Mon Sep 17 00:00:00 2001 From: listeria <56203103+ListeriaM@users.noreply.github.com> Date: Sun, 24 Nov 2024 12:24:34 -0300 Subject: [PATCH 073/194] raymath: fix C++ operator overloads (#4535) Co-authored-by: Listeria monocytogenes --- src/raymath.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 06865e199..5b5e4c74f 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -2656,7 +2656,7 @@ inline Vector2 operator * (const Vector2& lhs, const Matrix& rhs) return Vector2Transform(lhs, rhs); } -inline const Vector2& operator -= (Vector2& lhs, const Matrix& rhs) +inline const Vector2& operator *= (Vector2& lhs, const Matrix& rhs) { lhs = Vector2Transform(lhs, rhs); return lhs; @@ -2669,7 +2669,7 @@ inline Vector2 operator / (const Vector2& lhs, const float& rhs) inline const Vector2& operator /= (Vector2& lhs, const float& rhs) { - lhs = Vector2Scale(lhs, rhs); + lhs = Vector2Scale(lhs, 1.0f / rhs); return lhs; } @@ -2750,7 +2750,7 @@ inline Vector3 operator * (const Vector3& lhs, const Matrix& rhs) return Vector3Transform(lhs, rhs); } -inline const Vector3& operator -= (Vector3& lhs, const Matrix& rhs) +inline const Vector3& operator *= (Vector3& lhs, const Matrix& rhs) { lhs = Vector3Transform(lhs, rhs); return lhs; @@ -2763,7 +2763,7 @@ inline Vector3 operator / (const Vector3& lhs, const float& rhs) inline const Vector3& operator /= (Vector3& lhs, const float& rhs) { - lhs = Vector3Scale(lhs, rhs); + lhs = Vector3Scale(lhs, 1.0f / rhs); return lhs; } @@ -2847,7 +2847,7 @@ inline Vector4 operator / (const Vector4& lhs, const float& rhs) inline const Vector4& operator /= (Vector4& lhs, const float& rhs) { - lhs = Vector4Scale(lhs, rhs); + lhs = Vector4Scale(lhs, 1.0f / rhs); return lhs; } From 6141489b003be8136d0900479b44fb0732998ff8 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Sun, 24 Nov 2024 07:25:36 -0800 Subject: [PATCH 074/194] Fixes casting warnings with RGFW platform. (#4534) --- src/platforms/rcore_desktop_rgfw.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 1d3ddf60f..913223511 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -587,7 +587,7 @@ Vector2 GetMonitorPosition(int monitor) { RGFW_monitor *mons = RGFW_getMonitors(); - return (Vector2){mons[monitor].rect.x, mons[monitor].rect.y}; + return (Vector2){(float)mons[monitor].rect.x, (float)mons[monitor].rect.y}; } // Get selected monitor width (currently used by monitor) @@ -611,7 +611,7 @@ int GetMonitorPhysicalWidth(int monitor) { RGFW_monitor* mons = RGFW_getMonitors(); - return mons[monitor].physW; + return (int)mons[monitor].physW; } // Get selected monitor physical height in millimetres @@ -619,7 +619,7 @@ int GetMonitorPhysicalHeight(int monitor) { RGFW_monitor *mons = RGFW_getMonitors(); - return mons[monitor].physH; + return (int)mons[monitor].physH; } // Get selected monitor refresh rate @@ -640,7 +640,7 @@ const char *GetMonitorName(int monitor) // Get window position XY on monitor Vector2 GetWindowPosition(void) { - return (Vector2){ platform.window->r.x, platform.window->r.y }; + return (Vector2){ (float)platform.window->r.x, (float)platform.window->r.y }; } // Get window scale DPI factor for current monitor @@ -654,7 +654,7 @@ Vector2 GetWindowScaleDPI(void) // Set clipboard text content void SetClipboardText(const char *text) { - RGFW_writeClipboard(text, strlen(text)); + RGFW_writeClipboard(text, (u32)strlen(text)); } // Get clipboard text content @@ -947,7 +947,7 @@ void PollInputEvents(void) case RGFW_quit: CORE.Window.shouldClose = true; break; case RGFW_dnd: // Dropped file { - for (int i = 0; i < event->droppedFilesCount; i++) + for (u32 i = 0; i < event->droppedFilesCount; i++) { if (CORE.Window.dropFileCount == 0) { @@ -1031,7 +1031,7 @@ void PollInputEvents(void) { if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown)) { - CORE.Input.Mouse.currentWheelMove.y = event->scroll; + CORE.Input.Mouse.currentWheelMove.y = (float)event->scroll; break; } @@ -1050,7 +1050,7 @@ void PollInputEvents(void) if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown)) { - CORE.Input.Mouse.currentWheelMove.y = event->scroll; + CORE.Input.Mouse.currentWheelMove.y = (float)event->scroll; break; } From 79188f570bf15791c3abad619933d039448023b1 Mon Sep 17 00:00:00 2001 From: Anthony Carbajal <5776225+CrackedPixel@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:17:22 -0600 Subject: [PATCH 075/194] fixed spacing in sha1 comment (#4540) --- projects/Notepad++/raylib_npp_parser/raylib_to_parse.h | 2 +- src/raylib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 19bf37135..3467e21db 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -190,7 +190,7 @@ RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outpu RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes) -RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) +RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) // Automation events functionality diff --git a/src/raylib.h b/src/raylib.h index e548f6def..56abfa7a5 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1152,7 +1152,7 @@ RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outpu RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes) -RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) +RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) // Automation events functionality From c53dd8a9310ad34f730ea853478dc77c8caff23d Mon Sep 17 00:00:00 2001 From: Leonardo Guilherme de Freitas Date: Wed, 27 Nov 2024 07:39:36 -0300 Subject: [PATCH 076/194] [build][cmake] Improve cmake config file generation (#4541) * Improve cmake config file generation This allows for finding raylib on a non-standard location (eg, not in /usr/lib{,64}) * Only have glfw as private if using internal glfw and not static --- cmake/GlfwImport.cmake | 10 +++- cmake/InstallConfigurations.cmake | 4 +- cmake/LibraryConfigurations.cmake | 4 -- cmake/SetupCmakeConfig.cmake | 23 +++++++++ cmake/raylib-config-version.cmake | 21 -------- cmake/raylib-config.cmake | 80 +------------------------------ src/CMakeLists.txt | 11 ++++- 7 files changed, 43 insertions(+), 110 deletions(-) create mode 100644 cmake/SetupCmakeConfig.cmake delete mode 100644 cmake/raylib-config-version.cmake diff --git a/cmake/GlfwImport.cmake b/cmake/GlfwImport.cmake index 4a5ef8c60..f10257c3d 100644 --- a/cmake/GlfwImport.cmake +++ b/cmake/GlfwImport.cmake @@ -12,12 +12,18 @@ endif() # 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(INTERNAL_GLFW ON CACHE INTERNAL "" FORCE) 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_LIBRARY_TYPE "OBJECT" CACHE STRING "" FORCE) - + + + if (NOT BUILD_SHARED_LIBS) + message(STATUS "Enabling install of GLFW static libs because raylib will be built statically") + set(GLFW_INSTALL ON CACHE BOOL "" FORCE) + endif () add_subdirectory(external/glfw) @@ -25,7 +31,7 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT if (BUILD_SHARED_LIBS) set_property(TARGET glfw PROPERTY C_VISIBILITY_PRESET hidden) endif() - + list(APPEND raylib_sources $) include_directories(BEFORE SYSTEM external/glfw/include) elseif("${PLATFORM}" STREQUAL "DRM") diff --git a/cmake/InstallConfigurations.cmake b/cmake/InstallConfigurations.cmake index 6c606e565..e0f84a152 100644 --- a/cmake/InstallConfigurations.cmake +++ b/cmake/InstallConfigurations.cmake @@ -18,10 +18,8 @@ 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") +include(SetupCmakeConfig) # populates raylib_{FOUND, INCLUDE_DIRS, LIBRARIES, LDFLAGS, DEFINITIONS} include(PopulateConfigVariablesLocally) diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index fb7898306..6206928cb 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -125,7 +125,3 @@ if (NOT GRAPHICS) endif () set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY}) - -if (${PLATFORM} MATCHES "Desktop") - set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw) -endif () diff --git a/cmake/SetupCmakeConfig.cmake b/cmake/SetupCmakeConfig.cmake new file mode 100644 index 000000000..ba0929514 --- /dev/null +++ b/cmake/SetupCmakeConfig.cmake @@ -0,0 +1,23 @@ +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) + +# Setup install of exported targets +install(EXPORT raylib-targets + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/raylib +) + +# Macro to write config +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake" + VERSION ${raylib_VERSION} + COMPATIBILITY SameMajorVersion +) + +# Setup install of version config +install( + FILES + "../cmake/raylib-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake" + DESTINATION + ${CMAKE_INSTALL_LIBDIR}/cmake/raylib +) diff --git a/cmake/raylib-config-version.cmake b/cmake/raylib-config-version.cmake deleted file mode 100644 index 74fd03ccc..000000000 --- a/cmake/raylib-config-version.cmake +++ /dev/null @@ -1,21 +0,0 @@ -set(PACKAGE_VERSION "@PROJECT_VERSION@") - -if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) -endif() -if(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) - set(PACKAGE_VERSION_COMPATIBLE TRUE) -else(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) - -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") - return() -endif() - -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") - math(EXPR installedBits "8 * 8") - set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() diff --git a/cmake/raylib-config.cmake b/cmake/raylib-config.cmake index 700965c95..17fefd81e 100644 --- a/cmake/raylib-config.cmake +++ b/cmake/raylib-config.cmake @@ -1,79 +1 @@ -# - Try to find raylib -# Options: -# raylib_USE_STATIC_LIBS - OFF by default -# raylib_VERBOSE - OFF by default -# Once done, this defines a raylib target that can be passed to -# target_link_libraries as well as following variables: -# -# raylib_FOUND - System has raylib installed -# raylib_INCLUDE_DIRS - The include directories for the raylib header(s) -# raylib_LIBRARIES - The libraries needed to use raylib -# raylib_LDFLAGS - The linker flags needed with raylib -# raylib_DEFINITIONS - Compiler switches required for using raylib - -if (NOT TARGET raylib) - set(XPREFIX PC_RAYLIB) - - find_package(PkgConfig QUIET) - pkg_check_modules(${XPREFIX} QUIET raylib) - - 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() - - find_library(raylib_LIBRARY - NAMES ${RAYLIB_NAMES} - 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 - ) - - mark_as_advanced(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}") - - 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_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() +include("${CMAKE_CURRENT_LIST_DIR}/raylib-targets.cmake") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9735e267f..12cc24347 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -90,7 +90,16 @@ if (BUILD_SHARED_LIBS) set_property(TARGET raylib PROPERTY C_VISIBILITY_PRESET hidden) endif () -target_link_libraries(raylib "${LIBS_PRIVATE}") + +# If building as a static lib *AND* using internal GLFW we +# need to set it up as a PRIVATE import so cmake doesn't complain +# it isn't declared on an install rule +if (INTERNAL_GLFW AND BUILD_SHARED_LIBS) + target_link_libraries(raylib PRIVATE glfw) +endif() + +target_link_libraries(raylib PUBLIC "${LIBS_PRIVATE}") + # Sets some compile time definitions for the pre-processor # If CUSTOMIZE_BUILD option is on you will not use config.h by default From abb3c8e9f7b2ec3b88de5b42140d90d88e1accdc Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 28 Nov 2024 22:44:42 +0100 Subject: [PATCH 077/194] Revert "[build][cmake] Improve cmake config file generation (#4541)" This reverts commit c53dd8a9310ad34f730ea853478dc77c8caff23d. --- cmake/GlfwImport.cmake | 10 +--- cmake/InstallConfigurations.cmake | 4 +- cmake/LibraryConfigurations.cmake | 4 ++ cmake/SetupCmakeConfig.cmake | 23 --------- cmake/raylib-config-version.cmake | 21 ++++++++ cmake/raylib-config.cmake | 80 ++++++++++++++++++++++++++++++- src/CMakeLists.txt | 11 +---- 7 files changed, 110 insertions(+), 43 deletions(-) delete mode 100644 cmake/SetupCmakeConfig.cmake create mode 100644 cmake/raylib-config-version.cmake diff --git a/cmake/GlfwImport.cmake b/cmake/GlfwImport.cmake index f10257c3d..4a5ef8c60 100644 --- a/cmake/GlfwImport.cmake +++ b/cmake/GlfwImport.cmake @@ -12,18 +12,12 @@ endif() # 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(INTERNAL_GLFW ON CACHE INTERNAL "" FORCE) 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_LIBRARY_TYPE "OBJECT" CACHE STRING "" FORCE) - - - if (NOT BUILD_SHARED_LIBS) - message(STATUS "Enabling install of GLFW static libs because raylib will be built statically") - set(GLFW_INSTALL ON CACHE BOOL "" FORCE) - endif () + add_subdirectory(external/glfw) @@ -31,7 +25,7 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT if (BUILD_SHARED_LIBS) set_property(TARGET glfw PROPERTY C_VISIBILITY_PRESET hidden) endif() - + list(APPEND raylib_sources $) include_directories(BEFORE SYSTEM external/glfw/include) elseif("${PLATFORM}" STREQUAL "DRM") diff --git a/cmake/InstallConfigurations.cmake b/cmake/InstallConfigurations.cmake index e0f84a152..6c606e565 100644 --- a/cmake/InstallConfigurations.cmake +++ b/cmake/InstallConfigurations.cmake @@ -18,8 +18,10 @@ 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") -include(SetupCmakeConfig) +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) diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index 6206928cb..fb7898306 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -125,3 +125,7 @@ if (NOT GRAPHICS) endif () set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY}) + +if (${PLATFORM} MATCHES "Desktop") + set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw) +endif () diff --git a/cmake/SetupCmakeConfig.cmake b/cmake/SetupCmakeConfig.cmake deleted file mode 100644 index ba0929514..000000000 --- a/cmake/SetupCmakeConfig.cmake +++ /dev/null @@ -1,23 +0,0 @@ -include(CMakePackageConfigHelpers) -include(GNUInstallDirs) - -# Setup install of exported targets -install(EXPORT raylib-targets - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/raylib -) - -# Macro to write config -write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake" - VERSION ${raylib_VERSION} - COMPATIBILITY SameMajorVersion -) - -# Setup install of version config -install( - FILES - "../cmake/raylib-config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake" - DESTINATION - ${CMAKE_INSTALL_LIBDIR}/cmake/raylib -) diff --git a/cmake/raylib-config-version.cmake b/cmake/raylib-config-version.cmake new file mode 100644 index 000000000..74fd03ccc --- /dev/null +++ b/cmake/raylib-config-version.cmake @@ -0,0 +1,21 @@ +set(PACKAGE_VERSION "@PROJECT_VERSION@") + +if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) +endif() +if(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) + set(PACKAGE_VERSION_COMPATIBLE TRUE) +else(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/cmake/raylib-config.cmake b/cmake/raylib-config.cmake index 17fefd81e..700965c95 100644 --- a/cmake/raylib-config.cmake +++ b/cmake/raylib-config.cmake @@ -1 +1,79 @@ -include("${CMAKE_CURRENT_LIST_DIR}/raylib-targets.cmake") +# - Try to find raylib +# Options: +# raylib_USE_STATIC_LIBS - OFF by default +# raylib_VERBOSE - OFF by default +# Once done, this defines a raylib target that can be passed to +# target_link_libraries as well as following variables: +# +# raylib_FOUND - System has raylib installed +# raylib_INCLUDE_DIRS - The include directories for the raylib header(s) +# raylib_LIBRARIES - The libraries needed to use raylib +# raylib_LDFLAGS - The linker flags needed with raylib +# raylib_DEFINITIONS - Compiler switches required for using raylib + +if (NOT TARGET raylib) + set(XPREFIX PC_RAYLIB) + + find_package(PkgConfig QUIET) + pkg_check_modules(${XPREFIX} QUIET raylib) + + 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() + + find_library(raylib_LIBRARY + NAMES ${RAYLIB_NAMES} + 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 + ) + + mark_as_advanced(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}") + + 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_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() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 12cc24347..9735e267f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -90,16 +90,7 @@ if (BUILD_SHARED_LIBS) set_property(TARGET raylib PROPERTY C_VISIBILITY_PRESET hidden) endif () - -# If building as a static lib *AND* using internal GLFW we -# need to set it up as a PRIVATE import so cmake doesn't complain -# it isn't declared on an install rule -if (INTERNAL_GLFW AND BUILD_SHARED_LIBS) - target_link_libraries(raylib PRIVATE glfw) -endif() - -target_link_libraries(raylib PUBLIC "${LIBS_PRIVATE}") - +target_link_libraries(raylib "${LIBS_PRIVATE}") # Sets some compile time definitions for the pre-processor # If CUSTOMIZE_BUILD option is on you will not use config.h by default From 623c4376cc91b922c6b6907326c3dad2207d7922 Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Thu, 28 Nov 2024 22:46:04 +0100 Subject: [PATCH 078/194] The Jaylib binding is at 5.5 (#4546) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 919bc51ca..63e65855a 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -35,7 +35,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-hx](https://github.com/foreignsasquatch/raylib-hx) | 4.2 | [Haxe](https://haxe.org) | Zlib | | [hb-raylib](https://github.com/MarcosLeonardoMendezGerencir/hb-raylib) | 3.5 | [Harbour](https://harbour.github.io) | MIT | | [jaylib](https://github.com/janet-lang/jaylib) | **5.0** | [Janet](https://janet-lang.org) | MIT | -| [jaylib](https://github.com/electronstudio/jaylib/) | 4.5 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | +| [jaylib](https://github.com/electronstudio/jaylib/) | **5.5** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | | [raylib-j](https://github.com/CreedVI/Raylib-J) | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | | [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib | | [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** | From 949c31605bab1f797b78bc0bf26c392fe7714488 Mon Sep 17 00:00:00 2001 From: Tymoteusz Moryto Date: Thu, 28 Nov 2024 22:46:52 +0100 Subject: [PATCH 079/194] CMakeOptions.txt: Added a missing `)` (#4545) --- CMakeOptions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeOptions.txt b/CMakeOptions.txt index b387922b4..00ecb594d 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -24,7 +24,7 @@ enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system G option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" OFF) option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON) -option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF) +option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage)" OFF) set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option") include(ParseConfigHeader) From ba1e14625a98dfd8716eabf3bf83145f18ec1251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Zyba=C5=82a?= Date: Thu, 28 Nov 2024 22:47:39 +0100 Subject: [PATCH 080/194] [build] CMake: Set CMake version to 3.12 (#4547) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 678d8e372..9905ba144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.12) project(raylib) # Avoid excessive expansion of variables in conditionals. In particular, if From 2c4c6e6201000dd60c3727fbc1c3da86e0abd7a1 Mon Sep 17 00:00:00 2001 From: Mossieur-Patate Date: Thu, 28 Nov 2024 22:50:00 +0100 Subject: [PATCH 081/194] GetKeyName prototype (#4544) * Update raylib.h: GeyKeyName prototype Prototype for GetKeyName, which is already implemented elsewhere. * Update raylib_to_parse.h: GetKeyName prototype --- projects/Notepad++/raylib_npp_parser/raylib_to_parse.h | 1 + src/raylib.h | 1 + 2 files changed, 2 insertions(+) diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 3467e21db..2ff4c9cb3 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -216,6 +216,7 @@ RLAPI bool IsKeyUp(int key); // Check if a key RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) +RLAPI const char *GetKeyName(int key); // Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard) // Input-related functions: gamepads RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available diff --git a/src/raylib.h b/src/raylib.h index 56abfa7a5..980e19b6c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1178,6 +1178,7 @@ RLAPI bool IsKeyUp(int key); // Check if a key RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) +RLAPI const char *GetKeyName(int key); // Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard) // Input-related functions: gamepads RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available From 31a1047782765c5d428b5c96499d43248ee3f8b6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 28 Nov 2024 21:50:14 +0000 Subject: [PATCH 082/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 11 + parser/output/raylib_api.lua | 8 + parser/output/raylib_api.txt | 833 +++++++++++++++++----------------- parser/output/raylib_api.xml | 5 +- 4 files changed, 442 insertions(+), 415 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 8561bc343..62ecd1fa9 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -4892,6 +4892,17 @@ } ] }, + { + "name": "GetKeyName", + "description": "Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard)", + "returnType": "const char *", + "params": [ + { + "type": "int", + "name": "key" + } + ] + }, { "name": "IsGamepadAvailable", "description": "Check if a gamepad is available", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 9ff6c1a9c..d62a94a7f 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -4334,6 +4334,14 @@ return { {type = "int", name = "key"} } }, + { + name = "GetKeyName", + description = "Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard)", + returnType = "const char *", + params = { + {type = "int", name = "key"} + } + }, { name = "IsGamepadAvailable", description = "Check if a gamepad is available", diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index e7d04cb46..721304906 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -988,7 +988,7 @@ Callback 006: AudioCallback() (2 input parameters) Param[1]: bufferData (type: void *) Param[2]: frames (type: unsigned int) -Functions found: 581 +Functions found: 582 Function 001: InitWindow() (3 input parameters) Name: InitWindow @@ -1891,62 +1891,67 @@ Function 168: SetExitKey() (1 input parameters) Return type: void Description: Set a custom key to exit program (default is ESC) Param[1]: key (type: int) -Function 169: IsGamepadAvailable() (1 input parameters) +Function 169: GetKeyName() (1 input parameters) + Name: GetKeyName + Return type: const char * + Description: Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard) + Param[1]: key (type: int) +Function 170: IsGamepadAvailable() (1 input parameters) Name: IsGamepadAvailable Return type: bool Description: Check if a gamepad is available Param[1]: gamepad (type: int) -Function 170: GetGamepadName() (1 input parameters) +Function 171: GetGamepadName() (1 input parameters) Name: GetGamepadName Return type: const char * Description: Get gamepad internal name id Param[1]: gamepad (type: int) -Function 171: IsGamepadButtonPressed() (2 input parameters) +Function 172: IsGamepadButtonPressed() (2 input parameters) Name: IsGamepadButtonPressed Return type: bool Description: Check if a gamepad button has been pressed once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 172: IsGamepadButtonDown() (2 input parameters) +Function 173: IsGamepadButtonDown() (2 input parameters) Name: IsGamepadButtonDown Return type: bool Description: Check if a gamepad button is being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 173: IsGamepadButtonReleased() (2 input parameters) +Function 174: IsGamepadButtonReleased() (2 input parameters) Name: IsGamepadButtonReleased Return type: bool Description: Check if a gamepad button has been released once Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 174: IsGamepadButtonUp() (2 input parameters) +Function 175: IsGamepadButtonUp() (2 input parameters) Name: IsGamepadButtonUp Return type: bool Description: Check if a gamepad button is NOT being pressed Param[1]: gamepad (type: int) Param[2]: button (type: int) -Function 175: GetGamepadButtonPressed() (0 input parameters) +Function 176: GetGamepadButtonPressed() (0 input parameters) Name: GetGamepadButtonPressed Return type: int Description: Get the last gamepad button pressed No input parameters -Function 176: GetGamepadAxisCount() (1 input parameters) +Function 177: GetGamepadAxisCount() (1 input parameters) Name: GetGamepadAxisCount Return type: int Description: Get gamepad axis count for a gamepad Param[1]: gamepad (type: int) -Function 177: GetGamepadAxisMovement() (2 input parameters) +Function 178: GetGamepadAxisMovement() (2 input parameters) Name: GetGamepadAxisMovement Return type: float Description: Get axis movement value for a gamepad axis Param[1]: gamepad (type: int) Param[2]: axis (type: int) -Function 178: SetGamepadMappings() (1 input parameters) +Function 179: SetGamepadMappings() (1 input parameters) Name: SetGamepadMappings Return type: int Description: Set internal gamepad mappings (SDL_GameControllerDB) Param[1]: mappings (type: const char *) -Function 179: SetGamepadVibration() (4 input parameters) +Function 180: SetGamepadVibration() (4 input parameters) Name: SetGamepadVibration Return type: void Description: Set gamepad vibration for both motors (duration in seconds) @@ -1954,151 +1959,151 @@ Function 179: SetGamepadVibration() (4 input parameters) Param[2]: leftMotor (type: float) Param[3]: rightMotor (type: float) Param[4]: duration (type: float) -Function 180: IsMouseButtonPressed() (1 input parameters) +Function 181: IsMouseButtonPressed() (1 input parameters) Name: IsMouseButtonPressed Return type: bool Description: Check if a mouse button has been pressed once Param[1]: button (type: int) -Function 181: IsMouseButtonDown() (1 input parameters) +Function 182: IsMouseButtonDown() (1 input parameters) Name: IsMouseButtonDown Return type: bool Description: Check if a mouse button is being pressed Param[1]: button (type: int) -Function 182: IsMouseButtonReleased() (1 input parameters) +Function 183: IsMouseButtonReleased() (1 input parameters) Name: IsMouseButtonReleased Return type: bool Description: Check if a mouse button has been released once Param[1]: button (type: int) -Function 183: IsMouseButtonUp() (1 input parameters) +Function 184: IsMouseButtonUp() (1 input parameters) Name: IsMouseButtonUp Return type: bool Description: Check if a mouse button is NOT being pressed Param[1]: button (type: int) -Function 184: GetMouseX() (0 input parameters) +Function 185: GetMouseX() (0 input parameters) Name: GetMouseX Return type: int Description: Get mouse position X No input parameters -Function 185: GetMouseY() (0 input parameters) +Function 186: GetMouseY() (0 input parameters) Name: GetMouseY Return type: int Description: Get mouse position Y No input parameters -Function 186: GetMousePosition() (0 input parameters) +Function 187: GetMousePosition() (0 input parameters) Name: GetMousePosition Return type: Vector2 Description: Get mouse position XY No input parameters -Function 187: GetMouseDelta() (0 input parameters) +Function 188: GetMouseDelta() (0 input parameters) Name: GetMouseDelta Return type: Vector2 Description: Get mouse delta between frames No input parameters -Function 188: SetMousePosition() (2 input parameters) +Function 189: SetMousePosition() (2 input parameters) Name: SetMousePosition Return type: void Description: Set mouse position XY Param[1]: x (type: int) Param[2]: y (type: int) -Function 189: SetMouseOffset() (2 input parameters) +Function 190: SetMouseOffset() (2 input parameters) Name: SetMouseOffset Return type: void Description: Set mouse offset Param[1]: offsetX (type: int) Param[2]: offsetY (type: int) -Function 190: SetMouseScale() (2 input parameters) +Function 191: SetMouseScale() (2 input parameters) Name: SetMouseScale Return type: void Description: Set mouse scaling Param[1]: scaleX (type: float) Param[2]: scaleY (type: float) -Function 191: GetMouseWheelMove() (0 input parameters) +Function 192: GetMouseWheelMove() (0 input parameters) Name: GetMouseWheelMove Return type: float Description: Get mouse wheel movement for X or Y, whichever is larger No input parameters -Function 192: GetMouseWheelMoveV() (0 input parameters) +Function 193: GetMouseWheelMoveV() (0 input parameters) Name: GetMouseWheelMoveV Return type: Vector2 Description: Get mouse wheel movement for both X and Y No input parameters -Function 193: SetMouseCursor() (1 input parameters) +Function 194: SetMouseCursor() (1 input parameters) Name: SetMouseCursor Return type: void Description: Set mouse cursor Param[1]: cursor (type: int) -Function 194: GetTouchX() (0 input parameters) +Function 195: GetTouchX() (0 input parameters) Name: GetTouchX Return type: int Description: Get touch position X for touch point 0 (relative to screen size) No input parameters -Function 195: GetTouchY() (0 input parameters) +Function 196: GetTouchY() (0 input parameters) Name: GetTouchY Return type: int Description: Get touch position Y for touch point 0 (relative to screen size) No input parameters -Function 196: GetTouchPosition() (1 input parameters) +Function 197: GetTouchPosition() (1 input parameters) Name: GetTouchPosition Return type: Vector2 Description: Get touch position XY for a touch point index (relative to screen size) Param[1]: index (type: int) -Function 197: GetTouchPointId() (1 input parameters) +Function 198: GetTouchPointId() (1 input parameters) Name: GetTouchPointId Return type: int Description: Get touch point identifier for given index Param[1]: index (type: int) -Function 198: GetTouchPointCount() (0 input parameters) +Function 199: GetTouchPointCount() (0 input parameters) Name: GetTouchPointCount Return type: int Description: Get number of touch points No input parameters -Function 199: SetGesturesEnabled() (1 input parameters) +Function 200: SetGesturesEnabled() (1 input parameters) Name: SetGesturesEnabled Return type: void Description: Enable a set of gestures using flags Param[1]: flags (type: unsigned int) -Function 200: IsGestureDetected() (1 input parameters) +Function 201: IsGestureDetected() (1 input parameters) Name: IsGestureDetected Return type: bool Description: Check if a gesture have been detected Param[1]: gesture (type: unsigned int) -Function 201: GetGestureDetected() (0 input parameters) +Function 202: GetGestureDetected() (0 input parameters) Name: GetGestureDetected Return type: int Description: Get latest detected gesture No input parameters -Function 202: GetGestureHoldDuration() (0 input parameters) +Function 203: GetGestureHoldDuration() (0 input parameters) Name: GetGestureHoldDuration Return type: float Description: Get gesture hold time in seconds No input parameters -Function 203: GetGestureDragVector() (0 input parameters) +Function 204: GetGestureDragVector() (0 input parameters) Name: GetGestureDragVector Return type: Vector2 Description: Get gesture drag vector No input parameters -Function 204: GetGestureDragAngle() (0 input parameters) +Function 205: GetGestureDragAngle() (0 input parameters) Name: GetGestureDragAngle Return type: float Description: Get gesture drag angle No input parameters -Function 205: GetGesturePinchVector() (0 input parameters) +Function 206: GetGesturePinchVector() (0 input parameters) Name: GetGesturePinchVector Return type: Vector2 Description: Get gesture pinch delta No input parameters -Function 206: GetGesturePinchAngle() (0 input parameters) +Function 207: GetGesturePinchAngle() (0 input parameters) Name: GetGesturePinchAngle Return type: float Description: Get gesture pinch angle No input parameters -Function 207: UpdateCamera() (2 input parameters) +Function 208: UpdateCamera() (2 input parameters) Name: UpdateCamera Return type: void Description: Update camera position for selected mode Param[1]: camera (type: Camera *) Param[2]: mode (type: int) -Function 208: UpdateCameraPro() (4 input parameters) +Function 209: UpdateCameraPro() (4 input parameters) Name: UpdateCameraPro Return type: void Description: Update camera movement/rotation @@ -2106,36 +2111,36 @@ Function 208: UpdateCameraPro() (4 input parameters) Param[2]: movement (type: Vector3) Param[3]: rotation (type: Vector3) Param[4]: zoom (type: float) -Function 209: SetShapesTexture() (2 input parameters) +Function 210: SetShapesTexture() (2 input parameters) Name: SetShapesTexture Return type: void Description: Set texture and rectangle to be used on shapes drawing Param[1]: texture (type: Texture2D) Param[2]: source (type: Rectangle) -Function 210: GetShapesTexture() (0 input parameters) +Function 211: GetShapesTexture() (0 input parameters) Name: GetShapesTexture Return type: Texture2D Description: Get texture that is used for shapes drawing No input parameters -Function 211: GetShapesTextureRectangle() (0 input parameters) +Function 212: GetShapesTextureRectangle() (0 input parameters) Name: GetShapesTextureRectangle Return type: Rectangle Description: Get texture source rectangle that is used for shapes drawing No input parameters -Function 212: DrawPixel() (3 input parameters) +Function 213: DrawPixel() (3 input parameters) Name: DrawPixel Return type: void Description: Draw a pixel using geometry [Can be slow, use with care] Param[1]: posX (type: int) Param[2]: posY (type: int) Param[3]: color (type: Color) -Function 213: DrawPixelV() (2 input parameters) +Function 214: DrawPixelV() (2 input parameters) Name: DrawPixelV Return type: void Description: Draw a pixel using geometry (Vector version) [Can be slow, use with care] Param[1]: position (type: Vector2) Param[2]: color (type: Color) -Function 214: DrawLine() (5 input parameters) +Function 215: DrawLine() (5 input parameters) Name: DrawLine Return type: void Description: Draw a line @@ -2144,14 +2149,14 @@ Function 214: DrawLine() (5 input parameters) Param[3]: endPosX (type: int) Param[4]: endPosY (type: int) Param[5]: color (type: Color) -Function 215: DrawLineV() (3 input parameters) +Function 216: DrawLineV() (3 input parameters) Name: DrawLineV Return type: void Description: Draw a line (using gl lines) Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: color (type: Color) -Function 216: DrawLineEx() (4 input parameters) +Function 217: DrawLineEx() (4 input parameters) Name: DrawLineEx Return type: void Description: Draw a line (using triangles/quads) @@ -2159,14 +2164,14 @@ Function 216: DrawLineEx() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 217: DrawLineStrip() (3 input parameters) +Function 218: DrawLineStrip() (3 input parameters) Name: DrawLineStrip Return type: void Description: Draw lines sequence (using gl lines) Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 218: DrawLineBezier() (4 input parameters) +Function 219: DrawLineBezier() (4 input parameters) Name: DrawLineBezier Return type: void Description: Draw line segment cubic-bezier in-out interpolation @@ -2174,7 +2179,7 @@ Function 218: DrawLineBezier() (4 input parameters) Param[2]: endPos (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 219: DrawCircle() (4 input parameters) +Function 220: DrawCircle() (4 input parameters) Name: DrawCircle Return type: void Description: Draw a color-filled circle @@ -2182,7 +2187,7 @@ Function 219: DrawCircle() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 220: DrawCircleSector() (6 input parameters) +Function 221: DrawCircleSector() (6 input parameters) Name: DrawCircleSector Return type: void Description: Draw a piece of a circle @@ -2192,7 +2197,7 @@ Function 220: DrawCircleSector() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 221: DrawCircleSectorLines() (6 input parameters) +Function 222: DrawCircleSectorLines() (6 input parameters) Name: DrawCircleSectorLines Return type: void Description: Draw circle sector outline @@ -2202,7 +2207,7 @@ Function 221: DrawCircleSectorLines() (6 input parameters) Param[4]: endAngle (type: float) Param[5]: segments (type: int) Param[6]: color (type: Color) -Function 222: DrawCircleGradient() (5 input parameters) +Function 223: DrawCircleGradient() (5 input parameters) Name: DrawCircleGradient Return type: void Description: Draw a gradient-filled circle @@ -2211,14 +2216,14 @@ Function 222: DrawCircleGradient() (5 input parameters) Param[3]: radius (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 223: DrawCircleV() (3 input parameters) +Function 224: DrawCircleV() (3 input parameters) Name: DrawCircleV Return type: void Description: Draw a color-filled circle (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 224: DrawCircleLines() (4 input parameters) +Function 225: DrawCircleLines() (4 input parameters) Name: DrawCircleLines Return type: void Description: Draw circle outline @@ -2226,14 +2231,14 @@ Function 224: DrawCircleLines() (4 input parameters) Param[2]: centerY (type: int) Param[3]: radius (type: float) Param[4]: color (type: Color) -Function 225: DrawCircleLinesV() (3 input parameters) +Function 226: DrawCircleLinesV() (3 input parameters) Name: DrawCircleLinesV Return type: void Description: Draw circle outline (Vector version) Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 226: DrawEllipse() (5 input parameters) +Function 227: DrawEllipse() (5 input parameters) Name: DrawEllipse Return type: void Description: Draw ellipse @@ -2242,7 +2247,7 @@ Function 226: DrawEllipse() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 227: DrawEllipseLines() (5 input parameters) +Function 228: DrawEllipseLines() (5 input parameters) Name: DrawEllipseLines Return type: void Description: Draw ellipse outline @@ -2251,7 +2256,7 @@ Function 227: DrawEllipseLines() (5 input parameters) Param[3]: radiusH (type: float) Param[4]: radiusV (type: float) Param[5]: color (type: Color) -Function 228: DrawRing() (7 input parameters) +Function 229: DrawRing() (7 input parameters) Name: DrawRing Return type: void Description: Draw ring @@ -2262,7 +2267,7 @@ Function 228: DrawRing() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 229: DrawRingLines() (7 input parameters) +Function 230: DrawRingLines() (7 input parameters) Name: DrawRingLines Return type: void Description: Draw ring outline @@ -2273,7 +2278,7 @@ Function 229: DrawRingLines() (7 input parameters) Param[5]: endAngle (type: float) Param[6]: segments (type: int) Param[7]: color (type: Color) -Function 230: DrawRectangle() (5 input parameters) +Function 231: DrawRectangle() (5 input parameters) Name: DrawRectangle Return type: void Description: Draw a color-filled rectangle @@ -2282,20 +2287,20 @@ Function 230: DrawRectangle() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 231: DrawRectangleV() (3 input parameters) +Function 232: DrawRectangleV() (3 input parameters) Name: DrawRectangleV Return type: void Description: Draw a color-filled rectangle (Vector version) Param[1]: position (type: Vector2) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 232: DrawRectangleRec() (2 input parameters) +Function 233: DrawRectangleRec() (2 input parameters) Name: DrawRectangleRec Return type: void Description: Draw a color-filled rectangle Param[1]: rec (type: Rectangle) Param[2]: color (type: Color) -Function 233: DrawRectanglePro() (4 input parameters) +Function 234: DrawRectanglePro() (4 input parameters) Name: DrawRectanglePro Return type: void Description: Draw a color-filled rectangle with pro parameters @@ -2303,7 +2308,7 @@ Function 233: DrawRectanglePro() (4 input parameters) Param[2]: origin (type: Vector2) Param[3]: rotation (type: float) Param[4]: color (type: Color) -Function 234: DrawRectangleGradientV() (6 input parameters) +Function 235: DrawRectangleGradientV() (6 input parameters) Name: DrawRectangleGradientV Return type: void Description: Draw a vertical-gradient-filled rectangle @@ -2313,7 +2318,7 @@ Function 234: DrawRectangleGradientV() (6 input parameters) Param[4]: height (type: int) Param[5]: top (type: Color) Param[6]: bottom (type: Color) -Function 235: DrawRectangleGradientH() (6 input parameters) +Function 236: DrawRectangleGradientH() (6 input parameters) Name: DrawRectangleGradientH Return type: void Description: Draw a horizontal-gradient-filled rectangle @@ -2323,7 +2328,7 @@ Function 235: DrawRectangleGradientH() (6 input parameters) Param[4]: height (type: int) Param[5]: left (type: Color) Param[6]: right (type: Color) -Function 236: DrawRectangleGradientEx() (5 input parameters) +Function 237: DrawRectangleGradientEx() (5 input parameters) Name: DrawRectangleGradientEx Return type: void Description: Draw a gradient-filled rectangle with custom vertex colors @@ -2332,7 +2337,7 @@ Function 236: DrawRectangleGradientEx() (5 input parameters) Param[3]: bottomLeft (type: Color) Param[4]: topRight (type: Color) Param[5]: bottomRight (type: Color) -Function 237: DrawRectangleLines() (5 input parameters) +Function 238: DrawRectangleLines() (5 input parameters) Name: DrawRectangleLines Return type: void Description: Draw rectangle outline @@ -2341,14 +2346,14 @@ Function 237: DrawRectangleLines() (5 input parameters) Param[3]: width (type: int) Param[4]: height (type: int) Param[5]: color (type: Color) -Function 238: DrawRectangleLinesEx() (3 input parameters) +Function 239: DrawRectangleLinesEx() (3 input parameters) Name: DrawRectangleLinesEx Return type: void Description: Draw rectangle outline with extended parameters Param[1]: rec (type: Rectangle) Param[2]: lineThick (type: float) Param[3]: color (type: Color) -Function 239: DrawRectangleRounded() (4 input parameters) +Function 240: DrawRectangleRounded() (4 input parameters) Name: DrawRectangleRounded Return type: void Description: Draw rectangle with rounded edges @@ -2356,7 +2361,7 @@ Function 239: DrawRectangleRounded() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 240: DrawRectangleRoundedLines() (4 input parameters) +Function 241: DrawRectangleRoundedLines() (4 input parameters) Name: DrawRectangleRoundedLines Return type: void Description: Draw rectangle lines with rounded edges @@ -2364,7 +2369,7 @@ Function 240: DrawRectangleRoundedLines() (4 input parameters) Param[2]: roundness (type: float) Param[3]: segments (type: int) Param[4]: color (type: Color) -Function 241: DrawRectangleRoundedLinesEx() (5 input parameters) +Function 242: DrawRectangleRoundedLinesEx() (5 input parameters) Name: DrawRectangleRoundedLinesEx Return type: void Description: Draw rectangle with rounded edges outline @@ -2373,7 +2378,7 @@ Function 241: DrawRectangleRoundedLinesEx() (5 input parameters) Param[3]: segments (type: int) Param[4]: lineThick (type: float) Param[5]: color (type: Color) -Function 242: DrawTriangle() (4 input parameters) +Function 243: DrawTriangle() (4 input parameters) Name: DrawTriangle Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -2381,7 +2386,7 @@ Function 242: DrawTriangle() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 243: DrawTriangleLines() (4 input parameters) +Function 244: DrawTriangleLines() (4 input parameters) Name: DrawTriangleLines Return type: void Description: Draw triangle outline (vertex in counter-clockwise order!) @@ -2389,21 +2394,21 @@ Function 243: DrawTriangleLines() (4 input parameters) Param[2]: v2 (type: Vector2) Param[3]: v3 (type: Vector2) Param[4]: color (type: Color) -Function 244: DrawTriangleFan() (3 input parameters) +Function 245: DrawTriangleFan() (3 input parameters) Name: DrawTriangleFan Return type: void Description: Draw a triangle fan defined by points (first vertex is the center) Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 245: DrawTriangleStrip() (3 input parameters) +Function 246: DrawTriangleStrip() (3 input parameters) Name: DrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector2 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 246: DrawPoly() (5 input parameters) +Function 247: DrawPoly() (5 input parameters) Name: DrawPoly Return type: void Description: Draw a regular polygon (Vector version) @@ -2412,7 +2417,7 @@ Function 246: DrawPoly() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 247: DrawPolyLines() (5 input parameters) +Function 248: DrawPolyLines() (5 input parameters) Name: DrawPolyLines Return type: void Description: Draw a polygon outline of n sides @@ -2421,7 +2426,7 @@ Function 247: DrawPolyLines() (5 input parameters) Param[3]: radius (type: float) Param[4]: rotation (type: float) Param[5]: color (type: Color) -Function 248: DrawPolyLinesEx() (6 input parameters) +Function 249: DrawPolyLinesEx() (6 input parameters) Name: DrawPolyLinesEx Return type: void Description: Draw a polygon outline of n sides with extended parameters @@ -2431,7 +2436,7 @@ Function 248: DrawPolyLinesEx() (6 input parameters) Param[4]: rotation (type: float) Param[5]: lineThick (type: float) Param[6]: color (type: Color) -Function 249: DrawSplineLinear() (4 input parameters) +Function 250: DrawSplineLinear() (4 input parameters) Name: DrawSplineLinear Return type: void Description: Draw spline: Linear, minimum 2 points @@ -2439,7 +2444,7 @@ Function 249: DrawSplineLinear() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 250: DrawSplineBasis() (4 input parameters) +Function 251: DrawSplineBasis() (4 input parameters) Name: DrawSplineBasis Return type: void Description: Draw spline: B-Spline, minimum 4 points @@ -2447,7 +2452,7 @@ Function 250: DrawSplineBasis() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 251: DrawSplineCatmullRom() (4 input parameters) +Function 252: DrawSplineCatmullRom() (4 input parameters) Name: DrawSplineCatmullRom Return type: void Description: Draw spline: Catmull-Rom, minimum 4 points @@ -2455,7 +2460,7 @@ Function 251: DrawSplineCatmullRom() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 252: DrawSplineBezierQuadratic() (4 input parameters) +Function 253: DrawSplineBezierQuadratic() (4 input parameters) Name: DrawSplineBezierQuadratic Return type: void Description: Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] @@ -2463,7 +2468,7 @@ Function 252: DrawSplineBezierQuadratic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 253: DrawSplineBezierCubic() (4 input parameters) +Function 254: DrawSplineBezierCubic() (4 input parameters) Name: DrawSplineBezierCubic Return type: void Description: Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] @@ -2471,7 +2476,7 @@ Function 253: DrawSplineBezierCubic() (4 input parameters) Param[2]: pointCount (type: int) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 254: DrawSplineSegmentLinear() (4 input parameters) +Function 255: DrawSplineSegmentLinear() (4 input parameters) Name: DrawSplineSegmentLinear Return type: void Description: Draw spline segment: Linear, 2 points @@ -2479,7 +2484,7 @@ Function 254: DrawSplineSegmentLinear() (4 input parameters) Param[2]: p2 (type: Vector2) Param[3]: thick (type: float) Param[4]: color (type: Color) -Function 255: DrawSplineSegmentBasis() (6 input parameters) +Function 256: DrawSplineSegmentBasis() (6 input parameters) Name: DrawSplineSegmentBasis Return type: void Description: Draw spline segment: B-Spline, 4 points @@ -2489,7 +2494,7 @@ Function 255: DrawSplineSegmentBasis() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 256: DrawSplineSegmentCatmullRom() (6 input parameters) +Function 257: DrawSplineSegmentCatmullRom() (6 input parameters) Name: DrawSplineSegmentCatmullRom Return type: void Description: Draw spline segment: Catmull-Rom, 4 points @@ -2499,7 +2504,7 @@ Function 256: DrawSplineSegmentCatmullRom() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 257: DrawSplineSegmentBezierQuadratic() (5 input parameters) +Function 258: DrawSplineSegmentBezierQuadratic() (5 input parameters) Name: DrawSplineSegmentBezierQuadratic Return type: void Description: Draw spline segment: Quadratic Bezier, 2 points, 1 control point @@ -2508,7 +2513,7 @@ Function 257: DrawSplineSegmentBezierQuadratic() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: thick (type: float) Param[5]: color (type: Color) -Function 258: DrawSplineSegmentBezierCubic() (6 input parameters) +Function 259: DrawSplineSegmentBezierCubic() (6 input parameters) Name: DrawSplineSegmentBezierCubic Return type: void Description: Draw spline segment: Cubic Bezier, 2 points, 2 control points @@ -2518,14 +2523,14 @@ Function 258: DrawSplineSegmentBezierCubic() (6 input parameters) Param[4]: p4 (type: Vector2) Param[5]: thick (type: float) Param[6]: color (type: Color) -Function 259: GetSplinePointLinear() (3 input parameters) +Function 260: GetSplinePointLinear() (3 input parameters) Name: GetSplinePointLinear Return type: Vector2 Description: Get (evaluate) spline point: Linear Param[1]: startPos (type: Vector2) Param[2]: endPos (type: Vector2) Param[3]: t (type: float) -Function 260: GetSplinePointBasis() (5 input parameters) +Function 261: GetSplinePointBasis() (5 input parameters) Name: GetSplinePointBasis Return type: Vector2 Description: Get (evaluate) spline point: B-Spline @@ -2534,7 +2539,7 @@ Function 260: GetSplinePointBasis() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 261: GetSplinePointCatmullRom() (5 input parameters) +Function 262: GetSplinePointCatmullRom() (5 input parameters) Name: GetSplinePointCatmullRom Return type: Vector2 Description: Get (evaluate) spline point: Catmull-Rom @@ -2543,7 +2548,7 @@ Function 261: GetSplinePointCatmullRom() (5 input parameters) Param[3]: p3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 262: GetSplinePointBezierQuad() (4 input parameters) +Function 263: GetSplinePointBezierQuad() (4 input parameters) Name: GetSplinePointBezierQuad Return type: Vector2 Description: Get (evaluate) spline point: Quadratic Bezier @@ -2551,7 +2556,7 @@ Function 262: GetSplinePointBezierQuad() (4 input parameters) Param[2]: c2 (type: Vector2) Param[3]: p3 (type: Vector2) Param[4]: t (type: float) -Function 263: GetSplinePointBezierCubic() (5 input parameters) +Function 264: GetSplinePointBezierCubic() (5 input parameters) Name: GetSplinePointBezierCubic Return type: Vector2 Description: Get (evaluate) spline point: Cubic Bezier @@ -2560,13 +2565,13 @@ Function 263: GetSplinePointBezierCubic() (5 input parameters) Param[3]: c3 (type: Vector2) Param[4]: p4 (type: Vector2) Param[5]: t (type: float) -Function 264: CheckCollisionRecs() (2 input parameters) +Function 265: CheckCollisionRecs() (2 input parameters) Name: CheckCollisionRecs Return type: bool Description: Check collision between two rectangles Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 265: CheckCollisionCircles() (4 input parameters) +Function 266: CheckCollisionCircles() (4 input parameters) Name: CheckCollisionCircles Return type: bool Description: Check collision between two circles @@ -2574,14 +2579,14 @@ Function 265: CheckCollisionCircles() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector2) Param[4]: radius2 (type: float) -Function 266: CheckCollisionCircleRec() (3 input parameters) +Function 267: CheckCollisionCircleRec() (3 input parameters) Name: CheckCollisionCircleRec Return type: bool Description: Check collision between circle and rectangle Param[1]: center (type: Vector2) Param[2]: radius (type: float) Param[3]: rec (type: Rectangle) -Function 267: CheckCollisionCircleLine() (4 input parameters) +Function 268: CheckCollisionCircleLine() (4 input parameters) Name: CheckCollisionCircleLine Return type: bool Description: Check if circle collides with a line created betweeen two points [p1] and [p2] @@ -2589,20 +2594,20 @@ Function 267: CheckCollisionCircleLine() (4 input parameters) Param[2]: radius (type: float) Param[3]: p1 (type: Vector2) Param[4]: p2 (type: Vector2) -Function 268: CheckCollisionPointRec() (2 input parameters) +Function 269: CheckCollisionPointRec() (2 input parameters) Name: CheckCollisionPointRec Return type: bool Description: Check if point is inside rectangle Param[1]: point (type: Vector2) Param[2]: rec (type: Rectangle) -Function 269: CheckCollisionPointCircle() (3 input parameters) +Function 270: CheckCollisionPointCircle() (3 input parameters) Name: CheckCollisionPointCircle Return type: bool Description: Check if point is inside circle Param[1]: point (type: Vector2) Param[2]: center (type: Vector2) Param[3]: radius (type: float) -Function 270: CheckCollisionPointTriangle() (4 input parameters) +Function 271: CheckCollisionPointTriangle() (4 input parameters) Name: CheckCollisionPointTriangle Return type: bool Description: Check if point is inside a triangle @@ -2610,7 +2615,7 @@ Function 270: CheckCollisionPointTriangle() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: p3 (type: Vector2) -Function 271: CheckCollisionPointLine() (4 input parameters) +Function 272: CheckCollisionPointLine() (4 input parameters) Name: CheckCollisionPointLine Return type: bool Description: Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] @@ -2618,14 +2623,14 @@ Function 271: CheckCollisionPointLine() (4 input parameters) Param[2]: p1 (type: Vector2) Param[3]: p2 (type: Vector2) Param[4]: threshold (type: int) -Function 272: CheckCollisionPointPoly() (3 input parameters) +Function 273: CheckCollisionPointPoly() (3 input parameters) Name: CheckCollisionPointPoly Return type: bool Description: Check if point is within a polygon described by array of vertices Param[1]: point (type: Vector2) Param[2]: points (type: const Vector2 *) Param[3]: pointCount (type: int) -Function 273: CheckCollisionLines() (5 input parameters) +Function 274: CheckCollisionLines() (5 input parameters) Name: CheckCollisionLines Return type: bool Description: Check the collision between two lines defined by two points each, returns collision point by reference @@ -2634,18 +2639,18 @@ Function 273: CheckCollisionLines() (5 input parameters) Param[3]: startPos2 (type: Vector2) Param[4]: endPos2 (type: Vector2) Param[5]: collisionPoint (type: Vector2 *) -Function 274: GetCollisionRec() (2 input parameters) +Function 275: GetCollisionRec() (2 input parameters) Name: GetCollisionRec Return type: Rectangle Description: Get collision rectangle for two rectangles collision Param[1]: rec1 (type: Rectangle) Param[2]: rec2 (type: Rectangle) -Function 275: LoadImage() (1 input parameters) +Function 276: LoadImage() (1 input parameters) Name: LoadImage Return type: Image Description: Load image from file into CPU memory (RAM) Param[1]: fileName (type: const char *) -Function 276: LoadImageRaw() (5 input parameters) +Function 277: LoadImageRaw() (5 input parameters) Name: LoadImageRaw Return type: Image Description: Load image from RAW file data @@ -2654,13 +2659,13 @@ Function 276: LoadImageRaw() (5 input parameters) Param[3]: height (type: int) Param[4]: format (type: int) Param[5]: headerSize (type: int) -Function 277: LoadImageAnim() (2 input parameters) +Function 278: LoadImageAnim() (2 input parameters) Name: LoadImageAnim Return type: Image Description: Load image sequence from file (frames appended to image.data) Param[1]: fileName (type: const char *) Param[2]: frames (type: int *) -Function 278: LoadImageAnimFromMemory() (4 input parameters) +Function 279: LoadImageAnimFromMemory() (4 input parameters) Name: LoadImageAnimFromMemory Return type: Image Description: Load image sequence from memory buffer @@ -2668,60 +2673,60 @@ Function 278: LoadImageAnimFromMemory() (4 input parameters) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) Param[4]: frames (type: int *) -Function 279: LoadImageFromMemory() (3 input parameters) +Function 280: LoadImageFromMemory() (3 input parameters) Name: LoadImageFromMemory Return type: Image Description: Load image from memory buffer, fileType refers to extension: i.e. '.png' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 280: LoadImageFromTexture() (1 input parameters) +Function 281: LoadImageFromTexture() (1 input parameters) Name: LoadImageFromTexture Return type: Image Description: Load image from GPU texture data Param[1]: texture (type: Texture2D) -Function 281: LoadImageFromScreen() (0 input parameters) +Function 282: LoadImageFromScreen() (0 input parameters) Name: LoadImageFromScreen Return type: Image Description: Load image from screen buffer and (screenshot) No input parameters -Function 282: IsImageValid() (1 input parameters) +Function 283: IsImageValid() (1 input parameters) Name: IsImageValid Return type: bool Description: Check if an image is valid (data and parameters) Param[1]: image (type: Image) -Function 283: UnloadImage() (1 input parameters) +Function 284: UnloadImage() (1 input parameters) Name: UnloadImage Return type: void Description: Unload image from CPU memory (RAM) Param[1]: image (type: Image) -Function 284: ExportImage() (2 input parameters) +Function 285: ExportImage() (2 input parameters) Name: ExportImage Return type: bool Description: Export image data to file, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 285: ExportImageToMemory() (3 input parameters) +Function 286: ExportImageToMemory() (3 input parameters) Name: ExportImageToMemory Return type: unsigned char * Description: Export image to memory buffer Param[1]: image (type: Image) Param[2]: fileType (type: const char *) Param[3]: fileSize (type: int *) -Function 286: ExportImageAsCode() (2 input parameters) +Function 287: ExportImageAsCode() (2 input parameters) Name: ExportImageAsCode Return type: bool Description: Export image as code file defining an array of bytes, returns true on success Param[1]: image (type: Image) Param[2]: fileName (type: const char *) -Function 287: GenImageColor() (3 input parameters) +Function 288: GenImageColor() (3 input parameters) Name: GenImageColor Return type: Image Description: Generate image: plain color Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: color (type: Color) -Function 288: GenImageGradientLinear() (5 input parameters) +Function 289: GenImageGradientLinear() (5 input parameters) Name: GenImageGradientLinear Return type: Image Description: Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient @@ -2730,7 +2735,7 @@ Function 288: GenImageGradientLinear() (5 input parameters) Param[3]: direction (type: int) Param[4]: start (type: Color) Param[5]: end (type: Color) -Function 289: GenImageGradientRadial() (5 input parameters) +Function 290: GenImageGradientRadial() (5 input parameters) Name: GenImageGradientRadial Return type: Image Description: Generate image: radial gradient @@ -2739,7 +2744,7 @@ Function 289: GenImageGradientRadial() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 290: GenImageGradientSquare() (5 input parameters) +Function 291: GenImageGradientSquare() (5 input parameters) Name: GenImageGradientSquare Return type: Image Description: Generate image: square gradient @@ -2748,7 +2753,7 @@ Function 290: GenImageGradientSquare() (5 input parameters) Param[3]: density (type: float) Param[4]: inner (type: Color) Param[5]: outer (type: Color) -Function 291: GenImageChecked() (6 input parameters) +Function 292: GenImageChecked() (6 input parameters) Name: GenImageChecked Return type: Image Description: Generate image: checked @@ -2758,14 +2763,14 @@ Function 291: GenImageChecked() (6 input parameters) Param[4]: checksY (type: int) Param[5]: col1 (type: Color) Param[6]: col2 (type: Color) -Function 292: GenImageWhiteNoise() (3 input parameters) +Function 293: GenImageWhiteNoise() (3 input parameters) Name: GenImageWhiteNoise Return type: Image Description: Generate image: white noise Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: factor (type: float) -Function 293: GenImagePerlinNoise() (5 input parameters) +Function 294: GenImagePerlinNoise() (5 input parameters) Name: GenImagePerlinNoise Return type: Image Description: Generate image: perlin noise @@ -2774,45 +2779,45 @@ Function 293: GenImagePerlinNoise() (5 input parameters) Param[3]: offsetX (type: int) Param[4]: offsetY (type: int) Param[5]: scale (type: float) -Function 294: GenImageCellular() (3 input parameters) +Function 295: GenImageCellular() (3 input parameters) Name: GenImageCellular Return type: Image Description: Generate image: cellular algorithm, bigger tileSize means bigger cells Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: tileSize (type: int) -Function 295: GenImageText() (3 input parameters) +Function 296: GenImageText() (3 input parameters) Name: GenImageText Return type: Image Description: Generate image: grayscale image from text data Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: text (type: const char *) -Function 296: ImageCopy() (1 input parameters) +Function 297: ImageCopy() (1 input parameters) Name: ImageCopy Return type: Image Description: Create an image duplicate (useful for transformations) Param[1]: image (type: Image) -Function 297: ImageFromImage() (2 input parameters) +Function 298: ImageFromImage() (2 input parameters) Name: ImageFromImage Return type: Image Description: Create an image from another image piece Param[1]: image (type: Image) Param[2]: rec (type: Rectangle) -Function 298: ImageFromChannel() (2 input parameters) +Function 299: ImageFromChannel() (2 input parameters) Name: ImageFromChannel Return type: Image Description: Create an image from a selected channel of another image (GRAYSCALE) Param[1]: image (type: Image) Param[2]: selectedChannel (type: int) -Function 299: ImageText() (3 input parameters) +Function 300: ImageText() (3 input parameters) Name: ImageText Return type: Image Description: Create an image from text (default font) Param[1]: text (type: const char *) Param[2]: fontSize (type: int) Param[3]: color (type: Color) -Function 300: ImageTextEx() (5 input parameters) +Function 301: ImageTextEx() (5 input parameters) Name: ImageTextEx Return type: Image Description: Create an image from text (custom sprite font) @@ -2821,76 +2826,76 @@ Function 300: ImageTextEx() (5 input parameters) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) Param[5]: tint (type: Color) -Function 301: ImageFormat() (2 input parameters) +Function 302: ImageFormat() (2 input parameters) Name: ImageFormat Return type: void Description: Convert image data to desired format Param[1]: image (type: Image *) Param[2]: newFormat (type: int) -Function 302: ImageToPOT() (2 input parameters) +Function 303: ImageToPOT() (2 input parameters) Name: ImageToPOT Return type: void Description: Convert image to POT (power-of-two) Param[1]: image (type: Image *) Param[2]: fill (type: Color) -Function 303: ImageCrop() (2 input parameters) +Function 304: ImageCrop() (2 input parameters) Name: ImageCrop Return type: void Description: Crop an image to a defined rectangle Param[1]: image (type: Image *) Param[2]: crop (type: Rectangle) -Function 304: ImageAlphaCrop() (2 input parameters) +Function 305: ImageAlphaCrop() (2 input parameters) Name: ImageAlphaCrop Return type: void Description: Crop image depending on alpha value Param[1]: image (type: Image *) Param[2]: threshold (type: float) -Function 305: ImageAlphaClear() (3 input parameters) +Function 306: ImageAlphaClear() (3 input parameters) Name: ImageAlphaClear Return type: void Description: Clear alpha channel to desired color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: threshold (type: float) -Function 306: ImageAlphaMask() (2 input parameters) +Function 307: ImageAlphaMask() (2 input parameters) Name: ImageAlphaMask Return type: void Description: Apply alpha mask to image Param[1]: image (type: Image *) Param[2]: alphaMask (type: Image) -Function 307: ImageAlphaPremultiply() (1 input parameters) +Function 308: ImageAlphaPremultiply() (1 input parameters) Name: ImageAlphaPremultiply Return type: void Description: Premultiply alpha channel Param[1]: image (type: Image *) -Function 308: ImageBlurGaussian() (2 input parameters) +Function 309: ImageBlurGaussian() (2 input parameters) Name: ImageBlurGaussian Return type: void Description: Apply Gaussian blur using a box blur approximation Param[1]: image (type: Image *) Param[2]: blurSize (type: int) -Function 309: ImageKernelConvolution() (3 input parameters) +Function 310: ImageKernelConvolution() (3 input parameters) Name: ImageKernelConvolution Return type: void Description: Apply custom square convolution kernel to image Param[1]: image (type: Image *) Param[2]: kernel (type: const float *) Param[3]: kernelSize (type: int) -Function 310: ImageResize() (3 input parameters) +Function 311: ImageResize() (3 input parameters) Name: ImageResize Return type: void Description: Resize image (Bicubic scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 311: ImageResizeNN() (3 input parameters) +Function 312: ImageResizeNN() (3 input parameters) Name: ImageResizeNN Return type: void Description: Resize image (Nearest-Neighbor scaling algorithm) Param[1]: image (type: Image *) Param[2]: newWidth (type: int) Param[3]: newHeight (type: int) -Function 312: ImageResizeCanvas() (6 input parameters) +Function 313: ImageResizeCanvas() (6 input parameters) Name: ImageResizeCanvas Return type: void Description: Resize canvas and fill with color @@ -2900,12 +2905,12 @@ Function 312: ImageResizeCanvas() (6 input parameters) Param[4]: offsetX (type: int) Param[5]: offsetY (type: int) Param[6]: fill (type: Color) -Function 313: ImageMipmaps() (1 input parameters) +Function 314: ImageMipmaps() (1 input parameters) Name: ImageMipmaps Return type: void Description: Compute all mipmap levels for a provided image Param[1]: image (type: Image *) -Function 314: ImageDither() (5 input parameters) +Function 315: ImageDither() (5 input parameters) Name: ImageDither Return type: void Description: Dither image data to 16bpp or lower (Floyd-Steinberg dithering) @@ -2914,109 +2919,109 @@ Function 314: ImageDither() (5 input parameters) Param[3]: gBpp (type: int) Param[4]: bBpp (type: int) Param[5]: aBpp (type: int) -Function 315: ImageFlipVertical() (1 input parameters) +Function 316: ImageFlipVertical() (1 input parameters) Name: ImageFlipVertical Return type: void Description: Flip image vertically Param[1]: image (type: Image *) -Function 316: ImageFlipHorizontal() (1 input parameters) +Function 317: ImageFlipHorizontal() (1 input parameters) Name: ImageFlipHorizontal Return type: void Description: Flip image horizontally Param[1]: image (type: Image *) -Function 317: ImageRotate() (2 input parameters) +Function 318: ImageRotate() (2 input parameters) Name: ImageRotate Return type: void Description: Rotate image by input angle in degrees (-359 to 359) Param[1]: image (type: Image *) Param[2]: degrees (type: int) -Function 318: ImageRotateCW() (1 input parameters) +Function 319: ImageRotateCW() (1 input parameters) Name: ImageRotateCW Return type: void Description: Rotate image clockwise 90deg Param[1]: image (type: Image *) -Function 319: ImageRotateCCW() (1 input parameters) +Function 320: ImageRotateCCW() (1 input parameters) Name: ImageRotateCCW Return type: void Description: Rotate image counter-clockwise 90deg Param[1]: image (type: Image *) -Function 320: ImageColorTint() (2 input parameters) +Function 321: ImageColorTint() (2 input parameters) Name: ImageColorTint Return type: void Description: Modify image color: tint Param[1]: image (type: Image *) Param[2]: color (type: Color) -Function 321: ImageColorInvert() (1 input parameters) +Function 322: ImageColorInvert() (1 input parameters) Name: ImageColorInvert Return type: void Description: Modify image color: invert Param[1]: image (type: Image *) -Function 322: ImageColorGrayscale() (1 input parameters) +Function 323: ImageColorGrayscale() (1 input parameters) Name: ImageColorGrayscale Return type: void Description: Modify image color: grayscale Param[1]: image (type: Image *) -Function 323: ImageColorContrast() (2 input parameters) +Function 324: ImageColorContrast() (2 input parameters) Name: ImageColorContrast Return type: void Description: Modify image color: contrast (-100 to 100) Param[1]: image (type: Image *) Param[2]: contrast (type: float) -Function 324: ImageColorBrightness() (2 input parameters) +Function 325: ImageColorBrightness() (2 input parameters) Name: ImageColorBrightness Return type: void Description: Modify image color: brightness (-255 to 255) Param[1]: image (type: Image *) Param[2]: brightness (type: int) -Function 325: ImageColorReplace() (3 input parameters) +Function 326: ImageColorReplace() (3 input parameters) Name: ImageColorReplace Return type: void Description: Modify image color: replace color Param[1]: image (type: Image *) Param[2]: color (type: Color) Param[3]: replace (type: Color) -Function 326: LoadImageColors() (1 input parameters) +Function 327: LoadImageColors() (1 input parameters) Name: LoadImageColors Return type: Color * Description: Load color data from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) -Function 327: LoadImagePalette() (3 input parameters) +Function 328: LoadImagePalette() (3 input parameters) Name: LoadImagePalette Return type: Color * Description: Load colors palette from image as a Color array (RGBA - 32bit) Param[1]: image (type: Image) Param[2]: maxPaletteSize (type: int) Param[3]: colorCount (type: int *) -Function 328: UnloadImageColors() (1 input parameters) +Function 329: UnloadImageColors() (1 input parameters) Name: UnloadImageColors Return type: void Description: Unload color data loaded with LoadImageColors() Param[1]: colors (type: Color *) -Function 329: UnloadImagePalette() (1 input parameters) +Function 330: UnloadImagePalette() (1 input parameters) Name: UnloadImagePalette Return type: void Description: Unload colors palette loaded with LoadImagePalette() Param[1]: colors (type: Color *) -Function 330: GetImageAlphaBorder() (2 input parameters) +Function 331: GetImageAlphaBorder() (2 input parameters) Name: GetImageAlphaBorder Return type: Rectangle Description: Get image alpha border rectangle Param[1]: image (type: Image) Param[2]: threshold (type: float) -Function 331: GetImageColor() (3 input parameters) +Function 332: GetImageColor() (3 input parameters) Name: GetImageColor Return type: Color Description: Get image pixel color at (x, y) position Param[1]: image (type: Image) Param[2]: x (type: int) Param[3]: y (type: int) -Function 332: ImageClearBackground() (2 input parameters) +Function 333: ImageClearBackground() (2 input parameters) Name: ImageClearBackground Return type: void Description: Clear image background with given color Param[1]: dst (type: Image *) Param[2]: color (type: Color) -Function 333: ImageDrawPixel() (4 input parameters) +Function 334: ImageDrawPixel() (4 input parameters) Name: ImageDrawPixel Return type: void Description: Draw pixel within an image @@ -3024,14 +3029,14 @@ Function 333: ImageDrawPixel() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: color (type: Color) -Function 334: ImageDrawPixelV() (3 input parameters) +Function 335: ImageDrawPixelV() (3 input parameters) Name: ImageDrawPixelV Return type: void Description: Draw pixel within an image (Vector version) Param[1]: dst (type: Image *) Param[2]: position (type: Vector2) Param[3]: color (type: Color) -Function 335: ImageDrawLine() (6 input parameters) +Function 336: ImageDrawLine() (6 input parameters) Name: ImageDrawLine Return type: void Description: Draw line within an image @@ -3041,7 +3046,7 @@ Function 335: ImageDrawLine() (6 input parameters) Param[4]: endPosX (type: int) Param[5]: endPosY (type: int) Param[6]: color (type: Color) -Function 336: ImageDrawLineV() (4 input parameters) +Function 337: ImageDrawLineV() (4 input parameters) Name: ImageDrawLineV Return type: void Description: Draw line within an image (Vector version) @@ -3049,7 +3054,7 @@ Function 336: ImageDrawLineV() (4 input parameters) Param[2]: start (type: Vector2) Param[3]: end (type: Vector2) Param[4]: color (type: Color) -Function 337: ImageDrawLineEx() (5 input parameters) +Function 338: ImageDrawLineEx() (5 input parameters) Name: ImageDrawLineEx Return type: void Description: Draw a line defining thickness within an image @@ -3058,7 +3063,7 @@ Function 337: ImageDrawLineEx() (5 input parameters) Param[3]: end (type: Vector2) Param[4]: thick (type: int) Param[5]: color (type: Color) -Function 338: ImageDrawCircle() (5 input parameters) +Function 339: ImageDrawCircle() (5 input parameters) Name: ImageDrawCircle Return type: void Description: Draw a filled circle within an image @@ -3067,7 +3072,7 @@ Function 338: ImageDrawCircle() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 339: ImageDrawCircleV() (4 input parameters) +Function 340: ImageDrawCircleV() (4 input parameters) Name: ImageDrawCircleV Return type: void Description: Draw a filled circle within an image (Vector version) @@ -3075,7 +3080,7 @@ Function 339: ImageDrawCircleV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 340: ImageDrawCircleLines() (5 input parameters) +Function 341: ImageDrawCircleLines() (5 input parameters) Name: ImageDrawCircleLines Return type: void Description: Draw circle outline within an image @@ -3084,7 +3089,7 @@ Function 340: ImageDrawCircleLines() (5 input parameters) Param[3]: centerY (type: int) Param[4]: radius (type: int) Param[5]: color (type: Color) -Function 341: ImageDrawCircleLinesV() (4 input parameters) +Function 342: ImageDrawCircleLinesV() (4 input parameters) Name: ImageDrawCircleLinesV Return type: void Description: Draw circle outline within an image (Vector version) @@ -3092,7 +3097,7 @@ Function 341: ImageDrawCircleLinesV() (4 input parameters) Param[2]: center (type: Vector2) Param[3]: radius (type: int) Param[4]: color (type: Color) -Function 342: ImageDrawRectangle() (6 input parameters) +Function 343: ImageDrawRectangle() (6 input parameters) Name: ImageDrawRectangle Return type: void Description: Draw rectangle within an image @@ -3102,7 +3107,7 @@ Function 342: ImageDrawRectangle() (6 input parameters) Param[4]: width (type: int) Param[5]: height (type: int) Param[6]: color (type: Color) -Function 343: ImageDrawRectangleV() (4 input parameters) +Function 344: ImageDrawRectangleV() (4 input parameters) Name: ImageDrawRectangleV Return type: void Description: Draw rectangle within an image (Vector version) @@ -3110,14 +3115,14 @@ Function 343: ImageDrawRectangleV() (4 input parameters) Param[2]: position (type: Vector2) Param[3]: size (type: Vector2) Param[4]: color (type: Color) -Function 344: ImageDrawRectangleRec() (3 input parameters) +Function 345: ImageDrawRectangleRec() (3 input parameters) Name: ImageDrawRectangleRec Return type: void Description: Draw rectangle within an image Param[1]: dst (type: Image *) Param[2]: rec (type: Rectangle) Param[3]: color (type: Color) -Function 345: ImageDrawRectangleLines() (4 input parameters) +Function 346: ImageDrawRectangleLines() (4 input parameters) Name: ImageDrawRectangleLines Return type: void Description: Draw rectangle lines within an image @@ -3125,7 +3130,7 @@ Function 345: ImageDrawRectangleLines() (4 input parameters) Param[2]: rec (type: Rectangle) Param[3]: thick (type: int) Param[4]: color (type: Color) -Function 346: ImageDrawTriangle() (5 input parameters) +Function 347: ImageDrawTriangle() (5 input parameters) Name: ImageDrawTriangle Return type: void Description: Draw triangle within an image @@ -3134,7 +3139,7 @@ Function 346: ImageDrawTriangle() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 347: ImageDrawTriangleEx() (7 input parameters) +Function 348: ImageDrawTriangleEx() (7 input parameters) Name: ImageDrawTriangleEx Return type: void Description: Draw triangle with interpolated colors within an image @@ -3145,7 +3150,7 @@ Function 347: ImageDrawTriangleEx() (7 input parameters) Param[5]: c1 (type: Color) Param[6]: c2 (type: Color) Param[7]: c3 (type: Color) -Function 348: ImageDrawTriangleLines() (5 input parameters) +Function 349: ImageDrawTriangleLines() (5 input parameters) Name: ImageDrawTriangleLines Return type: void Description: Draw triangle outline within an image @@ -3154,7 +3159,7 @@ Function 348: ImageDrawTriangleLines() (5 input parameters) Param[3]: v2 (type: Vector2) Param[4]: v3 (type: Vector2) Param[5]: color (type: Color) -Function 349: ImageDrawTriangleFan() (4 input parameters) +Function 350: ImageDrawTriangleFan() (4 input parameters) Name: ImageDrawTriangleFan Return type: void Description: Draw a triangle fan defined by points within an image (first vertex is the center) @@ -3162,7 +3167,7 @@ Function 349: ImageDrawTriangleFan() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 350: ImageDrawTriangleStrip() (4 input parameters) +Function 351: ImageDrawTriangleStrip() (4 input parameters) Name: ImageDrawTriangleStrip Return type: void Description: Draw a triangle strip defined by points within an image @@ -3170,7 +3175,7 @@ Function 350: ImageDrawTriangleStrip() (4 input parameters) Param[2]: points (type: Vector2 *) Param[3]: pointCount (type: int) Param[4]: color (type: Color) -Function 351: ImageDraw() (5 input parameters) +Function 352: ImageDraw() (5 input parameters) Name: ImageDraw Return type: void Description: Draw a source image within a destination image (tint applied to source) @@ -3179,7 +3184,7 @@ Function 351: ImageDraw() (5 input parameters) Param[3]: srcRec (type: Rectangle) Param[4]: dstRec (type: Rectangle) Param[5]: tint (type: Color) -Function 352: ImageDrawText() (6 input parameters) +Function 353: ImageDrawText() (6 input parameters) Name: ImageDrawText Return type: void Description: Draw text (using default font) within an image (destination) @@ -3189,7 +3194,7 @@ Function 352: ImageDrawText() (6 input parameters) Param[4]: posY (type: int) Param[5]: fontSize (type: int) Param[6]: color (type: Color) -Function 353: ImageDrawTextEx() (7 input parameters) +Function 354: ImageDrawTextEx() (7 input parameters) Name: ImageDrawTextEx Return type: void Description: Draw text (custom sprite font) within an image (destination) @@ -3200,79 +3205,79 @@ Function 353: ImageDrawTextEx() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 354: LoadTexture() (1 input parameters) +Function 355: LoadTexture() (1 input parameters) Name: LoadTexture Return type: Texture2D Description: Load texture from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 355: LoadTextureFromImage() (1 input parameters) +Function 356: LoadTextureFromImage() (1 input parameters) Name: LoadTextureFromImage Return type: Texture2D Description: Load texture from image data Param[1]: image (type: Image) -Function 356: LoadTextureCubemap() (2 input parameters) +Function 357: LoadTextureCubemap() (2 input parameters) Name: LoadTextureCubemap Return type: TextureCubemap Description: Load cubemap from image, multiple image cubemap layouts supported Param[1]: image (type: Image) Param[2]: layout (type: int) -Function 357: LoadRenderTexture() (2 input parameters) +Function 358: LoadRenderTexture() (2 input parameters) Name: LoadRenderTexture Return type: RenderTexture2D Description: Load texture for rendering (framebuffer) Param[1]: width (type: int) Param[2]: height (type: int) -Function 358: IsTextureValid() (1 input parameters) +Function 359: IsTextureValid() (1 input parameters) Name: IsTextureValid Return type: bool Description: Check if a texture is valid (loaded in GPU) Param[1]: texture (type: Texture2D) -Function 359: UnloadTexture() (1 input parameters) +Function 360: UnloadTexture() (1 input parameters) Name: UnloadTexture Return type: void Description: Unload texture from GPU memory (VRAM) Param[1]: texture (type: Texture2D) -Function 360: IsRenderTextureValid() (1 input parameters) +Function 361: IsRenderTextureValid() (1 input parameters) Name: IsRenderTextureValid Return type: bool Description: Check if a render texture is valid (loaded in GPU) Param[1]: target (type: RenderTexture2D) -Function 361: UnloadRenderTexture() (1 input parameters) +Function 362: UnloadRenderTexture() (1 input parameters) Name: UnloadRenderTexture Return type: void Description: Unload render texture from GPU memory (VRAM) Param[1]: target (type: RenderTexture2D) -Function 362: UpdateTexture() (2 input parameters) +Function 363: UpdateTexture() (2 input parameters) Name: UpdateTexture Return type: void Description: Update GPU texture with new data Param[1]: texture (type: Texture2D) Param[2]: pixels (type: const void *) -Function 363: UpdateTextureRec() (3 input parameters) +Function 364: UpdateTextureRec() (3 input parameters) Name: UpdateTextureRec Return type: void Description: Update GPU texture rectangle with new data Param[1]: texture (type: Texture2D) Param[2]: rec (type: Rectangle) Param[3]: pixels (type: const void *) -Function 364: GenTextureMipmaps() (1 input parameters) +Function 365: GenTextureMipmaps() (1 input parameters) Name: GenTextureMipmaps Return type: void Description: Generate GPU mipmaps for a texture Param[1]: texture (type: Texture2D *) -Function 365: SetTextureFilter() (2 input parameters) +Function 366: SetTextureFilter() (2 input parameters) Name: SetTextureFilter Return type: void Description: Set texture scaling filter mode Param[1]: texture (type: Texture2D) Param[2]: filter (type: int) -Function 366: SetTextureWrap() (2 input parameters) +Function 367: SetTextureWrap() (2 input parameters) Name: SetTextureWrap Return type: void Description: Set texture wrapping mode Param[1]: texture (type: Texture2D) Param[2]: wrap (type: int) -Function 367: DrawTexture() (4 input parameters) +Function 368: DrawTexture() (4 input parameters) Name: DrawTexture Return type: void Description: Draw a Texture2D @@ -3280,14 +3285,14 @@ Function 367: DrawTexture() (4 input parameters) Param[2]: posX (type: int) Param[3]: posY (type: int) Param[4]: tint (type: Color) -Function 368: DrawTextureV() (3 input parameters) +Function 369: DrawTextureV() (3 input parameters) Name: DrawTextureV Return type: void Description: Draw a Texture2D with position defined as Vector2 Param[1]: texture (type: Texture2D) Param[2]: position (type: Vector2) Param[3]: tint (type: Color) -Function 369: DrawTextureEx() (5 input parameters) +Function 370: DrawTextureEx() (5 input parameters) Name: DrawTextureEx Return type: void Description: Draw a Texture2D with extended parameters @@ -3296,7 +3301,7 @@ Function 369: DrawTextureEx() (5 input parameters) Param[3]: rotation (type: float) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 370: DrawTextureRec() (4 input parameters) +Function 371: DrawTextureRec() (4 input parameters) Name: DrawTextureRec Return type: void Description: Draw a part of a texture defined by a rectangle @@ -3304,7 +3309,7 @@ Function 370: DrawTextureRec() (4 input parameters) Param[2]: source (type: Rectangle) Param[3]: position (type: Vector2) Param[4]: tint (type: Color) -Function 371: DrawTexturePro() (6 input parameters) +Function 372: DrawTexturePro() (6 input parameters) Name: DrawTexturePro Return type: void Description: Draw a part of a texture defined by a rectangle with 'pro' parameters @@ -3314,7 +3319,7 @@ Function 371: DrawTexturePro() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 372: DrawTextureNPatch() (6 input parameters) +Function 373: DrawTextureNPatch() (6 input parameters) Name: DrawTextureNPatch Return type: void Description: Draws a texture (or part of it) that stretches or shrinks nicely @@ -3324,119 +3329,119 @@ Function 372: DrawTextureNPatch() (6 input parameters) Param[4]: origin (type: Vector2) Param[5]: rotation (type: float) Param[6]: tint (type: Color) -Function 373: ColorIsEqual() (2 input parameters) +Function 374: ColorIsEqual() (2 input parameters) Name: ColorIsEqual Return type: bool Description: Check if two colors are equal Param[1]: col1 (type: Color) Param[2]: col2 (type: Color) -Function 374: Fade() (2 input parameters) +Function 375: Fade() (2 input parameters) Name: Fade Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 375: ColorToInt() (1 input parameters) +Function 376: ColorToInt() (1 input parameters) Name: ColorToInt Return type: int Description: Get hexadecimal value for a Color (0xRRGGBBAA) Param[1]: color (type: Color) -Function 376: ColorNormalize() (1 input parameters) +Function 377: ColorNormalize() (1 input parameters) Name: ColorNormalize Return type: Vector4 Description: Get Color normalized as float [0..1] Param[1]: color (type: Color) -Function 377: ColorFromNormalized() (1 input parameters) +Function 378: ColorFromNormalized() (1 input parameters) Name: ColorFromNormalized Return type: Color Description: Get Color from normalized values [0..1] Param[1]: normalized (type: Vector4) -Function 378: ColorToHSV() (1 input parameters) +Function 379: ColorToHSV() (1 input parameters) Name: ColorToHSV Return type: Vector3 Description: Get HSV values for a Color, hue [0..360], saturation/value [0..1] Param[1]: color (type: Color) -Function 379: ColorFromHSV() (3 input parameters) +Function 380: ColorFromHSV() (3 input parameters) Name: ColorFromHSV Return type: Color Description: Get a Color from HSV values, hue [0..360], saturation/value [0..1] Param[1]: hue (type: float) Param[2]: saturation (type: float) Param[3]: value (type: float) -Function 380: ColorTint() (2 input parameters) +Function 381: ColorTint() (2 input parameters) Name: ColorTint Return type: Color Description: Get color multiplied with another color Param[1]: color (type: Color) Param[2]: tint (type: Color) -Function 381: ColorBrightness() (2 input parameters) +Function 382: ColorBrightness() (2 input parameters) Name: ColorBrightness Return type: Color Description: Get color with brightness correction, brightness factor goes from -1.0f to 1.0f Param[1]: color (type: Color) Param[2]: factor (type: float) -Function 382: ColorContrast() (2 input parameters) +Function 383: ColorContrast() (2 input parameters) Name: ColorContrast Return type: Color Description: Get color with contrast correction, contrast values between -1.0f and 1.0f Param[1]: color (type: Color) Param[2]: contrast (type: float) -Function 383: ColorAlpha() (2 input parameters) +Function 384: ColorAlpha() (2 input parameters) Name: ColorAlpha Return type: Color Description: Get color with alpha applied, alpha goes from 0.0f to 1.0f Param[1]: color (type: Color) Param[2]: alpha (type: float) -Function 384: ColorAlphaBlend() (3 input parameters) +Function 385: ColorAlphaBlend() (3 input parameters) Name: ColorAlphaBlend Return type: Color Description: Get src alpha-blended into dst color with tint Param[1]: dst (type: Color) Param[2]: src (type: Color) Param[3]: tint (type: Color) -Function 385: ColorLerp() (3 input parameters) +Function 386: ColorLerp() (3 input parameters) Name: ColorLerp Return type: Color Description: Get color lerp interpolation between two colors, factor [0.0f..1.0f] Param[1]: color1 (type: Color) Param[2]: color2 (type: Color) Param[3]: factor (type: float) -Function 386: GetColor() (1 input parameters) +Function 387: GetColor() (1 input parameters) Name: GetColor Return type: Color Description: Get Color structure from hexadecimal value Param[1]: hexValue (type: unsigned int) -Function 387: GetPixelColor() (2 input parameters) +Function 388: GetPixelColor() (2 input parameters) Name: GetPixelColor Return type: Color Description: Get Color from a source pixel pointer of certain format Param[1]: srcPtr (type: void *) Param[2]: format (type: int) -Function 388: SetPixelColor() (3 input parameters) +Function 389: SetPixelColor() (3 input parameters) Name: SetPixelColor Return type: void Description: Set color formatted into destination pixel pointer Param[1]: dstPtr (type: void *) Param[2]: color (type: Color) Param[3]: format (type: int) -Function 389: GetPixelDataSize() (3 input parameters) +Function 390: GetPixelDataSize() (3 input parameters) Name: GetPixelDataSize Return type: int Description: Get pixel data size in bytes for certain format Param[1]: width (type: int) Param[2]: height (type: int) Param[3]: format (type: int) -Function 390: GetFontDefault() (0 input parameters) +Function 391: GetFontDefault() (0 input parameters) Name: GetFontDefault Return type: Font Description: Get the default Font No input parameters -Function 391: LoadFont() (1 input parameters) +Function 392: LoadFont() (1 input parameters) Name: LoadFont Return type: Font Description: Load font from file into GPU memory (VRAM) Param[1]: fileName (type: const char *) -Function 392: LoadFontEx() (4 input parameters) +Function 393: LoadFontEx() (4 input parameters) Name: LoadFontEx Return type: Font Description: Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height @@ -3444,14 +3449,14 @@ Function 392: LoadFontEx() (4 input parameters) Param[2]: fontSize (type: int) Param[3]: codepoints (type: int *) Param[4]: codepointCount (type: int) -Function 393: LoadFontFromImage() (3 input parameters) +Function 394: LoadFontFromImage() (3 input parameters) Name: LoadFontFromImage Return type: Font Description: Load font from Image (XNA style) Param[1]: image (type: Image) Param[2]: key (type: Color) Param[3]: firstChar (type: int) -Function 394: LoadFontFromMemory() (6 input parameters) +Function 395: LoadFontFromMemory() (6 input parameters) Name: LoadFontFromMemory Return type: Font Description: Load font from memory buffer, fileType refers to extension: i.e. '.ttf' @@ -3461,12 +3466,12 @@ Function 394: LoadFontFromMemory() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: codepoints (type: int *) Param[6]: codepointCount (type: int) -Function 395: IsFontValid() (1 input parameters) +Function 396: IsFontValid() (1 input parameters) Name: IsFontValid Return type: bool Description: Check if a font is valid (font data loaded, WARNING: GPU texture not checked) Param[1]: font (type: Font) -Function 396: LoadFontData() (6 input parameters) +Function 397: LoadFontData() (6 input parameters) Name: LoadFontData Return type: GlyphInfo * Description: Load font data for further use @@ -3476,7 +3481,7 @@ Function 396: LoadFontData() (6 input parameters) Param[4]: codepoints (type: int *) Param[5]: codepointCount (type: int) Param[6]: type (type: int) -Function 397: GenImageFontAtlas() (6 input parameters) +Function 398: GenImageFontAtlas() (6 input parameters) Name: GenImageFontAtlas Return type: Image Description: Generate image font atlas using chars info @@ -3486,30 +3491,30 @@ Function 397: GenImageFontAtlas() (6 input parameters) Param[4]: fontSize (type: int) Param[5]: padding (type: int) Param[6]: packMethod (type: int) -Function 398: UnloadFontData() (2 input parameters) +Function 399: UnloadFontData() (2 input parameters) Name: UnloadFontData Return type: void Description: Unload font chars info data (RAM) Param[1]: glyphs (type: GlyphInfo *) Param[2]: glyphCount (type: int) -Function 399: UnloadFont() (1 input parameters) +Function 400: UnloadFont() (1 input parameters) Name: UnloadFont Return type: void Description: Unload font from GPU memory (VRAM) Param[1]: font (type: Font) -Function 400: ExportFontAsCode() (2 input parameters) +Function 401: ExportFontAsCode() (2 input parameters) Name: ExportFontAsCode Return type: bool Description: Export font as code file, returns true on success Param[1]: font (type: Font) Param[2]: fileName (type: const char *) -Function 401: DrawFPS() (2 input parameters) +Function 402: DrawFPS() (2 input parameters) Name: DrawFPS Return type: void Description: Draw current FPS Param[1]: posX (type: int) Param[2]: posY (type: int) -Function 402: DrawText() (5 input parameters) +Function 403: DrawText() (5 input parameters) Name: DrawText Return type: void Description: Draw text (using default font) @@ -3518,7 +3523,7 @@ Function 402: DrawText() (5 input parameters) Param[3]: posY (type: int) Param[4]: fontSize (type: int) Param[5]: color (type: Color) -Function 403: DrawTextEx() (6 input parameters) +Function 404: DrawTextEx() (6 input parameters) Name: DrawTextEx Return type: void Description: Draw text using font and additional parameters @@ -3528,7 +3533,7 @@ Function 403: DrawTextEx() (6 input parameters) Param[4]: fontSize (type: float) Param[5]: spacing (type: float) Param[6]: tint (type: Color) -Function 404: DrawTextPro() (8 input parameters) +Function 405: DrawTextPro() (8 input parameters) Name: DrawTextPro Return type: void Description: Draw text using Font and pro parameters (rotation) @@ -3540,7 +3545,7 @@ Function 404: DrawTextPro() (8 input parameters) Param[6]: fontSize (type: float) Param[7]: spacing (type: float) Param[8]: tint (type: Color) -Function 405: DrawTextCodepoint() (5 input parameters) +Function 406: DrawTextCodepoint() (5 input parameters) Name: DrawTextCodepoint Return type: void Description: Draw one character (codepoint) @@ -3549,7 +3554,7 @@ Function 405: DrawTextCodepoint() (5 input parameters) Param[3]: position (type: Vector2) Param[4]: fontSize (type: float) Param[5]: tint (type: Color) -Function 406: DrawTextCodepoints() (7 input parameters) +Function 407: DrawTextCodepoints() (7 input parameters) Name: DrawTextCodepoints Return type: void Description: Draw multiple character (codepoint) @@ -3560,18 +3565,18 @@ Function 406: DrawTextCodepoints() (7 input parameters) Param[5]: fontSize (type: float) Param[6]: spacing (type: float) Param[7]: tint (type: Color) -Function 407: SetTextLineSpacing() (1 input parameters) +Function 408: SetTextLineSpacing() (1 input parameters) Name: SetTextLineSpacing Return type: void Description: Set vertical line spacing when drawing with line-breaks Param[1]: spacing (type: int) -Function 408: MeasureText() (2 input parameters) +Function 409: MeasureText() (2 input parameters) Name: MeasureText Return type: int Description: Measure string width for default font Param[1]: text (type: const char *) Param[2]: fontSize (type: int) -Function 409: MeasureTextEx() (4 input parameters) +Function 410: MeasureTextEx() (4 input parameters) Name: MeasureTextEx Return type: Vector2 Description: Measure string size for Font @@ -3579,195 +3584,195 @@ Function 409: MeasureTextEx() (4 input parameters) Param[2]: text (type: const char *) Param[3]: fontSize (type: float) Param[4]: spacing (type: float) -Function 410: GetGlyphIndex() (2 input parameters) +Function 411: GetGlyphIndex() (2 input parameters) Name: GetGlyphIndex Return type: int Description: Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 411: GetGlyphInfo() (2 input parameters) +Function 412: GetGlyphInfo() (2 input parameters) Name: GetGlyphInfo Return type: GlyphInfo Description: Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 412: GetGlyphAtlasRec() (2 input parameters) +Function 413: GetGlyphAtlasRec() (2 input parameters) Name: GetGlyphAtlasRec Return type: Rectangle Description: Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found Param[1]: font (type: Font) Param[2]: codepoint (type: int) -Function 413: LoadUTF8() (2 input parameters) +Function 414: LoadUTF8() (2 input parameters) Name: LoadUTF8 Return type: char * Description: Load UTF-8 text encoded from codepoints array Param[1]: codepoints (type: const int *) Param[2]: length (type: int) -Function 414: UnloadUTF8() (1 input parameters) +Function 415: UnloadUTF8() (1 input parameters) Name: UnloadUTF8 Return type: void Description: Unload UTF-8 text encoded from codepoints array Param[1]: text (type: char *) -Function 415: LoadCodepoints() (2 input parameters) +Function 416: LoadCodepoints() (2 input parameters) Name: LoadCodepoints Return type: int * Description: Load all codepoints from a UTF-8 text string, codepoints count returned by parameter Param[1]: text (type: const char *) Param[2]: count (type: int *) -Function 416: UnloadCodepoints() (1 input parameters) +Function 417: UnloadCodepoints() (1 input parameters) Name: UnloadCodepoints Return type: void Description: Unload codepoints data from memory Param[1]: codepoints (type: int *) -Function 417: GetCodepointCount() (1 input parameters) +Function 418: GetCodepointCount() (1 input parameters) Name: GetCodepointCount Return type: int Description: Get total number of codepoints in a UTF-8 encoded string Param[1]: text (type: const char *) -Function 418: GetCodepoint() (2 input parameters) +Function 419: GetCodepoint() (2 input parameters) Name: GetCodepoint Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 419: GetCodepointNext() (2 input parameters) +Function 420: GetCodepointNext() (2 input parameters) Name: GetCodepointNext Return type: int Description: Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 420: GetCodepointPrevious() (2 input parameters) +Function 421: GetCodepointPrevious() (2 input parameters) Name: GetCodepointPrevious Return type: int Description: Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure Param[1]: text (type: const char *) Param[2]: codepointSize (type: int *) -Function 421: CodepointToUTF8() (2 input parameters) +Function 422: CodepointToUTF8() (2 input parameters) Name: CodepointToUTF8 Return type: const char * Description: Encode one codepoint into UTF-8 byte array (array length returned as parameter) Param[1]: codepoint (type: int) Param[2]: utf8Size (type: int *) -Function 422: TextCopy() (2 input parameters) +Function 423: TextCopy() (2 input parameters) Name: TextCopy Return type: int Description: Copy one string to another, returns bytes copied Param[1]: dst (type: char *) Param[2]: src (type: const char *) -Function 423: TextIsEqual() (2 input parameters) +Function 424: TextIsEqual() (2 input parameters) Name: TextIsEqual Return type: bool Description: Check if two text string are equal Param[1]: text1 (type: const char *) Param[2]: text2 (type: const char *) -Function 424: TextLength() (1 input parameters) +Function 425: TextLength() (1 input parameters) Name: TextLength Return type: unsigned int Description: Get text length, checks for '\0' ending Param[1]: text (type: const char *) -Function 425: TextFormat() (2 input parameters) +Function 426: TextFormat() (2 input parameters) Name: TextFormat Return type: const char * Description: Text formatting with variables (sprintf() style) Param[1]: text (type: const char *) Param[2]: args (type: ...) -Function 426: TextSubtext() (3 input parameters) +Function 427: TextSubtext() (3 input parameters) Name: TextSubtext Return type: const char * Description: Get a piece of a text string Param[1]: text (type: const char *) Param[2]: position (type: int) Param[3]: length (type: int) -Function 427: TextReplace() (3 input parameters) +Function 428: TextReplace() (3 input parameters) Name: TextReplace Return type: char * Description: Replace text string (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: replace (type: const char *) Param[3]: by (type: const char *) -Function 428: TextInsert() (3 input parameters) +Function 429: TextInsert() (3 input parameters) Name: TextInsert Return type: char * Description: Insert text in a position (WARNING: memory must be freed!) Param[1]: text (type: const char *) Param[2]: insert (type: const char *) Param[3]: position (type: int) -Function 429: TextJoin() (3 input parameters) +Function 430: TextJoin() (3 input parameters) Name: TextJoin Return type: const char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) -Function 430: TextSplit() (3 input parameters) +Function 431: TextSplit() (3 input parameters) Name: TextSplit Return type: const char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) Param[3]: count (type: int *) -Function 431: TextAppend() (3 input parameters) +Function 432: TextAppend() (3 input parameters) Name: TextAppend Return type: void Description: Append text at specific position and move cursor! Param[1]: text (type: char *) Param[2]: append (type: const char *) Param[3]: position (type: int *) -Function 432: TextFindIndex() (2 input parameters) +Function 433: TextFindIndex() (2 input parameters) Name: TextFindIndex Return type: int Description: Find first text occurrence within a string Param[1]: text (type: const char *) Param[2]: find (type: const char *) -Function 433: TextToUpper() (1 input parameters) +Function 434: TextToUpper() (1 input parameters) Name: TextToUpper Return type: const char * Description: Get upper case version of provided string Param[1]: text (type: const char *) -Function 434: TextToLower() (1 input parameters) +Function 435: TextToLower() (1 input parameters) Name: TextToLower Return type: const char * Description: Get lower case version of provided string Param[1]: text (type: const char *) -Function 435: TextToPascal() (1 input parameters) +Function 436: TextToPascal() (1 input parameters) Name: TextToPascal Return type: const char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) -Function 436: TextToSnake() (1 input parameters) +Function 437: TextToSnake() (1 input parameters) Name: TextToSnake Return type: const char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) -Function 437: TextToCamel() (1 input parameters) +Function 438: TextToCamel() (1 input parameters) Name: TextToCamel Return type: const char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) -Function 438: TextToInteger() (1 input parameters) +Function 439: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int Description: Get integer value from text (negative values not supported) Param[1]: text (type: const char *) -Function 439: TextToFloat() (1 input parameters) +Function 440: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float Description: Get float value from text (negative values not supported) Param[1]: text (type: const char *) -Function 440: DrawLine3D() (3 input parameters) +Function 441: DrawLine3D() (3 input parameters) Name: DrawLine3D Return type: void Description: Draw a line in 3D world space Param[1]: startPos (type: Vector3) Param[2]: endPos (type: Vector3) Param[3]: color (type: Color) -Function 441: DrawPoint3D() (2 input parameters) +Function 442: DrawPoint3D() (2 input parameters) Name: DrawPoint3D Return type: void Description: Draw a point in 3D space, actually a small line Param[1]: position (type: Vector3) Param[2]: color (type: Color) -Function 442: DrawCircle3D() (5 input parameters) +Function 443: DrawCircle3D() (5 input parameters) Name: DrawCircle3D Return type: void Description: Draw a circle in 3D world space @@ -3776,7 +3781,7 @@ Function 442: DrawCircle3D() (5 input parameters) Param[3]: rotationAxis (type: Vector3) Param[4]: rotationAngle (type: float) Param[5]: color (type: Color) -Function 443: DrawTriangle3D() (4 input parameters) +Function 444: DrawTriangle3D() (4 input parameters) Name: DrawTriangle3D Return type: void Description: Draw a color-filled triangle (vertex in counter-clockwise order!) @@ -3784,14 +3789,14 @@ Function 443: DrawTriangle3D() (4 input parameters) Param[2]: v2 (type: Vector3) Param[3]: v3 (type: Vector3) Param[4]: color (type: Color) -Function 444: DrawTriangleStrip3D() (3 input parameters) +Function 445: DrawTriangleStrip3D() (3 input parameters) Name: DrawTriangleStrip3D Return type: void Description: Draw a triangle strip defined by points Param[1]: points (type: const Vector3 *) Param[2]: pointCount (type: int) Param[3]: color (type: Color) -Function 445: DrawCube() (5 input parameters) +Function 446: DrawCube() (5 input parameters) Name: DrawCube Return type: void Description: Draw cube @@ -3800,14 +3805,14 @@ Function 445: DrawCube() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 446: DrawCubeV() (3 input parameters) +Function 447: DrawCubeV() (3 input parameters) Name: DrawCubeV Return type: void Description: Draw cube (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 447: DrawCubeWires() (5 input parameters) +Function 448: DrawCubeWires() (5 input parameters) Name: DrawCubeWires Return type: void Description: Draw cube wires @@ -3816,21 +3821,21 @@ Function 447: DrawCubeWires() (5 input parameters) Param[3]: height (type: float) Param[4]: length (type: float) Param[5]: color (type: Color) -Function 448: DrawCubeWiresV() (3 input parameters) +Function 449: DrawCubeWiresV() (3 input parameters) Name: DrawCubeWiresV Return type: void Description: Draw cube wires (Vector version) Param[1]: position (type: Vector3) Param[2]: size (type: Vector3) Param[3]: color (type: Color) -Function 449: DrawSphere() (3 input parameters) +Function 450: DrawSphere() (3 input parameters) Name: DrawSphere Return type: void Description: Draw sphere Param[1]: centerPos (type: Vector3) Param[2]: radius (type: float) Param[3]: color (type: Color) -Function 450: DrawSphereEx() (5 input parameters) +Function 451: DrawSphereEx() (5 input parameters) Name: DrawSphereEx Return type: void Description: Draw sphere with extended parameters @@ -3839,7 +3844,7 @@ Function 450: DrawSphereEx() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 451: DrawSphereWires() (5 input parameters) +Function 452: DrawSphereWires() (5 input parameters) Name: DrawSphereWires Return type: void Description: Draw sphere wires @@ -3848,7 +3853,7 @@ Function 451: DrawSphereWires() (5 input parameters) Param[3]: rings (type: int) Param[4]: slices (type: int) Param[5]: color (type: Color) -Function 452: DrawCylinder() (6 input parameters) +Function 453: DrawCylinder() (6 input parameters) Name: DrawCylinder Return type: void Description: Draw a cylinder/cone @@ -3858,7 +3863,7 @@ Function 452: DrawCylinder() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 453: DrawCylinderEx() (6 input parameters) +Function 454: DrawCylinderEx() (6 input parameters) Name: DrawCylinderEx Return type: void Description: Draw a cylinder with base at startPos and top at endPos @@ -3868,7 +3873,7 @@ Function 453: DrawCylinderEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 454: DrawCylinderWires() (6 input parameters) +Function 455: DrawCylinderWires() (6 input parameters) Name: DrawCylinderWires Return type: void Description: Draw a cylinder/cone wires @@ -3878,7 +3883,7 @@ Function 454: DrawCylinderWires() (6 input parameters) Param[4]: height (type: float) Param[5]: slices (type: int) Param[6]: color (type: Color) -Function 455: DrawCylinderWiresEx() (6 input parameters) +Function 456: DrawCylinderWiresEx() (6 input parameters) Name: DrawCylinderWiresEx Return type: void Description: Draw a cylinder wires with base at startPos and top at endPos @@ -3888,7 +3893,7 @@ Function 455: DrawCylinderWiresEx() (6 input parameters) Param[4]: endRadius (type: float) Param[5]: sides (type: int) Param[6]: color (type: Color) -Function 456: DrawCapsule() (6 input parameters) +Function 457: DrawCapsule() (6 input parameters) Name: DrawCapsule Return type: void Description: Draw a capsule with the center of its sphere caps at startPos and endPos @@ -3898,7 +3903,7 @@ Function 456: DrawCapsule() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 457: DrawCapsuleWires() (6 input parameters) +Function 458: DrawCapsuleWires() (6 input parameters) Name: DrawCapsuleWires Return type: void Description: Draw capsule wireframe with the center of its sphere caps at startPos and endPos @@ -3908,51 +3913,51 @@ Function 457: DrawCapsuleWires() (6 input parameters) Param[4]: slices (type: int) Param[5]: rings (type: int) Param[6]: color (type: Color) -Function 458: DrawPlane() (3 input parameters) +Function 459: DrawPlane() (3 input parameters) Name: DrawPlane Return type: void Description: Draw a plane XZ Param[1]: centerPos (type: Vector3) Param[2]: size (type: Vector2) Param[3]: color (type: Color) -Function 459: DrawRay() (2 input parameters) +Function 460: DrawRay() (2 input parameters) Name: DrawRay Return type: void Description: Draw a ray line Param[1]: ray (type: Ray) Param[2]: color (type: Color) -Function 460: DrawGrid() (2 input parameters) +Function 461: DrawGrid() (2 input parameters) Name: DrawGrid Return type: void Description: Draw a grid (centered at (0, 0, 0)) Param[1]: slices (type: int) Param[2]: spacing (type: float) -Function 461: LoadModel() (1 input parameters) +Function 462: LoadModel() (1 input parameters) Name: LoadModel Return type: Model Description: Load model from files (meshes and materials) Param[1]: fileName (type: const char *) -Function 462: LoadModelFromMesh() (1 input parameters) +Function 463: LoadModelFromMesh() (1 input parameters) Name: LoadModelFromMesh Return type: Model Description: Load model from generated mesh (default material) Param[1]: mesh (type: Mesh) -Function 463: IsModelValid() (1 input parameters) +Function 464: IsModelValid() (1 input parameters) Name: IsModelValid Return type: bool Description: Check if a model is valid (loaded in GPU, VAO/VBOs) Param[1]: model (type: Model) -Function 464: UnloadModel() (1 input parameters) +Function 465: UnloadModel() (1 input parameters) Name: UnloadModel Return type: void Description: Unload model (including meshes) from memory (RAM and/or VRAM) Param[1]: model (type: Model) -Function 465: GetModelBoundingBox() (1 input parameters) +Function 466: GetModelBoundingBox() (1 input parameters) Name: GetModelBoundingBox Return type: BoundingBox Description: Compute model bounding box limits (considers all meshes) Param[1]: model (type: Model) -Function 466: DrawModel() (4 input parameters) +Function 467: DrawModel() (4 input parameters) Name: DrawModel Return type: void Description: Draw a model (with texture if set) @@ -3960,7 +3965,7 @@ Function 466: DrawModel() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 467: DrawModelEx() (6 input parameters) +Function 468: DrawModelEx() (6 input parameters) Name: DrawModelEx Return type: void Description: Draw a model with extended parameters @@ -3970,7 +3975,7 @@ Function 467: DrawModelEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 468: DrawModelWires() (4 input parameters) +Function 469: DrawModelWires() (4 input parameters) Name: DrawModelWires Return type: void Description: Draw a model wires (with texture if set) @@ -3978,7 +3983,7 @@ Function 468: DrawModelWires() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 469: DrawModelWiresEx() (6 input parameters) +Function 470: DrawModelWiresEx() (6 input parameters) Name: DrawModelWiresEx Return type: void Description: Draw a model wires (with texture if set) with extended parameters @@ -3988,7 +3993,7 @@ Function 469: DrawModelWiresEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 470: DrawModelPoints() (4 input parameters) +Function 471: DrawModelPoints() (4 input parameters) Name: DrawModelPoints Return type: void Description: Draw a model as points @@ -3996,7 +4001,7 @@ Function 470: DrawModelPoints() (4 input parameters) Param[2]: position (type: Vector3) Param[3]: scale (type: float) Param[4]: tint (type: Color) -Function 471: DrawModelPointsEx() (6 input parameters) +Function 472: DrawModelPointsEx() (6 input parameters) Name: DrawModelPointsEx Return type: void Description: Draw a model as points with extended parameters @@ -4006,13 +4011,13 @@ Function 471: DrawModelPointsEx() (6 input parameters) Param[4]: rotationAngle (type: float) Param[5]: scale (type: Vector3) Param[6]: tint (type: Color) -Function 472: DrawBoundingBox() (2 input parameters) +Function 473: DrawBoundingBox() (2 input parameters) Name: DrawBoundingBox Return type: void Description: Draw bounding box (wires) Param[1]: box (type: BoundingBox) Param[2]: color (type: Color) -Function 473: DrawBillboard() (5 input parameters) +Function 474: DrawBillboard() (5 input parameters) Name: DrawBillboard Return type: void Description: Draw a billboard texture @@ -4021,7 +4026,7 @@ Function 473: DrawBillboard() (5 input parameters) Param[3]: position (type: Vector3) Param[4]: scale (type: float) Param[5]: tint (type: Color) -Function 474: DrawBillboardRec() (6 input parameters) +Function 475: DrawBillboardRec() (6 input parameters) Name: DrawBillboardRec Return type: void Description: Draw a billboard texture defined by source @@ -4031,7 +4036,7 @@ Function 474: DrawBillboardRec() (6 input parameters) Param[4]: position (type: Vector3) Param[5]: size (type: Vector2) Param[6]: tint (type: Color) -Function 475: DrawBillboardPro() (9 input parameters) +Function 476: DrawBillboardPro() (9 input parameters) Name: DrawBillboardPro Return type: void Description: Draw a billboard texture defined by source and rotation @@ -4044,13 +4049,13 @@ Function 475: DrawBillboardPro() (9 input parameters) Param[7]: origin (type: Vector2) Param[8]: rotation (type: float) Param[9]: tint (type: Color) -Function 476: UploadMesh() (2 input parameters) +Function 477: UploadMesh() (2 input parameters) Name: UploadMesh Return type: void Description: Upload mesh vertex data in GPU and provide VAO/VBO ids Param[1]: mesh (type: Mesh *) Param[2]: dynamic (type: bool) -Function 477: UpdateMeshBuffer() (5 input parameters) +Function 478: UpdateMeshBuffer() (5 input parameters) Name: UpdateMeshBuffer Return type: void Description: Update mesh vertex data in GPU for a specific buffer index @@ -4059,19 +4064,19 @@ Function 477: UpdateMeshBuffer() (5 input parameters) Param[3]: data (type: const void *) Param[4]: dataSize (type: int) Param[5]: offset (type: int) -Function 478: UnloadMesh() (1 input parameters) +Function 479: UnloadMesh() (1 input parameters) Name: UnloadMesh Return type: void Description: Unload mesh data from CPU and GPU Param[1]: mesh (type: Mesh) -Function 479: DrawMesh() (3 input parameters) +Function 480: DrawMesh() (3 input parameters) Name: DrawMesh Return type: void Description: Draw a 3d mesh with material and transform Param[1]: mesh (type: Mesh) Param[2]: material (type: Material) Param[3]: transform (type: Matrix) -Function 480: DrawMeshInstanced() (4 input parameters) +Function 481: DrawMeshInstanced() (4 input parameters) Name: DrawMeshInstanced Return type: void Description: Draw multiple mesh instances with material and different transforms @@ -4079,35 +4084,35 @@ Function 480: DrawMeshInstanced() (4 input parameters) Param[2]: material (type: Material) Param[3]: transforms (type: const Matrix *) Param[4]: instances (type: int) -Function 481: GetMeshBoundingBox() (1 input parameters) +Function 482: GetMeshBoundingBox() (1 input parameters) Name: GetMeshBoundingBox Return type: BoundingBox Description: Compute mesh bounding box limits Param[1]: mesh (type: Mesh) -Function 482: GenMeshTangents() (1 input parameters) +Function 483: GenMeshTangents() (1 input parameters) Name: GenMeshTangents Return type: void Description: Compute mesh tangents Param[1]: mesh (type: Mesh *) -Function 483: ExportMesh() (2 input parameters) +Function 484: ExportMesh() (2 input parameters) Name: ExportMesh Return type: bool Description: Export mesh data to file, returns true on success Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 484: ExportMeshAsCode() (2 input parameters) +Function 485: ExportMeshAsCode() (2 input parameters) Name: ExportMeshAsCode Return type: bool Description: Export mesh as code file (.h) defining multiple arrays of vertex attributes Param[1]: mesh (type: Mesh) Param[2]: fileName (type: const char *) -Function 485: GenMeshPoly() (2 input parameters) +Function 486: GenMeshPoly() (2 input parameters) Name: GenMeshPoly Return type: Mesh Description: Generate polygonal mesh Param[1]: sides (type: int) Param[2]: radius (type: float) -Function 486: GenMeshPlane() (4 input parameters) +Function 487: GenMeshPlane() (4 input parameters) Name: GenMeshPlane Return type: Mesh Description: Generate plane mesh (with subdivisions) @@ -4115,42 +4120,42 @@ Function 486: GenMeshPlane() (4 input parameters) Param[2]: length (type: float) Param[3]: resX (type: int) Param[4]: resZ (type: int) -Function 487: GenMeshCube() (3 input parameters) +Function 488: GenMeshCube() (3 input parameters) Name: GenMeshCube Return type: Mesh Description: Generate cuboid mesh Param[1]: width (type: float) Param[2]: height (type: float) Param[3]: length (type: float) -Function 488: GenMeshSphere() (3 input parameters) +Function 489: GenMeshSphere() (3 input parameters) Name: GenMeshSphere Return type: Mesh Description: Generate sphere mesh (standard sphere) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 489: GenMeshHemiSphere() (3 input parameters) +Function 490: GenMeshHemiSphere() (3 input parameters) Name: GenMeshHemiSphere Return type: Mesh Description: Generate half-sphere mesh (no bottom cap) Param[1]: radius (type: float) Param[2]: rings (type: int) Param[3]: slices (type: int) -Function 490: GenMeshCylinder() (3 input parameters) +Function 491: GenMeshCylinder() (3 input parameters) Name: GenMeshCylinder Return type: Mesh Description: Generate cylinder mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 491: GenMeshCone() (3 input parameters) +Function 492: GenMeshCone() (3 input parameters) Name: GenMeshCone Return type: Mesh Description: Generate cone/pyramid mesh Param[1]: radius (type: float) Param[2]: height (type: float) Param[3]: slices (type: int) -Function 492: GenMeshTorus() (4 input parameters) +Function 493: GenMeshTorus() (4 input parameters) Name: GenMeshTorus Return type: Mesh Description: Generate torus mesh @@ -4158,7 +4163,7 @@ Function 492: GenMeshTorus() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 493: GenMeshKnot() (4 input parameters) +Function 494: GenMeshKnot() (4 input parameters) Name: GenMeshKnot Return type: Mesh Description: Generate trefoil knot mesh @@ -4166,91 +4171,91 @@ Function 493: GenMeshKnot() (4 input parameters) Param[2]: size (type: float) Param[3]: radSeg (type: int) Param[4]: sides (type: int) -Function 494: GenMeshHeightmap() (2 input parameters) +Function 495: GenMeshHeightmap() (2 input parameters) Name: GenMeshHeightmap Return type: Mesh Description: Generate heightmap mesh from image data Param[1]: heightmap (type: Image) Param[2]: size (type: Vector3) -Function 495: GenMeshCubicmap() (2 input parameters) +Function 496: GenMeshCubicmap() (2 input parameters) Name: GenMeshCubicmap Return type: Mesh Description: Generate cubes-based map mesh from image data Param[1]: cubicmap (type: Image) Param[2]: cubeSize (type: Vector3) -Function 496: LoadMaterials() (2 input parameters) +Function 497: LoadMaterials() (2 input parameters) Name: LoadMaterials Return type: Material * Description: Load materials from model file Param[1]: fileName (type: const char *) Param[2]: materialCount (type: int *) -Function 497: LoadMaterialDefault() (0 input parameters) +Function 498: LoadMaterialDefault() (0 input parameters) Name: LoadMaterialDefault Return type: Material Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) No input parameters -Function 498: IsMaterialValid() (1 input parameters) +Function 499: IsMaterialValid() (1 input parameters) Name: IsMaterialValid Return type: bool Description: Check if a material is valid (shader assigned, map textures loaded in GPU) Param[1]: material (type: Material) -Function 499: UnloadMaterial() (1 input parameters) +Function 500: UnloadMaterial() (1 input parameters) Name: UnloadMaterial Return type: void Description: Unload material from GPU memory (VRAM) Param[1]: material (type: Material) -Function 500: SetMaterialTexture() (3 input parameters) +Function 501: SetMaterialTexture() (3 input parameters) Name: SetMaterialTexture Return type: void Description: Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) Param[1]: material (type: Material *) Param[2]: mapType (type: int) Param[3]: texture (type: Texture2D) -Function 501: SetModelMeshMaterial() (3 input parameters) +Function 502: SetModelMeshMaterial() (3 input parameters) Name: SetModelMeshMaterial Return type: void Description: Set material for a mesh Param[1]: model (type: Model *) Param[2]: meshId (type: int) Param[3]: materialId (type: int) -Function 502: LoadModelAnimations() (2 input parameters) +Function 503: LoadModelAnimations() (2 input parameters) Name: LoadModelAnimations Return type: ModelAnimation * Description: Load model animations from file Param[1]: fileName (type: const char *) Param[2]: animCount (type: int *) -Function 503: UpdateModelAnimation() (3 input parameters) +Function 504: UpdateModelAnimation() (3 input parameters) Name: UpdateModelAnimation Return type: void Description: Update model animation pose (CPU) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 504: UpdateModelAnimationBones() (3 input parameters) +Function 505: UpdateModelAnimationBones() (3 input parameters) Name: UpdateModelAnimationBones Return type: void Description: Update model animation mesh bone matrices (GPU skinning) Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) Param[3]: frame (type: int) -Function 505: UnloadModelAnimation() (1 input parameters) +Function 506: UnloadModelAnimation() (1 input parameters) Name: UnloadModelAnimation Return type: void Description: Unload animation data Param[1]: anim (type: ModelAnimation) -Function 506: UnloadModelAnimations() (2 input parameters) +Function 507: UnloadModelAnimations() (2 input parameters) Name: UnloadModelAnimations Return type: void Description: Unload animation array data Param[1]: animations (type: ModelAnimation *) Param[2]: animCount (type: int) -Function 507: IsModelAnimationValid() (2 input parameters) +Function 508: IsModelAnimationValid() (2 input parameters) Name: IsModelAnimationValid Return type: bool Description: Check model animation skeleton match Param[1]: model (type: Model) Param[2]: anim (type: ModelAnimation) -Function 508: CheckCollisionSpheres() (4 input parameters) +Function 509: CheckCollisionSpheres() (4 input parameters) Name: CheckCollisionSpheres Return type: bool Description: Check collision between two spheres @@ -4258,40 +4263,40 @@ Function 508: CheckCollisionSpheres() (4 input parameters) Param[2]: radius1 (type: float) Param[3]: center2 (type: Vector3) Param[4]: radius2 (type: float) -Function 509: CheckCollisionBoxes() (2 input parameters) +Function 510: CheckCollisionBoxes() (2 input parameters) Name: CheckCollisionBoxes Return type: bool Description: Check collision between two bounding boxes Param[1]: box1 (type: BoundingBox) Param[2]: box2 (type: BoundingBox) -Function 510: CheckCollisionBoxSphere() (3 input parameters) +Function 511: CheckCollisionBoxSphere() (3 input parameters) Name: CheckCollisionBoxSphere Return type: bool Description: Check collision between box and sphere Param[1]: box (type: BoundingBox) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 511: GetRayCollisionSphere() (3 input parameters) +Function 512: GetRayCollisionSphere() (3 input parameters) Name: GetRayCollisionSphere Return type: RayCollision Description: Get collision info between ray and sphere Param[1]: ray (type: Ray) Param[2]: center (type: Vector3) Param[3]: radius (type: float) -Function 512: GetRayCollisionBox() (2 input parameters) +Function 513: GetRayCollisionBox() (2 input parameters) Name: GetRayCollisionBox Return type: RayCollision Description: Get collision info between ray and box Param[1]: ray (type: Ray) Param[2]: box (type: BoundingBox) -Function 513: GetRayCollisionMesh() (3 input parameters) +Function 514: GetRayCollisionMesh() (3 input parameters) Name: GetRayCollisionMesh Return type: RayCollision Description: Get collision info between ray and mesh Param[1]: ray (type: Ray) Param[2]: mesh (type: Mesh) Param[3]: transform (type: Matrix) -Function 514: GetRayCollisionTriangle() (4 input parameters) +Function 515: GetRayCollisionTriangle() (4 input parameters) Name: GetRayCollisionTriangle Return type: RayCollision Description: Get collision info between ray and triangle @@ -4299,7 +4304,7 @@ Function 514: GetRayCollisionTriangle() (4 input parameters) Param[2]: p1 (type: Vector3) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) -Function 515: GetRayCollisionQuad() (5 input parameters) +Function 516: GetRayCollisionQuad() (5 input parameters) Name: GetRayCollisionQuad Return type: RayCollision Description: Get collision info between ray and quad @@ -4308,158 +4313,158 @@ Function 515: GetRayCollisionQuad() (5 input parameters) Param[3]: p2 (type: Vector3) Param[4]: p3 (type: Vector3) Param[5]: p4 (type: Vector3) -Function 516: InitAudioDevice() (0 input parameters) +Function 517: InitAudioDevice() (0 input parameters) Name: InitAudioDevice Return type: void Description: Initialize audio device and context No input parameters -Function 517: CloseAudioDevice() (0 input parameters) +Function 518: CloseAudioDevice() (0 input parameters) Name: CloseAudioDevice Return type: void Description: Close the audio device and context No input parameters -Function 518: IsAudioDeviceReady() (0 input parameters) +Function 519: IsAudioDeviceReady() (0 input parameters) Name: IsAudioDeviceReady Return type: bool Description: Check if audio device has been initialized successfully No input parameters -Function 519: SetMasterVolume() (1 input parameters) +Function 520: SetMasterVolume() (1 input parameters) Name: SetMasterVolume Return type: void Description: Set master volume (listener) Param[1]: volume (type: float) -Function 520: GetMasterVolume() (0 input parameters) +Function 521: GetMasterVolume() (0 input parameters) Name: GetMasterVolume Return type: float Description: Get master volume (listener) No input parameters -Function 521: LoadWave() (1 input parameters) +Function 522: LoadWave() (1 input parameters) Name: LoadWave Return type: Wave Description: Load wave data from file Param[1]: fileName (type: const char *) -Function 522: LoadWaveFromMemory() (3 input parameters) +Function 523: LoadWaveFromMemory() (3 input parameters) Name: LoadWaveFromMemory Return type: Wave Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav' Param[1]: fileType (type: const char *) Param[2]: fileData (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 523: IsWaveValid() (1 input parameters) +Function 524: IsWaveValid() (1 input parameters) Name: IsWaveValid Return type: bool Description: Checks if wave data is valid (data loaded and parameters) Param[1]: wave (type: Wave) -Function 524: LoadSound() (1 input parameters) +Function 525: LoadSound() (1 input parameters) Name: LoadSound Return type: Sound Description: Load sound from file Param[1]: fileName (type: const char *) -Function 525: LoadSoundFromWave() (1 input parameters) +Function 526: LoadSoundFromWave() (1 input parameters) Name: LoadSoundFromWave Return type: Sound Description: Load sound from wave data Param[1]: wave (type: Wave) -Function 526: LoadSoundAlias() (1 input parameters) +Function 527: LoadSoundAlias() (1 input parameters) Name: LoadSoundAlias Return type: Sound Description: Create a new sound that shares the same sample data as the source sound, does not own the sound data Param[1]: source (type: Sound) -Function 527: IsSoundValid() (1 input parameters) +Function 528: IsSoundValid() (1 input parameters) Name: IsSoundValid Return type: bool Description: Checks if a sound is valid (data loaded and buffers initialized) Param[1]: sound (type: Sound) -Function 528: UpdateSound() (3 input parameters) +Function 529: UpdateSound() (3 input parameters) Name: UpdateSound Return type: void Description: Update sound buffer with new data Param[1]: sound (type: Sound) Param[2]: data (type: const void *) Param[3]: sampleCount (type: int) -Function 529: UnloadWave() (1 input parameters) +Function 530: UnloadWave() (1 input parameters) Name: UnloadWave Return type: void Description: Unload wave data Param[1]: wave (type: Wave) -Function 530: UnloadSound() (1 input parameters) +Function 531: UnloadSound() (1 input parameters) Name: UnloadSound Return type: void Description: Unload sound Param[1]: sound (type: Sound) -Function 531: UnloadSoundAlias() (1 input parameters) +Function 532: UnloadSoundAlias() (1 input parameters) Name: UnloadSoundAlias Return type: void Description: Unload a sound alias (does not deallocate sample data) Param[1]: alias (type: Sound) -Function 532: ExportWave() (2 input parameters) +Function 533: ExportWave() (2 input parameters) Name: ExportWave Return type: bool Description: Export wave data to file, returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 533: ExportWaveAsCode() (2 input parameters) +Function 534: ExportWaveAsCode() (2 input parameters) Name: ExportWaveAsCode Return type: bool Description: Export wave sample data to code (.h), returns true on success Param[1]: wave (type: Wave) Param[2]: fileName (type: const char *) -Function 534: PlaySound() (1 input parameters) +Function 535: PlaySound() (1 input parameters) Name: PlaySound Return type: void Description: Play a sound Param[1]: sound (type: Sound) -Function 535: StopSound() (1 input parameters) +Function 536: StopSound() (1 input parameters) Name: StopSound Return type: void Description: Stop playing a sound Param[1]: sound (type: Sound) -Function 536: PauseSound() (1 input parameters) +Function 537: PauseSound() (1 input parameters) Name: PauseSound Return type: void Description: Pause a sound Param[1]: sound (type: Sound) -Function 537: ResumeSound() (1 input parameters) +Function 538: ResumeSound() (1 input parameters) Name: ResumeSound Return type: void Description: Resume a paused sound Param[1]: sound (type: Sound) -Function 538: IsSoundPlaying() (1 input parameters) +Function 539: IsSoundPlaying() (1 input parameters) Name: IsSoundPlaying Return type: bool Description: Check if a sound is currently playing Param[1]: sound (type: Sound) -Function 539: SetSoundVolume() (2 input parameters) +Function 540: SetSoundVolume() (2 input parameters) Name: SetSoundVolume Return type: void Description: Set volume for a sound (1.0 is max level) Param[1]: sound (type: Sound) Param[2]: volume (type: float) -Function 540: SetSoundPitch() (2 input parameters) +Function 541: SetSoundPitch() (2 input parameters) Name: SetSoundPitch Return type: void Description: Set pitch for a sound (1.0 is base level) Param[1]: sound (type: Sound) Param[2]: pitch (type: float) -Function 541: SetSoundPan() (2 input parameters) +Function 542: SetSoundPan() (2 input parameters) Name: SetSoundPan Return type: void Description: Set pan for a sound (0.5 is center) Param[1]: sound (type: Sound) Param[2]: pan (type: float) -Function 542: WaveCopy() (1 input parameters) +Function 543: WaveCopy() (1 input parameters) Name: WaveCopy Return type: Wave Description: Copy a wave to a new wave Param[1]: wave (type: Wave) -Function 543: WaveCrop() (3 input parameters) +Function 544: WaveCrop() (3 input parameters) Name: WaveCrop Return type: void Description: Crop a wave to defined frames range Param[1]: wave (type: Wave *) Param[2]: initFrame (type: int) Param[3]: finalFrame (type: int) -Function 544: WaveFormat() (4 input parameters) +Function 545: WaveFormat() (4 input parameters) Name: WaveFormat Return type: void Description: Convert wave data to desired format @@ -4467,203 +4472,203 @@ Function 544: WaveFormat() (4 input parameters) Param[2]: sampleRate (type: int) Param[3]: sampleSize (type: int) Param[4]: channels (type: int) -Function 545: LoadWaveSamples() (1 input parameters) +Function 546: LoadWaveSamples() (1 input parameters) Name: LoadWaveSamples Return type: float * Description: Load samples data from wave as a 32bit float data array Param[1]: wave (type: Wave) -Function 546: UnloadWaveSamples() (1 input parameters) +Function 547: UnloadWaveSamples() (1 input parameters) Name: UnloadWaveSamples Return type: void Description: Unload samples data loaded with LoadWaveSamples() Param[1]: samples (type: float *) -Function 547: LoadMusicStream() (1 input parameters) +Function 548: LoadMusicStream() (1 input parameters) Name: LoadMusicStream Return type: Music Description: Load music stream from file Param[1]: fileName (type: const char *) -Function 548: LoadMusicStreamFromMemory() (3 input parameters) +Function 549: LoadMusicStreamFromMemory() (3 input parameters) Name: LoadMusicStreamFromMemory Return type: Music Description: Load music stream from data Param[1]: fileType (type: const char *) Param[2]: data (type: const unsigned char *) Param[3]: dataSize (type: int) -Function 549: IsMusicValid() (1 input parameters) +Function 550: IsMusicValid() (1 input parameters) Name: IsMusicValid Return type: bool Description: Checks if a music stream is valid (context and buffers initialized) Param[1]: music (type: Music) -Function 550: UnloadMusicStream() (1 input parameters) +Function 551: UnloadMusicStream() (1 input parameters) Name: UnloadMusicStream Return type: void Description: Unload music stream Param[1]: music (type: Music) -Function 551: PlayMusicStream() (1 input parameters) +Function 552: PlayMusicStream() (1 input parameters) Name: PlayMusicStream Return type: void Description: Start music playing Param[1]: music (type: Music) -Function 552: IsMusicStreamPlaying() (1 input parameters) +Function 553: IsMusicStreamPlaying() (1 input parameters) Name: IsMusicStreamPlaying Return type: bool Description: Check if music is playing Param[1]: music (type: Music) -Function 553: UpdateMusicStream() (1 input parameters) +Function 554: UpdateMusicStream() (1 input parameters) Name: UpdateMusicStream Return type: void Description: Updates buffers for music streaming Param[1]: music (type: Music) -Function 554: StopMusicStream() (1 input parameters) +Function 555: StopMusicStream() (1 input parameters) Name: StopMusicStream Return type: void Description: Stop music playing Param[1]: music (type: Music) -Function 555: PauseMusicStream() (1 input parameters) +Function 556: PauseMusicStream() (1 input parameters) Name: PauseMusicStream Return type: void Description: Pause music playing Param[1]: music (type: Music) -Function 556: ResumeMusicStream() (1 input parameters) +Function 557: ResumeMusicStream() (1 input parameters) Name: ResumeMusicStream Return type: void Description: Resume playing paused music Param[1]: music (type: Music) -Function 557: SeekMusicStream() (2 input parameters) +Function 558: SeekMusicStream() (2 input parameters) Name: SeekMusicStream Return type: void Description: Seek music to a position (in seconds) Param[1]: music (type: Music) Param[2]: position (type: float) -Function 558: SetMusicVolume() (2 input parameters) +Function 559: SetMusicVolume() (2 input parameters) Name: SetMusicVolume Return type: void Description: Set volume for music (1.0 is max level) Param[1]: music (type: Music) Param[2]: volume (type: float) -Function 559: SetMusicPitch() (2 input parameters) +Function 560: SetMusicPitch() (2 input parameters) Name: SetMusicPitch Return type: void Description: Set pitch for a music (1.0 is base level) Param[1]: music (type: Music) Param[2]: pitch (type: float) -Function 560: SetMusicPan() (2 input parameters) +Function 561: SetMusicPan() (2 input parameters) Name: SetMusicPan Return type: void Description: Set pan for a music (0.5 is center) Param[1]: music (type: Music) Param[2]: pan (type: float) -Function 561: GetMusicTimeLength() (1 input parameters) +Function 562: GetMusicTimeLength() (1 input parameters) Name: GetMusicTimeLength Return type: float Description: Get music time length (in seconds) Param[1]: music (type: Music) -Function 562: GetMusicTimePlayed() (1 input parameters) +Function 563: GetMusicTimePlayed() (1 input parameters) Name: GetMusicTimePlayed Return type: float Description: Get current music time played (in seconds) Param[1]: music (type: Music) -Function 563: LoadAudioStream() (3 input parameters) +Function 564: LoadAudioStream() (3 input parameters) Name: LoadAudioStream Return type: AudioStream Description: Load audio stream (to stream raw audio pcm data) Param[1]: sampleRate (type: unsigned int) Param[2]: sampleSize (type: unsigned int) Param[3]: channels (type: unsigned int) -Function 564: IsAudioStreamValid() (1 input parameters) +Function 565: IsAudioStreamValid() (1 input parameters) Name: IsAudioStreamValid Return type: bool Description: Checks if an audio stream is valid (buffers initialized) Param[1]: stream (type: AudioStream) -Function 565: UnloadAudioStream() (1 input parameters) +Function 566: UnloadAudioStream() (1 input parameters) Name: UnloadAudioStream Return type: void Description: Unload audio stream and free memory Param[1]: stream (type: AudioStream) -Function 566: UpdateAudioStream() (3 input parameters) +Function 567: UpdateAudioStream() (3 input parameters) Name: UpdateAudioStream Return type: void Description: Update audio stream buffers with data Param[1]: stream (type: AudioStream) Param[2]: data (type: const void *) Param[3]: frameCount (type: int) -Function 567: IsAudioStreamProcessed() (1 input parameters) +Function 568: IsAudioStreamProcessed() (1 input parameters) Name: IsAudioStreamProcessed Return type: bool Description: Check if any audio stream buffers requires refill Param[1]: stream (type: AudioStream) -Function 568: PlayAudioStream() (1 input parameters) +Function 569: PlayAudioStream() (1 input parameters) Name: PlayAudioStream Return type: void Description: Play audio stream Param[1]: stream (type: AudioStream) -Function 569: PauseAudioStream() (1 input parameters) +Function 570: PauseAudioStream() (1 input parameters) Name: PauseAudioStream Return type: void Description: Pause audio stream Param[1]: stream (type: AudioStream) -Function 570: ResumeAudioStream() (1 input parameters) +Function 571: ResumeAudioStream() (1 input parameters) Name: ResumeAudioStream Return type: void Description: Resume audio stream Param[1]: stream (type: AudioStream) -Function 571: IsAudioStreamPlaying() (1 input parameters) +Function 572: IsAudioStreamPlaying() (1 input parameters) Name: IsAudioStreamPlaying Return type: bool Description: Check if audio stream is playing Param[1]: stream (type: AudioStream) -Function 572: StopAudioStream() (1 input parameters) +Function 573: StopAudioStream() (1 input parameters) Name: StopAudioStream Return type: void Description: Stop audio stream Param[1]: stream (type: AudioStream) -Function 573: SetAudioStreamVolume() (2 input parameters) +Function 574: SetAudioStreamVolume() (2 input parameters) Name: SetAudioStreamVolume Return type: void Description: Set volume for audio stream (1.0 is max level) Param[1]: stream (type: AudioStream) Param[2]: volume (type: float) -Function 574: SetAudioStreamPitch() (2 input parameters) +Function 575: SetAudioStreamPitch() (2 input parameters) Name: SetAudioStreamPitch Return type: void Description: Set pitch for audio stream (1.0 is base level) Param[1]: stream (type: AudioStream) Param[2]: pitch (type: float) -Function 575: SetAudioStreamPan() (2 input parameters) +Function 576: SetAudioStreamPan() (2 input parameters) Name: SetAudioStreamPan Return type: void Description: Set pan for audio stream (0.5 is centered) Param[1]: stream (type: AudioStream) Param[2]: pan (type: float) -Function 576: SetAudioStreamBufferSizeDefault() (1 input parameters) +Function 577: SetAudioStreamBufferSizeDefault() (1 input parameters) Name: SetAudioStreamBufferSizeDefault Return type: void Description: Default size for new audio streams Param[1]: size (type: int) -Function 577: SetAudioStreamCallback() (2 input parameters) +Function 578: SetAudioStreamCallback() (2 input parameters) Name: SetAudioStreamCallback Return type: void Description: Audio thread callback to request new data Param[1]: stream (type: AudioStream) Param[2]: callback (type: AudioCallback) -Function 578: AttachAudioStreamProcessor() (2 input parameters) +Function 579: AttachAudioStreamProcessor() (2 input parameters) Name: AttachAudioStreamProcessor Return type: void Description: Attach audio stream processor to stream, receives the samples as 'float' Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 579: DetachAudioStreamProcessor() (2 input parameters) +Function 580: DetachAudioStreamProcessor() (2 input parameters) Name: DetachAudioStreamProcessor Return type: void Description: Detach audio stream processor from stream Param[1]: stream (type: AudioStream) Param[2]: processor (type: AudioCallback) -Function 580: AttachAudioMixedProcessor() (1 input parameters) +Function 581: AttachAudioMixedProcessor() (1 input parameters) Name: AttachAudioMixedProcessor Return type: void Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' Param[1]: processor (type: AudioCallback) -Function 581: DetachAudioMixedProcessor() (1 input parameters) +Function 582: DetachAudioMixedProcessor() (1 input parameters) Name: DetachAudioMixedProcessor Return type: void Description: Detach audio stream processor from the entire audio pipeline diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 6a5cecf5e..fde502831 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -674,7 +674,7 @@ - + @@ -1184,6 +1184,9 @@ + + + From cd16c9ea91f67c82821ecfb480acea247b42a8d5 Mon Sep 17 00:00:00 2001 From: RealDoigt <57451013+RealDoigt@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:50:44 -0500 Subject: [PATCH 083/194] Add the D Object Oriented Raylib wrapper to the list of BINDINGS.md (#4550) * add the D Object Oriented Raylib wrapper to the list of BINDINGS.md * copy pasted correct url I couldn't do it from the web ui for some reason --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index 63e65855a..b9b42233c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -93,6 +93,7 @@ These are utility wrappers for specific languages, they are not required to use | [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.5** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | | [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | | [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT | +| [DOOR](https://github.com/RealDoigt/DOOR) | 4.0 | [D](https://dlang.org) | MIT | ### Older or Unmaintained Language Bindings From 58fe34d9cc2dd1929efb864e5222f25253c4ad89 Mon Sep 17 00:00:00 2001 From: Caleb Heydon Date: Thu, 28 Nov 2024 16:58:35 -0500 Subject: [PATCH 084/194] [raudio] Fixed buffer overflow when loading WAV files (#4539) --- src/raudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raudio.c b/src/raudio.c index 33c0c4e04..7de360fc0 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -801,10 +801,10 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int wave.sampleRate = wav.sampleRate; wave.sampleSize = 16; wave.channels = wav.channels; - wave.data = (short *)RL_MALLOC(wave.frameCount*wave.channels*sizeof(short)); + wave.data = (short *)RL_MALLOC((size_t)wave.frameCount*wave.channels*sizeof(short)); // NOTE: We are forcing conversion to 16bit sample size on reading - drwav_read_pcm_frames_s16(&wav, wav.totalPCMFrameCount, wave.data); + drwav_read_pcm_frames_s16(&wav, wave.frameCount, wave.data); } else TRACELOG(LOG_WARNING, "WAVE: Failed to load WAV data"); From 9d318a6fbfd3cd837228c96d815ab6f28af306e6 Mon Sep 17 00:00:00 2001 From: Mossieur-Patate Date: Sun, 1 Dec 2024 22:35:19 +0100 Subject: [PATCH 085/194] Update CONTRIBUTING.md + FAQ.md: small misprints (#4553) * Update CONTRIBUTING.md: small misprint * Update FAQ.md: small misprint --- CONTRIBUTING.md | 2 +- FAQ.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d70617c13..7d4c8acf1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,7 +54,7 @@ To open new issues for raylib (bug, enhancement, discussion...), just try to fol - If applicable, attach some screenshot of the issue and a .zip file with the code sample and required resources. - On issue description, add a brackets tag about the raylib module that relates to this issue. If don't know which module, just report the issue, I will review it. - - You can check other issues to see how is being done! + - You can check other issues to see how it's being done! ### Sending a Pull-Request diff --git a/FAQ.md b/FAQ.md index d2f9308ac..778e3455d 100644 --- a/FAQ.md +++ b/FAQ.md @@ -90,7 +90,7 @@ I personally consider raylib a graphics library with some high-level features ra ### What does raylib provide that other engines or libraries don't? -I would say "simplicity" and "enjoyment" at a really low level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try. +I would say "simplicity" and "enjoyment" at a really low level of coding but actually it is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try. ### How does raylib compare to Unity/Unreal/Godot? From 645f9e31c91b43c0031d3c89606a6ed733d5c947 Mon Sep 17 00:00:00 2001 From: devdad Date: Sun, 1 Dec 2024 22:37:28 +0100 Subject: [PATCH 086/194] I've created bindings for raylib 5.5 for c3-lang at https://c3-lang.org (#4555) * basic pbr example pbr implementation includes rpbr.h and few shader files header only file, which self contain everything needed for pbr rendering. Few textures and one model of the car which is under free licence which is included inside basic_pbr.c example file currently supported shader versions are 120 and 330 , version 100 has small issue which I have to resolve * Unloading PBRMAterial I forgot unloading PBRMaterial * fix small issue with texOffset assigment. value was Vector4 at first but I found out it would be unclear for and users, so I change to have two Vector2 instead, but forgot to assign offset . * Changed size of textures and file name changed Changed size of textures from 2048x2048 to 1024x1024 and file name changed to shaders_basic_pbr.c , Added the function PBRModel PBRModelLoadFromMesh(Mesh mesh); but GenMeshPlane(2, 2.0, 3, 3) culdn't be used because it crash once GenMeshTangents() is used with that plane mesh * Update to 5.5 version of eexample and fix to work in web set GLSL_VERSION 100 set precision highp float; removed in keyword fix for loop has to use only constant * Update shader_basic_pbr example to work on web changed to GLSL_VERSION 100 update glsl100 shader set float precision to highp removed keyword in change for loop tu use constant value gives an error * Update shader_basic_pbr example to work on web changed to GLSL_VERSION 100 update glsl100 shader set float precision to highp removed keyword in change for loop tu use constant value gives an error * removed rpbr.h removed rpbr.h * Bindings for c3-lang raylib 5.5 and raylib 5.0 I've created raylib 5.5 binding for c3-Lang https://c3-lang.org --- BINDINGS.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index b9b42233c..3c0b0208b 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -9,7 +9,9 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib](https://github.com/raysan5/raylib) | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | | [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT | | [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT | -| [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | +| [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | +| [raylib-c3] (https://github.com/c3lang/vendor/tree/main/libraries/raylib5.c3l) | **5.0** | [C3] (https://c3-lang.org) | MIT | +| [raylib-c3] (https://github.com/c3lang/vendor/tree/main/libraries/raylib55.c3l) | **5.5** | [C3] (https://c3-lang.org) | MIT | | [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | | [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | @@ -22,7 +24,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [ray-cyber](https://github.com/fubark/ray-cyber) | **5.0** | [Cyber](https://cyberscript.dev) | MIT | | [dart-raylib](https://gitlab.com/wolfenrain/dart-raylib) | 4.0 | [Dart](https://dart.dev) | MIT | | [bindbc-raylib3](https://github.com/o3o/bindbc-raylib3) | **5.0** | [D](https://dlang.org) | BSL-1.0 | -| [dray](https://github.com/redthing1/dray) | **5.0** | [D](https://dlang.org) | Apache-2.0 | +| [dray](https://github.com/redthing1/dray) | **5.0** | [D](https://dlang.org) | Apache-2.0 | | [raylib-d](https://github.com/schveiguy/raylib-d) | **5.5** | [D](https://dlang.org) | Zlib | | [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 | | [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 4.5 | [Factor](https://factorcode.org) | BSD | From 6c59dc4a651f47bc1674a0e5d6ac926a1050816d Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 1 Dec 2024 22:39:09 +0100 Subject: [PATCH 087/194] Update BINDINGS.md --- BINDINGS.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index 3c0b0208b..fe2bfc589 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -10,8 +10,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT | | [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT | | [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | -| [raylib-c3] (https://github.com/c3lang/vendor/tree/main/libraries/raylib5.c3l) | **5.0** | [C3] (https://c3-lang.org) | MIT | -| [raylib-c3] (https://github.com/c3lang/vendor/tree/main/libraries/raylib55.c3l) | **5.5** | [C3] (https://c3-lang.org) | MIT | +| [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib55.c3l) | **5.5** | [C3](https://c3-lang.org) | MIT | | [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | | [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | @@ -37,9 +36,9 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-hx](https://github.com/foreignsasquatch/raylib-hx) | 4.2 | [Haxe](https://haxe.org) | Zlib | | [hb-raylib](https://github.com/MarcosLeonardoMendezGerencir/hb-raylib) | 3.5 | [Harbour](https://harbour.github.io) | MIT | | [jaylib](https://github.com/janet-lang/jaylib) | **5.0** | [Janet](https://janet-lang.org) | MIT | -| [jaylib](https://github.com/electronstudio/jaylib/) | **5.5** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | +| [jaylib](https://github.com/electronstudio/jaylib/) | **5.5** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | | [raylib-j](https://github.com/CreedVI/Raylib-J) | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | -| [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib | +| [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib | | [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** | | [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | | [raylib-lua](https://github.com/TSnake41/raylib-lua) | 4.5 | [Lua](http://www.lua.org) | ISC | @@ -95,7 +94,7 @@ These are utility wrappers for specific languages, they are not required to use | [raylib-cpp](https://github.com/robloach/raylib-cpp) | **5.5** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | | [claylib](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | | [rayed-bqn](https://github.com/Brian-ED/rayed-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT | -| [DOOR](https://github.com/RealDoigt/DOOR) | 4.0 | [D](https://dlang.org) | MIT | +| [DOOR](https://github.com/RealDoigt/DOOR) | 4.0 | [D](https://dlang.org) | MIT | ### Older or Unmaintained Language Bindings @@ -155,7 +154,7 @@ These are older raylib bindings that are more than 2 versions old or have not be | [ray.mod](https://github.com/bmx-ng/ray.mod) | 3.0 | [BlitzMax](https://blitzmax.org) | | [raylib-mosaic](https://github.com/pluckyporcupine/raylib-mosaic) | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) | | [raylib-xdpw](https://github.com/vtereshkov/raylib-xdpw) | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) | -| [raylib-carp](https://github.com/sacredbirdman/raylib-carp) | 3.0 | [Carp](https://github.com/carp-lang/Carp) | +| [raylib-carp](https://github.com/sacredbirdman/raylib-carp) | 3.0 | [Carp](https://github.com/carp-lang/Carp) | | [raylib-fb](https://github.com/IchMagBier/raylib-fb) | 3.0 | [FreeBasic](https://www.freebasic.net) | | [raylib-purebasic](https://github.com/D-a-n-i-l-o/raylib-purebasic) | 3.0 | [PureBasic](https://www.purebasic.com) | | [raylib-ats2](https://github.com/mephistopheles-8/raylib-ats2) | 3.0 | [ATS2](http://www.ats-lang.org) | From 698bfc48feca9efb310a85ea2845584da39c66d4 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 1 Dec 2024 22:40:23 +0100 Subject: [PATCH 088/194] Update pbr.fs --- examples/shaders/resources/shaders/glsl100/pbr.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/pbr.fs b/examples/shaders/resources/shaders/glsl100/pbr.fs index 27d496968..cfab71e40 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.fs +++ b/examples/shaders/resources/shaders/glsl100/pbr.fs @@ -1,6 +1,6 @@ #version 100 -precision highp float; +precision highp float; #define MAX_LIGHTS 4 #define LIGHT_DIRECTIONAL 0 @@ -153,4 +153,4 @@ void main() gl_FragColor = vec4(color,1.0); -} \ No newline at end of file +} From f9cf6843564e1ee6c4ceb291cecc416050ecb7a8 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 1 Dec 2024 22:40:46 +0100 Subject: [PATCH 089/194] Update pbr.vs --- examples/shaders/resources/shaders/glsl100/pbr.vs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/pbr.vs b/examples/shaders/resources/shaders/glsl100/pbr.vs index 3fa651f79..87e142e07 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.vs +++ b/examples/shaders/resources/shaders/glsl100/pbr.vs @@ -1,11 +1,11 @@ #version 100 // Input vertex attributes -attribute vec3 vertexPosition; -attribute vec2 vertexTexCoord; -attribute vec3 vertexNormal; -attribute vec3 vertexTangent; -attribute vec4 vertexColor; +attribute vec3 vertexPosition; +attribute vec2 vertexTexCoord; +attribute vec3 vertexNormal; +attribute vec3 vertexTangent; +attribute vec4 vertexColor; // Input uniform values uniform mat4 mvp; @@ -72,4 +72,4 @@ void main() // Calculate final vertex position gl_Position = mvp * vec4(vertexPosition, 1.0); -} \ No newline at end of file +} From 6fbf08cc1fa1a71ec8e0f6d4b3a45190bc47a002 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 1 Dec 2024 22:41:38 +0100 Subject: [PATCH 090/194] Update pbr.fs --- examples/shaders/resources/shaders/glsl100/pbr.fs | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/shaders/resources/shaders/glsl100/pbr.fs b/examples/shaders/resources/shaders/glsl100/pbr.fs index cfab71e40..70e3b4885 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.fs +++ b/examples/shaders/resources/shaders/glsl100/pbr.fs @@ -24,7 +24,6 @@ varying vec3 fragNormal; varying vec4 shadowPos; varying mat3 TBN; - // Input uniform values uniform int numOfLights; uniform sampler2D albedoMap; From 1b4e73cf2f36bd157e6bd81e491e3f14f1eb6405 Mon Sep 17 00:00:00 2001 From: Jonathan Akaba <86944352+mrjonjonjon@users.noreply.github.com> Date: Sun, 1 Dec 2024 13:43:32 -0800 Subject: [PATCH 091/194] Update documentation for Vector2Angle (#4556) --- src/raymath.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 5b5e4c74f..3c8d26147 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -328,8 +328,9 @@ RMAPI float Vector2DistanceSqr(Vector2 v1, Vector2 v2) return result; } -// Calculate angle between two vectors -// NOTE: Angle is calculated from origin point (0, 0) +// Calculate the signed angle from v1 to v2, relative to the origin (0, 0). +// NOTE: In Raylib's 2D coordinate system (positive X right, positive Y down), +// positive angles appear clockwise, and negative angles appear counterclockwise. RMAPI float Vector2Angle(Vector2 v1, Vector2 v2) { float result = 0.0f; From 503cd7ba346de36ec0272442b6bca84f656da8f4 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 1 Dec 2024 22:45:09 +0100 Subject: [PATCH 092/194] Update raymath.h --- src/raymath.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 3c8d26147..caf04a321 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -328,9 +328,9 @@ RMAPI float Vector2DistanceSqr(Vector2 v1, Vector2 v2) return result; } -// Calculate the signed angle from v1 to v2, relative to the origin (0, 0). -// NOTE: In Raylib's 2D coordinate system (positive X right, positive Y down), -// positive angles appear clockwise, and negative angles appear counterclockwise. +// Calculate the signed angle from v1 to v2, relative to the origin (0, 0) +// NOTE: Coordinate system convention: positive X right, positive Y down, +// positive angles appear clockwise, and negative angles appear counterclockwise RMAPI float Vector2Angle(Vector2 v1, Vector2 v2) { float result = 0.0f; From 9047630ae783a482b0d102dac91a4cd3c49c960a Mon Sep 17 00:00:00 2001 From: Caleb Heydon Date: Sun, 1 Dec 2024 16:46:26 -0500 Subject: [PATCH 093/194] [rmodels] Fix null pointer dereference in LoadImageFromCgltfImage (#4557) --- src/rmodels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 05ad8083c..28911ad67 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5110,7 +5110,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat image = LoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri)); } } - else if (cgltfImage->buffer_view->buffer->data != NULL) // Check if image is provided as data buffer + else if (cgltfImage->buffer_view != NULL && cgltfImage->buffer_view->buffer->data != NULL) // Check if image is provided as data buffer { unsigned char *data = RL_MALLOC(cgltfImage->buffer_view->size); int offset = (int)cgltfImage->buffer_view->offset; From 962f1c26ff415edd93540e857fe4ac5669475fc6 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 1 Dec 2024 23:10:59 +0100 Subject: [PATCH 094/194] Review formatting to follow raylib conventions --- src/raudio.c | 17 +++----- src/rcore.c | 3 +- src/rmodels.c | 107 ++++++++++++++++++++++-------------------------- src/rtext.c | 6 +-- src/rtextures.c | 2 +- 5 files changed, 61 insertions(+), 74 deletions(-) diff --git a/src/raudio.c b/src/raudio.c index 7de360fc0..b2627e2dc 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -2461,23 +2461,18 @@ static ma_uint32 ReadAudioBufferFramesInMixingFormat(AudioBuffer *audioBuffer, f float *runningFramesOut = framesOut + (totalOutputFramesProcessed*audioBuffer->converter.channelsOut); - /* At this point we can convert the data to our mixing format. */ + // At this point we can convert the data to our mixing format ma_uint64 inputFramesProcessedThisIteration = ReadAudioBufferFramesInInternalFormat(audioBuffer, inputBuffer, (ma_uint32)inputFramesToProcessThisIteration); /* Safe cast. */ ma_uint64 outputFramesProcessedThisIteration = outputFramesToProcessThisIteration; ma_data_converter_process_pcm_frames(&audioBuffer->converter, inputBuffer, &inputFramesProcessedThisIteration, runningFramesOut, &outputFramesProcessedThisIteration); - totalOutputFramesProcessed += (ma_uint32)outputFramesProcessedThisIteration; /* Safe cast. */ + totalOutputFramesProcessed += (ma_uint32)outputFramesProcessedThisIteration; // Safe cast - if (inputFramesProcessedThisIteration < inputFramesToProcessThisIteration) - { - break; /* Ran out of input data. */ - } + if (inputFramesProcessedThisIteration < inputFramesToProcessThisIteration) break; // Ran out of input data - /* This should never be hit, but will add it here for safety. Ensures we get out of the loop when no input nor output frames are processed. */ - if (inputFramesProcessedThisIteration == 0 && outputFramesProcessedThisIteration == 0) - { - break; - } + // This should never be hit, but added here for safety + // Ensures we get out of the loop when no input nor output frames are processed + if ((inputFramesProcessedThisIteration == 0) && (outputFramesProcessedThisIteration == 0)) break; } return totalOutputFramesProcessed; diff --git a/src/rcore.c b/src/rcore.c index ba23df776..05e02b14f 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -3315,7 +3315,8 @@ float GetGamepadAxisMovement(int gamepad, int axis) { float value = (axis == GAMEPAD_AXIS_LEFT_TRIGGER || axis == GAMEPAD_AXIS_RIGHT_TRIGGER)? -1.0f : 0.0f; - if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (axis < MAX_GAMEPAD_AXIS)) { + if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (axis < MAX_GAMEPAD_AXIS)) + { float movement = value < 0.0f ? CORE.Input.Gamepad.axisState[gamepad][axis] : fabsf(CORE.Input.Gamepad.axisState[gamepad][axis]); if (movement > value) value = CORE.Input.Gamepad.axisState[gamepad][axis]; diff --git a/src/rmodels.c b/src/rmodels.c index 28911ad67..5e6d39664 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4190,39 +4190,36 @@ static void BuildPoseFromParentJoints(BoneInfo *bones, int boneCount, Transform static Model LoadOBJ(const char *fileName) { tinyobj_attrib_t objAttributes = { 0 }; - tinyobj_shape_t* objShapes = NULL; + tinyobj_shape_t *objShapes = NULL; unsigned int objShapeCount = 0; - tinyobj_material_t* objMaterials = NULL; + tinyobj_material_t *objMaterials = NULL; unsigned int objMaterialCount = 0; Model model = { 0 }; model.transform = MatrixIdentity(); - char* fileText = LoadFileText(fileName); + char *fileText = LoadFileText(fileName); if (fileText == NULL) { - TRACELOG(LOG_ERROR, "MODEL Unable to read obj file %s", fileName); + TRACELOG(LOG_ERROR, "MODEL: [%s] Unable to read obj file", fileName); return model; } char currentDir[1024] = { 0 }; strcpy(currentDir, GetWorkingDirectory()); // Save current working directory - const char* workingDir = GetDirectoryPath(fileName); // Switch to OBJ directory for material path correctness - if (CHDIR(workingDir) != 0) - { - TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to change working directory", workingDir); - } + const char *workingDir = GetDirectoryPath(fileName); // Switch to OBJ directory for material path correctness + if (CHDIR(workingDir) != 0) TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to change working directory", workingDir); unsigned int dataSize = (unsigned int)strlen(fileText); - + unsigned int flags = TINYOBJ_FLAG_TRIANGULATE; int ret = tinyobj_parse_obj(&objAttributes, &objShapes, &objShapeCount, &objMaterials, &objMaterialCount, fileText, dataSize, flags); if (ret != TINYOBJ_SUCCESS) { - TRACELOG(LOG_ERROR, "MODEL Unable to read obj data %s", fileName); + TRACELOG(LOG_ERROR, "MODEL: Unable to read obj data %s", fileName); return model; } @@ -4233,52 +4230,51 @@ static Model LoadOBJ(const char *fileName) int lastMaterial = -1; unsigned int meshIndex = 0; - // count meshes + // Count meshes unsigned int nextShapeEnd = objAttributes.num_face_num_verts; - // see how many verts till the next shape - + // See how many verts till the next shape if (objShapeCount > 1) nextShapeEnd = objShapes[nextShape].face_offset; - // walk all the faces + // Walk all the faces for (unsigned int faceId = 0; faceId < objAttributes.num_faces; faceId++) { if (faceId >= nextShapeEnd) { - // try to find the last vert in the next shape + // Try to find the last vert in the next shape nextShape++; if (nextShape < objShapeCount) nextShapeEnd = objShapes[nextShape].face_offset; - else nextShapeEnd = objAttributes.num_face_num_verts; // this is actually the total number of face verts in the file, not faces + else nextShapeEnd = objAttributes.num_face_num_verts; // This is actually the total number of face verts in the file, not faces meshIndex++; } - else if (lastMaterial != -1 && objAttributes.material_ids[faceId] != lastMaterial) + else if ((lastMaterial != -1) && (objAttributes.material_ids[faceId] != lastMaterial)) { - meshIndex++;// if this is a new material, we need to allocate a new mesh + meshIndex++; // If this is a new material, we need to allocate a new mesh } lastMaterial = objAttributes.material_ids[faceId]; faceVertIndex += objAttributes.face_num_verts[faceId]; } - // allocate the base meshes and materials + // Allocate the base meshes and materials model.meshCount = meshIndex + 1; - model.meshes = (Mesh*)MemAlloc(sizeof(Mesh) * model.meshCount); + model.meshes = (Mesh *)MemAlloc(sizeof(Mesh)*model.meshCount); if (objMaterialCount > 0) { model.materialCount = objMaterialCount; - model.materials = (Material*)MemAlloc(sizeof(Material) * objMaterialCount); + model.materials = (Material *)MemAlloc(sizeof(Material)*objMaterialCount); } - else // we must allocate at least one material + else // We must allocate at least one material { model.materialCount = 1; - model.materials = (Material*)MemAlloc(sizeof(Material) * 1); + model.materials = (Material *)MemAlloc(sizeof(Material)*1); } - model.meshMaterial = (int*)MemAlloc(sizeof(int) * model.meshCount); + model.meshMaterial = (int *)MemAlloc(sizeof(int)*model.meshCount); - // see how many verts are in each mesh - unsigned int* localMeshVertexCounts = (unsigned int*)MemAlloc(sizeof(unsigned int) * model.meshCount); + // See how many verts are in each mesh + unsigned int *localMeshVertexCounts = (unsigned int *)MemAlloc(sizeof(unsigned int)*model.meshCount); faceVertIndex = 0; nextShapeEnd = objAttributes.num_face_num_verts; @@ -4287,23 +4283,22 @@ static Model LoadOBJ(const char *fileName) unsigned int localMeshVertexCount = 0; nextShape = 1; - if (objShapeCount > 1) - nextShapeEnd = objShapes[nextShape].face_offset; + if (objShapeCount > 1) nextShapeEnd = objShapes[nextShape].face_offset; - // walk all the faces + // Walk all the faces for (unsigned int faceId = 0; faceId < objAttributes.num_faces; faceId++) { - bool newMesh = false; // do we need a new mesh? + bool newMesh = false; // Do we need a new mesh? if (faceId >= nextShapeEnd) { - // try to find the last vert in the next shape + // Try to find the last vert in the next shape nextShape++; if (nextShape < objShapeCount) nextShapeEnd = objShapes[nextShape].face_offset; else nextShapeEnd = objAttributes.num_face_num_verts; // this is actually the total number of face verts in the file, not faces newMesh = true; } - else if (lastMaterial != -1 && objAttributes.material_ids[faceId] != lastMaterial) + else if ((lastMaterial != -1) && (objAttributes.material_ids[faceId] != lastMaterial)) { newMesh = true; } @@ -4321,50 +4316,52 @@ static Model LoadOBJ(const char *fileName) faceVertIndex += objAttributes.face_num_verts[faceId]; localMeshVertexCount += objAttributes.face_num_verts[faceId]; } + localMeshVertexCounts[meshIndex] = localMeshVertexCount; for (int i = 0; i < model.meshCount; i++) { - // allocate the buffers for each mesh + // Allocate the buffers for each mesh unsigned int vertexCount = localMeshVertexCounts[i]; model.meshes[i].vertexCount = vertexCount; model.meshes[i].triangleCount = vertexCount / 3; - model.meshes[i].vertices = (float*)MemAlloc(sizeof(float) * vertexCount * 3); - model.meshes[i].normals = (float*)MemAlloc(sizeof(float) * vertexCount * 3); - model.meshes[i].texcoords = (float*)MemAlloc(sizeof(float) * vertexCount * 2); - model.meshes[i].colors = (unsigned char*)MemAlloc(sizeof(unsigned char) * vertexCount * 4); + model.meshes[i].vertices = (float *)MemAlloc(sizeof(float)*vertexCount*3); + model.meshes[i].normals = (float *)MemAlloc(sizeof(float)*vertexCount*3); + model.meshes[i].texcoords = (float *)MemAlloc(sizeof(float)*vertexCount*2); + model.meshes[i].colors = (unsigned char *)MemAlloc(sizeof(unsigned char)*vertexCount*4); } MemFree(localMeshVertexCounts); localMeshVertexCounts = NULL; - // fill meshes + // Fill meshes faceVertIndex = 0; nextShapeEnd = objAttributes.num_face_num_verts; - // see how many verts till the next shape + // See how many verts till the next shape nextShape = 1; if (objShapeCount > 1) nextShapeEnd = objShapes[nextShape].face_offset; lastMaterial = -1; meshIndex = 0; localMeshVertexCount = 0; - // walk all the faces + // Walk all the faces for (unsigned int faceId = 0; faceId < objAttributes.num_faces; faceId++) { - bool newMesh = false; // do we need a new mesh? + bool newMesh = false; // Do we need a new mesh? if (faceId >= nextShapeEnd) { - // try to find the last vert in the next shape + // Try to find the last vert in the next shape nextShape++; if (nextShape < objShapeCount) nextShapeEnd = objShapes[nextShape].face_offset; - else nextShapeEnd = objAttributes.num_face_num_verts; // this is actually the total number of face verts in the file, not faces + else nextShapeEnd = objAttributes.num_face_num_verts; // This is actually the total number of face verts in the file, not faces newMesh = true; } - // if this is a new material, we need to allocate a new mesh + + // If this is a new material, we need to allocate a new mesh if (lastMaterial != -1 && objAttributes.material_ids[faceId] != lastMaterial) newMesh = true; lastMaterial = objAttributes.material_ids[faceId]; @@ -4375,8 +4372,7 @@ static Model LoadOBJ(const char *fileName) } int matId = 0; - if (lastMaterial >= 0 && lastMaterial < (int)objMaterialCount) - matId = lastMaterial; + if ((lastMaterial >= 0) && (lastMaterial < (int)objMaterialCount)) matId = lastMaterial; model.meshMaterial[meshIndex] = matId; @@ -4386,19 +4382,15 @@ static Model LoadOBJ(const char *fileName) int normalIndex = objAttributes.faces[faceVertIndex].vn_idx; int texcordIndex = objAttributes.faces[faceVertIndex].vt_idx; - for (int i = 0; i < 3; i++) - model.meshes[meshIndex].vertices[localMeshVertexCount * 3 + i] = objAttributes.vertices[vertIndex * 3 + i]; + for (int i = 0; i < 3; i++) model.meshes[meshIndex].vertices[localMeshVertexCount*3 + i] = objAttributes.vertices[vertIndex*3 + i]; - for (int i = 0; i < 3; i++) - model.meshes[meshIndex].normals[localMeshVertexCount * 3 + i] = objAttributes.normals[normalIndex * 3 + i]; + for (int i = 0; i < 3; i++) model.meshes[meshIndex].normals[localMeshVertexCount*3 + i] = objAttributes.normals[normalIndex*3 + i]; - for (int i = 0; i < 2; i++) - model.meshes[meshIndex].texcoords[localMeshVertexCount * 2 + i] = objAttributes.texcoords[texcordIndex * 2 + i]; + for (int i = 0; i < 2; i++) model.meshes[meshIndex].texcoords[localMeshVertexCount*2 + i] = objAttributes.texcoords[texcordIndex*2 + i]; - model.meshes[meshIndex].texcoords[localMeshVertexCount * 2 + 1] = 1.0f - model.meshes[meshIndex].texcoords[localMeshVertexCount * 2 + 1]; + model.meshes[meshIndex].texcoords[localMeshVertexCount*2 + 1] = 1.0f - model.meshes[meshIndex].texcoords[localMeshVertexCount*2 + 1]; - for (int i = 0; i < 4; i++) - model.meshes[meshIndex].colors[localMeshVertexCount * 4 + i] = 255; + for (int i = 0; i < 4; i++) model.meshes[meshIndex].colors[localMeshVertexCount*4 + i] = 255; faceVertIndex++; localMeshVertexCount++; @@ -4412,8 +4404,7 @@ static Model LoadOBJ(const char *fileName) tinyobj_shapes_free(objShapes, objShapeCount); tinyobj_materials_free(objMaterials, objMaterialCount); - for (int i = 0; i < model.meshCount; i++) - UploadMesh(model.meshes + i, true); + for (int i = 0; i < model.meshCount; i++) UploadMesh(model.meshes + i, true); // Restore current working directory if (CHDIR(currentDir) != 0) diff --git a/src/rtext.c b/src/rtext.c index 999557d38..5c7c01fbe 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -2325,9 +2325,9 @@ static Font LoadBMFont(const char *fileName) // Convert hexadecimal to decimal (single digit) static unsigned char HexToInt(char hex) { - if (hex >= '0' && hex <= '9') return hex - '0'; - else if (hex >= 'a' && hex <= 'f') return hex - 'a' + 10; - else if (hex >= 'A' && hex <= 'F') return hex - 'A' + 10; + if ((hex >= '0') && (hex <= '9')) return hex - '0'; + else if ((hex >= 'a') && (hex <= 'f')) return hex - 'a' + 10; + else if ((hex >= 'A') && (hex <= 'F')) return hex - 'A' + 10; else return 0; } diff --git a/src/rtextures.c b/src/rtextures.c index 2d269d7f3..aea6ab46c 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3567,7 +3567,7 @@ void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color co ImageDrawLine(dst, x1, y1, x2, y2, color); // Determine if the line is more horizontal or vertical - if (dx != 0 && abs(dy/dx) < 1) + if ((dx != 0) && (abs(dy/dx) < 1)) { // Line is more horizontal // Calculate half the width of the line From e181069c62412990e4d30a81ff075a9259d5077d Mon Sep 17 00:00:00 2001 From: Ryan Johnston Date: Sun, 1 Dec 2024 17:12:00 -0500 Subject: [PATCH 095/194] Update BINDINGS.md (#4559) Include CLIPSraylib in the list of language bindings. --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index fe2bfc589..5f8c6b79d 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -19,6 +19,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [claylib/wrap](https://github.com/defun-games/claylib) | 4.5 | [Common Lisp](https://common-lisp.net) | Zlib | | [claw-raylib](https://github.com/bohonghuang/claw-raylib) | **auto** | [Common Lisp](https://common-lisp.net) | Apache-2.0 | | [chez-raylib](https://github.com/Yunoinsky/chez-raylib) | **auto** | [Chez Scheme](https://cisco.github.io/ChezScheme) | GPLv3 | +| [CLIPSraylib](https://github.com/mrryanjohnston/CLIPSraylib) | **auto** | [CLIPS](https://www.clipsrules.net/) | MIT | | [raylib-cr](https://github.com/sol-vin/raylib-cr) | 4.6-dev (5e1a81) | [Crystal](https://crystal-lang.org) | Apache-2.0 | | [ray-cyber](https://github.com/fubark/ray-cyber) | **5.0** | [Cyber](https://cyberscript.dev) | MIT | | [dart-raylib](https://gitlab.com/wolfenrain/dart-raylib) | 4.0 | [Dart](https://dart.dev) | MIT | From ff71e3a513f9061bd0a107d9e0281bbfbf60ca35 Mon Sep 17 00:00:00 2001 From: Rico P Date: Sun, 1 Dec 2024 23:22:46 +0100 Subject: [PATCH 096/194] use unused variable. Fixes #4560 (#4561) --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index 92971df62..c08623de3 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3959,7 +3959,7 @@ void rlDrawVertexArrayElements(int offset, int count, const void *buffer) void rlDrawVertexArrayInstanced(int offset, int count, int instances) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDrawArraysInstanced(GL_TRIANGLES, 0, count, instances); + glDrawArraysInstanced(GL_TRIANGLES, offset, count, instances); #endif } From dd26df0be8349ce1eaa4a525007241b4c532f122 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 1 Dec 2024 23:25:12 +0100 Subject: [PATCH 097/194] REVIEWED: Parser issue with comment #4558 --- src/raylib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raylib.h b/src/raylib.h index 980e19b6c..641bd10e0 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1177,8 +1177,8 @@ RLAPI bool IsKeyReleased(int key); // Check if a key RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty +RLAPI const char *GetKeyName(int key); // Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard) RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) -RLAPI const char *GetKeyName(int key); // Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard) // Input-related functions: gamepads RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available From e5e2bc83c3c6a960047d19bb18f0ec8b9416d3a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 1 Dec 2024 22:25:46 +0000 Subject: [PATCH 098/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 12 ++++++------ parser/output/raylib_api.lua | 12 ++++++------ parser/output/raylib_api.txt | 12 ++++++------ parser/output/raylib_api.xml | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 62ecd1fa9..3eb438392 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -4882,9 +4882,9 @@ "returnType": "int" }, { - "name": "SetExitKey", - "description": "Set a custom key to exit program (default is ESC)", - "returnType": "void", + "name": "GetKeyName", + "description": "Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)", + "returnType": "const char *", "params": [ { "type": "int", @@ -4893,9 +4893,9 @@ ] }, { - "name": "GetKeyName", - "description": "Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard)", - "returnType": "const char *", + "name": "SetExitKey", + "description": "Set a custom key to exit program (default is ESC)", + "returnType": "void", "params": [ { "type": "int", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index d62a94a7f..da3faf073 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -4327,17 +4327,17 @@ return { returnType = "int" }, { - name = "SetExitKey", - description = "Set a custom key to exit program (default is ESC)", - returnType = "void", + name = "GetKeyName", + description = "Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)", + returnType = "const char *", params = { {type = "int", name = "key"} } }, { - name = "GetKeyName", - description = "Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard)", - returnType = "const char *", + name = "SetExitKey", + description = "Set a custom key to exit program (default is ESC)", + returnType = "void", params = { {type = "int", name = "key"} } diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 721304906..5c7c38701 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -1886,16 +1886,16 @@ Function 167: GetCharPressed() (0 input parameters) Return type: int Description: Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty No input parameters -Function 168: SetExitKey() (1 input parameters) +Function 168: GetKeyName() (1 input parameters) + Name: GetKeyName + Return type: const char * + Description: Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard) + Param[1]: key (type: int) +Function 169: SetExitKey() (1 input parameters) Name: SetExitKey Return type: void Description: Set a custom key to exit program (default is ESC) Param[1]: key (type: int) -Function 169: GetKeyName() (1 input parameters) - Name: GetKeyName - Return type: const char * - Description: Get name of a QWERTY key on the current keyboard layout (eg returns string "q" for KEY_A on an AZERTY keyboard) - Param[1]: key (type: int) Function 170: IsGamepadAvailable() (1 input parameters) Name: IsGamepadAvailable Return type: bool diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index fde502831..81cb6a371 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -1181,10 +1181,10 @@ - + - + From f3f5f38c0f4d982eb299f7b582b8b04b038f212a Mon Sep 17 00:00:00 2001 From: Caleb Heydon Date: Mon, 2 Dec 2024 07:35:54 -0500 Subject: [PATCH 099/194] [rmodels] Fix crash when NULL is passed to LoadImageFromCgltfImage (#4563) --- src/rmodels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index 5e6d39664..46309f98f 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5060,6 +5060,8 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat { Image image = { 0 }; + if (cgltfImage == NULL) return image; + if (cgltfImage->uri != NULL) // Check if image data is provided as an uri (base64 or path) { if ((strlen(cgltfImage->uri) > 5) && From 87b3085f5c2a023b1c792287f17610d0e18dbfcc Mon Sep 17 00:00:00 2001 From: ahmedqarmout2 Date: Mon, 2 Dec 2024 12:48:24 -0500 Subject: [PATCH 100/194] Added new Jai bindings to BINDINGS.md (#4565) Co-authored-by: Ahmed Qarmout --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index 5f8c6b79d..db5b1ca95 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -86,6 +86,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | **5.5-dev** | [Lean4](https://lean-lang.org) | BSD-3-Clause | | [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain | | [raylib-apl](https://github.com/Brian-ED/raylib-apl) | **5.0** | [Dyalog APL](https://www.dyalog.com/) | MIT | +| [raylib-jai](https://github.com/ahmedqarmout2/raylib-jai) | **5.5** | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | MIT | ### Utility Wrapers From 402eab383797ef8759e899543b7c93ba569ea49b Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:50:24 +0100 Subject: [PATCH 101/194] Update BINDINGS.md (#4566) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index db5b1ca95..f9516ba0c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -30,7 +30,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 4.5 | [Factor](https://factorcode.org) | BSD | | [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT | | [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | **5.5** | [Fortran](https://fortran-lang.org) | ISC | -| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.0** | [Go](https://golang.org) | Zlib | +| [raylib-go](https://github.com/gen2brain/raylib-go) | **5.5** | [Go](https://golang.org) | Zlib | | [raylib-guile](https://github.com/petelliott/raylib-guile) | **auto** | [Guile](https://www.gnu.org/software/guile) | Zlib | | [gforth-raylib](https://github.com/ArnautDaniel/gforth-raylib) | 3.5 | [Gforth](https://gforth.org) | **???** | | [h-raylib](https://github.com/Anut-py/h-raylib) | **5.5-dev** | [Haskell](https://haskell.org) | Apache-2.0 | From 83587e94c844c61b455a48d2f8d9ce872ffc92b6 Mon Sep 17 00:00:00 2001 From: Legendary Redfox <128002430+legendaryredfox@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:01:22 -0300 Subject: [PATCH 102/194] updated raylib-lua version (#4567) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index f9516ba0c..8339e211d 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -42,7 +42,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib | | [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** | | [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | -| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 4.5 | [Lua](http://www.lua.org) | ISC | +| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC | | [raylua](https://github.com/Rabios/raylua) | 4.0 | [Lua](http://www.lua.org) | MIT | | [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | MIT | | [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib | From e9e463e8b2eda422840a1a4977b9ff4c9e2a2c08 Mon Sep 17 00:00:00 2001 From: Legendary Redfox <128002430+legendaryredfox@users.noreply.github.com> Date: Tue, 3 Dec 2024 08:03:36 -0300 Subject: [PATCH 103/194] [documentation] Updating keybindings versions (#4570) * updated raylib-lua version * Updated some bindings --- BINDINGS.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index 8339e211d..a4e31de3c 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -6,7 +6,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | Name | raylib Version | Language | License | | :--------------------------------------------------------------------------------------- | :--------------: | :------------------------------------------------------------------: | :------------------: | -| [raylib](https://github.com/raysan5/raylib) | **5.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | +| [raylib](https://github.com/raysan5/raylib) | **5.5** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | | [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT | | [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT | | [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | @@ -46,10 +46,10 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylua](https://github.com/Rabios/raylua) | 4.0 | [Lua](http://www.lua.org) | MIT | | [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | MIT | | [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib | -| [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 4.5 | [Ruby](https://www.ruby-lang.org/en) | Zlib | +| [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 5.6-dev | [Ruby](https://www.ruby-lang.org/en) | Zlib | | [naylib](https://github.com/planetis-m/naylib) | **5.1-dev** | [Nim](https://nim-lang.org) | MIT | | [node-raylib](https://github.com/RobLoach/node-raylib) | 4.5 | [Node.js](https://nodejs.org/en) | Zlib | -| [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.0** | [Odin](https://odin-lang.org) | BSD-3Clause | +| [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.5** | [Odin](https://odin-lang.org) | BSD-3Clause | | [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT | | [raylib-ocaml](https://github.com/tjammer/raylib-ocaml) | **5.0** | [OCaml](https://ocaml.org) | MIT | | [TurboRaylib](https://github.com/turborium/TurboRaylib) | 4.5 | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT | @@ -57,25 +57,25 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [Raylib.4.0.Pascal](https://github.com/sysrpl/Raylib.4.0.Pascal) | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal) | Zlib | | [pyraylib](https://github.com/Ho011/pyraylib) | 3.7 | [Python](https://www.python.org) | Zlib | | [raylib-python-cffi](https://github.com/electronstudio/raylib-python-cffi) | **5.5** | [Python](https://www.python.org) | EPL-2.0 | -| [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 4.5 | [Python](https://www.python.org) | MIT | +| [raylibpyctbg](https://github.com/overdev/raylibpyctbg) | 5.5 | [Python](https://www.python.org) | MIT | | [raylib-py](https://github.com/overdev/raylib-py) | 5.5 | [Python](https://www.python.org) | MIT | | [raylib-python-ctypes](https://github.com/sDos280/raylib-python-ctypes) | 4.6-dev | [Python](https://www.python.org) | MIT | -| [raylib-pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) | 4.6-dev | [pocketpy](https://pocketpy.dev) | MIT | +| [raylib-pkpy-bindings](https://github.com/blueloveTH/pkpy-bindings) | 5.1-dev | [pocketpy](https://pocketpy.dev) | MIT | | [raylib-php](https://github.com/joseph-montanez/raylib-php) | 4.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | | [raylib-phpcpp](https://github.com/oraoto/raylib-phpcpp) | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | | [raylibr](https://github.com/jeroenjanssens/raylibr) | 4.0 | [R](https://www.r-project.org) | MIT | -| [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 4.5 | [Rust](https://www.rust-lang.org) | GPLv3 | -| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.0** | [Rust](https://www.rust-lang.org) | Zlib | +| [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 5.5 | [Rust](https://www.rust-lang.org) | GPLv3 | +| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.5** | [Rust](https://www.rust-lang.org) | Zlib | | [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** | | [racket-raylib](https://github.com/eutro/racket-raylib) | 4.0 | [Racket](https://racket-lang.org) | MIT/Apache-2.0 | | [raylib-swift](https://github.com/STREGAsGate/Raylib) | 4.0 | [Swift](https://swift.org) | MIT | | [raylib-scopes](https://github.com/salotz/raylib-scopes) | auto | [Scopes](http://scopes.rocks) | MIT | -| [raylib-SmallBASIC](https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib) | **5.0** | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | +| [raylib-SmallBASIC](https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib) | **5.5** | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | | [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib | | [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib | | [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib | -| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.0 | [Wren](http://wren.io) | ISC | -| [raylib-zig](https://github.com/Not-Nik/raylib-zig) | **5.0** | [Zig](https://ziglang.org) | MIT | +| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC | +| [raylib-zig](https://github.com/Not-Nik/raylib-zig) | **5.5** | [Zig](https://ziglang.org) | MIT | | [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT | | [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib | | [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib | From 1f0325b52c87af4820b31957d8e40d7bc1f112bb Mon Sep 17 00:00:00 2001 From: Legendary Redfox <128002430+legendaryredfox@users.noreply.github.com> Date: Tue, 3 Dec 2024 09:30:17 -0300 Subject: [PATCH 104/194] [documentation] Removing 404 repos from bindings (#4572) * updated raylib-lua version * Updated some bindings * removed 404 bindings --- BINDINGS.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/BINDINGS.md b/BINDINGS.md index a4e31de3c..5d158c998 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -8,7 +8,6 @@ Some people ported raylib to other languages in the form of bindings or wrappers | :--------------------------------------------------------------------------------------- | :--------------: | :------------------------------------------------------------------: | :------------------: | | [raylib](https://github.com/raysan5/raylib) | **5.5** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | | [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT | -| [raylib-boo](https://github.com/Rabios/raylib-boo) | 3.7 | [Boo](http://boo-language.github.io) | MIT | | [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | | [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib55.c3l) | **5.5** | [C3](https://c3-lang.org) | MIT | | [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | @@ -43,7 +42,6 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** | | [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | | [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC | -| [raylua](https://github.com/Rabios/raylua) | 4.0 | [Lua](http://www.lua.org) | MIT | | [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | MIT | | [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib | | [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 5.6-dev | [Ruby](https://www.ruby-lang.org/en) | Zlib | From 5feccb1babbce13de69b33179a2599e5bc216899 Mon Sep 17 00:00:00 2001 From: Caleb Heydon Date: Tue, 3 Dec 2024 12:35:24 -0500 Subject: [PATCH 105/194] [rmodels] Fixed null pointer dereference in LoadGLTF (#4564) * [rmodels] Fixed null pointer dereference in LoadGLTF * [rmodels] Add parenthesis around conditionals in LoadGLTF --- src/rmodels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 46309f98f..6e33da697 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5657,7 +5657,7 @@ static Model LoadGLTF(const char *fileName) } // Load primitive indices data (if provided) - if (mesh->primitives[p].indices != NULL) + if ((mesh->primitives[p].indices != NULL) && (mesh->primitives[p].indices->buffer_view != NULL)) { cgltf_accessor *attribute = mesh->primitives[p].indices; From 1f45e7af765e5c292ce1ab038ee0cedffa7408b5 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 3 Dec 2024 19:14:14 +0100 Subject: [PATCH 106/194] REVIEWED: Coding conventions --- src/raudio.c | 4 ++-- src/raymath.h | 12 ++++++------ src/rcamera.h | 2 +- src/rcore.c | 33 ++++++++++++++++++++------------- src/rmodels.c | 43 +++++++++++++++++++++++-------------------- src/rtext.c | 2 +- src/rtextures.c | 15 ++++++++------- 7 files changed, 61 insertions(+), 50 deletions(-) diff --git a/src/raudio.c b/src/raudio.c index b2627e2dc..cc596ec11 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1550,7 +1550,7 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, else if ((strcmp(fileType, ".ogg") == 0) || (strcmp(fileType, ".OGG") == 0)) { // Open ogg audio stream - stb_vorbis* ctxOgg = stb_vorbis_open_memory((const unsigned char *)data, dataSize, NULL, NULL); + stb_vorbis *ctxOgg = stb_vorbis_open_memory((const unsigned char *)data, dataSize, NULL, NULL); if (ctxOgg != NULL) { @@ -2462,7 +2462,7 @@ static ma_uint32 ReadAudioBufferFramesInMixingFormat(AudioBuffer *audioBuffer, f float *runningFramesOut = framesOut + (totalOutputFramesProcessed*audioBuffer->converter.channelsOut); // At this point we can convert the data to our mixing format - ma_uint64 inputFramesProcessedThisIteration = ReadAudioBufferFramesInInternalFormat(audioBuffer, inputBuffer, (ma_uint32)inputFramesToProcessThisIteration); /* Safe cast. */ + ma_uint64 inputFramesProcessedThisIteration = ReadAudioBufferFramesInInternalFormat(audioBuffer, inputBuffer, (ma_uint32)inputFramesToProcessThisIteration); ma_uint64 outputFramesProcessedThisIteration = outputFramesToProcessThisIteration; ma_data_converter_process_pcm_frames(&audioBuffer->converter, inputBuffer, &inputFramesProcessedThisIteration, runningFramesOut, &outputFramesProcessedThisIteration); diff --git a/src/raymath.h b/src/raymath.h index caf04a321..9d712027c 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -2665,12 +2665,12 @@ inline const Vector2& operator *= (Vector2& lhs, const Matrix& rhs) inline Vector2 operator / (const Vector2& lhs, const float& rhs) { - return Vector2Scale(lhs, 1.0f / rhs); + return Vector2Scale(lhs, 1.0f/rhs); } inline const Vector2& operator /= (Vector2& lhs, const float& rhs) { - lhs = Vector2Scale(lhs, 1.0f / rhs); + lhs = Vector2Scale(lhs, 1.0f/rhs); return lhs; } @@ -2759,12 +2759,12 @@ inline const Vector3& operator *= (Vector3& lhs, const Matrix& rhs) inline Vector3 operator / (const Vector3& lhs, const float& rhs) { - return Vector3Scale(lhs, 1.0f / rhs); + return Vector3Scale(lhs, 1.0f/rhs); } inline const Vector3& operator /= (Vector3& lhs, const float& rhs) { - lhs = Vector3Scale(lhs, 1.0f / rhs); + lhs = Vector3Scale(lhs, 1.0f/rhs); return lhs; } @@ -2843,12 +2843,12 @@ inline const Vector4& operator *= (Vector4& lhs, const Vector4& rhs) inline Vector4 operator / (const Vector4& lhs, const float& rhs) { - return Vector4Scale(lhs, 1.0f / rhs); + return Vector4Scale(lhs, 1.0f/rhs); } inline const Vector4& operator /= (Vector4& lhs, const float& rhs) { - lhs = Vector4Scale(lhs, 1.0f / rhs); + lhs = Vector4Scale(lhs, 1.0f/rhs); return lhs; } diff --git a/src/rcamera.h b/src/rcamera.h index bd2b36e03..ab998ae03 100644 --- a/src/rcamera.h +++ b/src/rcamera.h @@ -154,7 +154,7 @@ RLAPI void CameraPitch(Camera *camera, float angle, bool lockView, bool rotateAr RLAPI void CameraRoll(Camera *camera, float angle); RLAPI Matrix GetCameraViewMatrix(Camera *camera); -RLAPI Matrix GetCameraProjectionMatrix(Camera* camera, float aspect); +RLAPI Matrix GetCameraProjectionMatrix(Camera *camera, float aspect); #if defined(__cplusplus) } diff --git a/src/rcore.c b/src/rcore.c index 05e02b14f..bcff5acb0 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2765,7 +2765,8 @@ unsigned int *ComputeMD5(unsigned char *data, int dataSize) // Compute SHA-1 hash code // NOTE: Returns a static int[5] array (20 bytes) -unsigned int *ComputeSHA1(unsigned char *data, int dataSize) { +unsigned int *ComputeSHA1(unsigned char *data, int dataSize) +{ #define ROTATE_LEFT(x, c) (((x) << (c)) | ((x) >> (32 - (c)))) static unsigned int hash[5] = { 0 }; // Hash to be returned @@ -2800,17 +2801,16 @@ unsigned int *ComputeSHA1(unsigned char *data, int dataSize) { { // Break chunk into sixteen 32-bit words w[j], 0 <= j <= 15 unsigned int w[80] = {0}; - for (int i = 0; i < 16; i++) { - w[i] = (msg[offset + (i * 4) + 0] << 24) | - (msg[offset + (i * 4) + 1] << 16) | - (msg[offset + (i * 4) + 2] << 8) | - (msg[offset + (i * 4) + 3]); + for (int i = 0; i < 16; i++) + { + w[i] = (msg[offset + (i*4) + 0] << 24) | + (msg[offset + (i*4) + 1] << 16) | + (msg[offset + (i*4) + 2] << 8) | + (msg[offset + (i*4) + 3]); } // Message schedule: extend the sixteen 32-bit words into eighty 32-bit words: - for (int i = 16; i < 80; ++i) { - w[i] = ROTATE_LEFT(w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16], 1); - } + for (int i = 16; i < 80; i++) w[i] = ROTATE_LEFT(w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16], 1); // Initialize hash value for this chunk unsigned int a = hash[0]; @@ -2824,16 +2824,23 @@ unsigned int *ComputeSHA1(unsigned char *data, int dataSize) { unsigned int f = 0; unsigned int k = 0; - if (i < 20) { + if (i < 20) + { f = (b & c) | ((~b) & d); k = 0x5A827999; - } else if (i < 40) { + } + else if (i < 40) + { f = b ^ c ^ d; k = 0x6ED9EBA1; - } else if (i < 60) { + } + else if (i < 60) + { f = (b & c) | (b & d) | (c & d); k = 0x8F1BBCDC; - } else { + } + else + { f = b ^ c ^ d; k = 0xCA62C1D6; } diff --git a/src/rmodels.c b/src/rmodels.c index 5e6d39664..2f9dade83 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -96,9 +96,9 @@ #endif #if defined(SUPPORT_MESH_GENERATION) - #define PAR_MALLOC(T, N) ((T*)RL_MALLOC(N*sizeof(T))) - #define PAR_CALLOC(T, N) ((T*)RL_CALLOC(N*sizeof(T), 1)) - #define PAR_REALLOC(T, BUF, N) ((T*)RL_REALLOC(BUF, sizeof(T)*(N))) + #define PAR_MALLOC(T, N) ((T *)RL_MALLOC(N*sizeof(T))) + #define PAR_CALLOC(T, N) ((T *)RL_CALLOC(N*sizeof(T), 1)) + #define PAR_REALLOC(T, BUF, N) ((T *)RL_REALLOC(BUF, sizeof(T)*(N))) #define PAR_FREE RL_FREE #if defined(_MSC_VER) // Disable some MSVC warning @@ -2308,7 +2308,7 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) } } -// at least 2x speed up vs the old method +// at least 2x speed up vs the old method // Update model animated vertex data (positions and normals) for a given frame // NOTE: Updated data is uploaded to GPU void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) @@ -2340,14 +2340,16 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) { boneWeight = mesh.boneWeights[boneCounter]; boneId = mesh.boneIds[boneCounter]; + // Early stop when no transformation will be applied if (boneWeight == 0.0f) continue; animVertex = (Vector3){ mesh.vertices[vCounter], mesh.vertices[vCounter + 1], mesh.vertices[vCounter + 2] }; animVertex = Vector3Transform(animVertex,model.meshes[m].boneMatrices[boneId]); - mesh.animVertices[vCounter] += animVertex.x * boneWeight; - mesh.animVertices[vCounter+1] += animVertex.y * boneWeight; - mesh.animVertices[vCounter+2] += animVertex.z * boneWeight; + mesh.animVertices[vCounter] += animVertex.x*boneWeight; + mesh.animVertices[vCounter+1] += animVertex.y*boneWeight; + mesh.animVertices[vCounter+2] += animVertex.z*boneWeight; updated = true; + // Normals processing // NOTE: We use meshes.baseNormals (default normal) to calculate meshes.normals (animated normals) if (mesh.normals != NULL) @@ -2360,6 +2362,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) } } } + if (updated) { rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position @@ -2725,11 +2728,11 @@ Mesh GenMeshCube(float width, float height, float length) #else // Use par_shapes library to generate cube mesh /* // Platonic solids: -par_shapes_mesh* par_shapes_create_tetrahedron(); // 4 sides polyhedron (pyramid) -par_shapes_mesh* par_shapes_create_cube(); // 6 sides polyhedron (cube) -par_shapes_mesh* par_shapes_create_octahedron(); // 8 sides polyhedron (diamond) -par_shapes_mesh* par_shapes_create_dodecahedron(); // 12 sides polyhedron -par_shapes_mesh* par_shapes_create_icosahedron(); // 20 sides polyhedron +par_shapes_mesh *par_shapes_create_tetrahedron(); // 4 sides polyhedron (pyramid) +par_shapes_mesh *par_shapes_create_cube(); // 6 sides polyhedron (cube) +par_shapes_mesh *par_shapes_create_octahedron(); // 8 sides polyhedron (diamond) +par_shapes_mesh *par_shapes_create_dodecahedron(); // 12 sides polyhedron +par_shapes_mesh *par_shapes_create_icosahedron(); // 20 sides polyhedron */ // Platonic solid generation: cube (6 sides) // NOTE: No normals/texcoords generated by default @@ -3840,7 +3843,7 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector for (int i = 0; i < 4; i++) { points[i] = Vector3Subtract(points[i], origin3D); - if (rotation != 0.0) points[i] = Vector3RotateByAxisAngle(points[i], forward, rotation * DEG2RAD); + if (rotation != 0.0) points[i] = Vector3RotateByAxisAngle(points[i], forward, rotation*DEG2RAD); points[i] = Vector3Add(points[i], position); } @@ -4049,7 +4052,7 @@ RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform) for (int i = 0; i < triangleCount; i++) { Vector3 a, b, c; - Vector3* vertdata = (Vector3*)mesh.vertices; + Vector3 *vertdata = (Vector3 *)mesh.vertices; if (mesh.indices) { @@ -4213,7 +4216,7 @@ static Model LoadOBJ(const char *fileName) if (CHDIR(workingDir) != 0) TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to change working directory", workingDir); unsigned int dataSize = (unsigned int)strlen(fileText); - + unsigned int flags = TINYOBJ_FLAG_TRIANGULATE; int ret = tinyobj_parse_obj(&objAttributes, &objShapes, &objShapeCount, &objMaterials, &objMaterialCount, fileText, dataSize, flags); @@ -4316,7 +4319,7 @@ static Model LoadOBJ(const char *fileName) faceVertIndex += objAttributes.face_num_verts[faceId]; localMeshVertexCount += objAttributes.face_num_verts[faceId]; } - + localMeshVertexCounts[meshIndex] = localMeshVertexCount; for (int i = 0; i < model.meshCount; i++) @@ -4325,7 +4328,7 @@ static Model LoadOBJ(const char *fileName) unsigned int vertexCount = localMeshVertexCounts[i]; model.meshes[i].vertexCount = vertexCount; - model.meshes[i].triangleCount = vertexCount / 3; + model.meshes[i].triangleCount = vertexCount/3; model.meshes[i].vertices = (float *)MemAlloc(sizeof(float)*vertexCount*3); model.meshes[i].normals = (float *)MemAlloc(sizeof(float)*vertexCount*3); @@ -4360,7 +4363,7 @@ static Model LoadOBJ(const char *fileName) else nextShapeEnd = objAttributes.num_face_num_verts; // This is actually the total number of face verts in the file, not faces newMesh = true; } - + // If this is a new material, we need to allocate a new mesh if (lastMaterial != -1 && objAttributes.material_ids[faceId] != lastMaterial) newMesh = true; lastMaterial = objAttributes.material_ids[faceId]; @@ -5672,7 +5675,7 @@ static Model LoadGLTF(const char *fileName) else if (attribute->component_type == cgltf_component_type_r_8u) { // Init raylib mesh indices to copy glTF attribute data - model.meshes[meshIndex].indices = RL_MALLOC(attribute->count * sizeof(unsigned short)); + model.meshes[meshIndex].indices = RL_MALLOC(attribute->count*sizeof(unsigned short)); LOAD_ATTRIBUTE_CAST(attribute, 1, unsigned char, model.meshes[meshIndex].indices, unsigned short) } @@ -5727,7 +5730,7 @@ static Model LoadGLTF(const char *fileName) for (int i = 0; i < model.boneCount; i++) { - cgltf_node* node = skin.joints[i]; + cgltf_node *node = skin.joints[i]; cgltf_float worldTransform[16]; cgltf_node_transform_world(node, worldTransform); Matrix worldMatrix = { diff --git a/src/rtext.c b/src/rtext.c index 5c7c01fbe..005568dbf 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1282,7 +1282,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing { Vector2 textSize = { 0 }; - if ((isGpuReady && (font.texture.id == 0)) || + if ((isGpuReady && (font.texture.id == 0)) || (text == NULL) || (text[0] == '\0')) return textSize; // Security check int size = TextLength(text); // Get size in bytes of text diff --git a/src/rtextures.c b/src/rtextures.c index aea6ab46c..57ee57604 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -829,11 +829,11 @@ Image GenImageGradientLinear(int width, int height, int direction, Color start, // Calculate how far the top-left pixel is along the gradient direction from the center of said gradient float startingPos = 0.5f - (cosDir*width/2) - (sinDir*height/2); - // With directions that lie in the first or third quadrant (i.e. from top-left to + // With directions that lie in the first or third quadrant (i.e. from top-left to // bottom-right or vice-versa), pixel (0, 0) is the farthest point on the gradient // (i.e. the pixel which should become one of the gradient's ends color); while for // directions that lie in the second or fourth quadrant, that point is pixel (width, 0). - float maxPosValue = + float maxPosValue = ((signbit(sinDir) != 0) == (signbit(cosDir) != 0)) ? fabsf(startingPos) : fabsf(startingPos+width*cosDir); @@ -842,12 +842,12 @@ Image GenImageGradientLinear(int width, int height, int direction, Color start, for (int j = 0; j < height; j++) { // Calculate the relative position of the pixel along the gradient direction - float pos = (startingPos + (i*cosDir + j*sinDir)) / maxPosValue; + float pos = (startingPos + (i*cosDir + j*sinDir))/maxPosValue; float factor = pos; factor = (factor > 1.0f)? 1.0f : factor; // Clamp to [-1,1] factor = (factor < -1.0f)? -1.0f : factor; // Clamp to [-1,1] - factor = factor / 2 + 0.5f; + factor = factor/2.0f + 0.5f; // Generate the color for this pixel pixels[j*width + i].r = (int)((float)end.r*factor + (float)start.r*(1.0f - factor)); @@ -1007,7 +1007,8 @@ Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float { Color *pixels = (Color *)RL_MALLOC(width*height*sizeof(Color)); - float aspectRatio = (float)width / (float)height; + float aspectRatio = (float)width/(float)height; + for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) @@ -5387,7 +5388,7 @@ static float HalfToFloat(unsigned short x) const unsigned int e = (x & 0x7C00) >> 10; // Exponent const unsigned int m = (x & 0x03FF) << 13; // Mantissa const float fm = (float)m; - const unsigned int v = (*(unsigned int*)&fm) >> 23; // Evil log2 bit hack to count leading zeros in denormalized format + const unsigned int v = (*(unsigned int *)&fm) >> 23; // Evil log2 bit hack to count leading zeros in denormalized format const unsigned int r = (x & 0x8000) << 16 | (e != 0)*((e + 112) << 23 | m) | ((e == 0)&(m != 0))*((v - 37) << 23 | ((m << (150 - v)) & 0x007FE000)); // sign : normalized : denormalized result = *(float *)&r; @@ -5400,7 +5401,7 @@ static unsigned short FloatToHalf(float x) { unsigned short result = 0; - const unsigned int b = (*(unsigned int*) & x) + 0x00001000; // Round-to-nearest-even: add last bit after truncated mantissa + const unsigned int b = (*(unsigned int *) & x) + 0x00001000; // Round-to-nearest-even: add last bit after truncated mantissa const unsigned int e = (b & 0x7F800000) >> 23; // Exponent const unsigned int m = b & 0x007FFFFF; // Mantissa; in line below: 0x007FF000 = 0x00800000-0x00001000 = decimal indicator flag - initial rounding From ca6c5f4f3c88b3a1091756ae70565335f5f734d6 Mon Sep 17 00:00:00 2001 From: 0riginaln0 <74508026+0riginaln0@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:28:08 +0300 Subject: [PATCH 107/194] Update BINDINGS.md | Fennel Bindings (#4585) --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index 5d158c998..873e6af0e 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -85,6 +85,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain | | [raylib-apl](https://github.com/Brian-ED/raylib-apl) | **5.0** | [Dyalog APL](https://www.dyalog.com/) | MIT | | [raylib-jai](https://github.com/ahmedqarmout2/raylib-jai) | **5.5** | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | MIT | +| [fnl-raylib](https://github.com/0riginaln0/fnl-raylib) | **5.5** | [Fennel](https://fennel-lang.org/) | MIT | ### Utility Wrapers From 2820fcc29e91aac8155ffef45560070ecfc5752d Mon Sep 17 00:00:00 2001 From: danil <61111955+danilwhale@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:52:09 +0200 Subject: [PATCH 108/194] [examples] improve input_virtual_controls example (#4584) --- examples/core/core_input_virtual_controls.c | 175 +++++++++++------- examples/core/core_input_virtual_controls.png | Bin 9094 -> 1802 bytes 2 files changed, 113 insertions(+), 62 deletions(-) diff --git a/examples/core/core_input_virtual_controls.c b/examples/core/core_input_virtual_controls.c index bbbad208f..76eeafee4 100644 --- a/examples/core/core_input_virtual_controls.c +++ b/examples/core/core_input_virtual_controls.c @@ -6,7 +6,8 @@ * * Example create by GreenSnakeLinux (@GreenSnakeLinux), * lighter by oblerion (@oblerion) and -* reviewed by Ramon Santamaria (@raysan5) +* reviewed by Ramon Santamaria (@raysan5) and +* improved by danilwhale (@danilwhale) * * Example licensed under an unmodified zlib/libpng license, which is an OSI-certified, * BSD-like license that allows static linking with closed source software @@ -17,6 +18,16 @@ #include "raylib.h" #include + +typedef enum { + BUTTON_NONE = -1, + BUTTON_UP, + BUTTON_LEFT, + BUTTON_RIGHT, + BUTTON_DOWN, + BUTTON_MAX +} PadButton; + //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ @@ -29,24 +40,38 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [core] example - input virtual controls"); - const float dpadX = 90; - const float dpadY = 300; - const float dpadRad = 25.0f;//radius of each pad - Color dpadColor = BLUE; - int dpadKeydown = -1;//-1 if not down, else 0,1,2,3 + Vector2 padPosition = { 100, 350 }; + float buttonRadius = 30; - - const float dpadCollider[4][2]= // collider array with x,y position + Vector2 buttonPositions[BUTTON_MAX] = { - {dpadX,dpadY-dpadRad*1.5f},//up - {dpadX-dpadRad*1.5f,dpadY},//left - {dpadX+dpadRad*1.5f,dpadY},//right - {dpadX,dpadY+dpadRad*1.5f}//down + { padPosition.x,padPosition.y - buttonRadius*1.5f }, // Up + { padPosition.x - buttonRadius*1.5f, padPosition.y }, // Left + { padPosition.x + buttonRadius*1.5f, padPosition.y }, // Right + { padPosition.x, padPosition.y + buttonRadius*1.5f } // Down }; - const char dpadLabel[4]="XYBA";//label of Dpad - float playerX=100; - float playerY=100; + const char *buttonLabels[BUTTON_MAX] = + { + "Y", // Up + "X", // Left + "B", // Right + "A" // Down + }; + + Color buttonLabelColors[BUTTON_MAX] = + { + YELLOW, // Up + BLUE, // Left + RED, // Right + GREEN // Down + }; + + int pressedButton = BUTTON_NONE; + Vector2 inputPosition = { 0, 0 }; + + Vector2 playerPosition = { (float)screenWidth/2, (float)screenHeight/2 }; + float playerSpeed = 75; SetTargetFPS(60); //-------------------------------------------------------------------------------------- @@ -54,63 +79,89 @@ int main(void) // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { - // Update - //-------------------------------------------------------------------------- - dpadKeydown = -1; //reset - int inputX = 0; - int inputY = 0; - if(GetTouchPointCount()>0) - {//use touch pos - inputX = GetTouchX(); - inputY = GetTouchY(); + // Update + //-------------------------------------------------------------------------- + if ((GetTouchPointCount() > 0)) + { + // Use touch position + inputPosition = GetTouchPosition(0); } else - {//use mouse pos - inputX = GetMouseX(); - inputY = GetMouseY(); - } - for(int i=0;i<4;i++) { - //test distance each collider and input < radius - if( fabsf(dpadCollider[i][1]-inputY) + fabsf(dpadCollider[i][0]-inputX) < dpadRad) - { - dpadKeydown = i; - break; - } + // Use mouse position + inputPosition = GetMousePosition(); } - // move player - switch(dpadKeydown){ - case 0: playerY -= 50*GetFrameTime(); - break; - case 1: playerX -= 50*GetFrameTime(); - break; - case 2: playerX += 50*GetFrameTime(); - break; - case 3: playerY += 50*GetFrameTime(); - default:; - }; - //-------------------------------------------------------------------------- - // Draw - //-------------------------------------------------------------------------- - BeginDrawing(); - ClearBackground(RAYWHITE); - for(int i=0;i<4;i++) + + // Reset pressed button to none + pressedButton = BUTTON_NONE; + + // Make sure user is pressing left mouse button if they're from desktop + if ((GetTouchPointCount() > 0) || ((GetTouchPointCount() == 0) && IsMouseButtonDown(MOUSE_BUTTON_LEFT))) + { + // Find nearest D-Pad button to the input position + for (int i = 0; i < BUTTON_MAX; i++) { - //draw all pad - DrawCircleV((Vector2) { dpadCollider[i][0], dpadCollider[i][1] }, dpadRad, dpadColor); - if(i!=dpadKeydown) + float distX = fabsf(buttonPositions[i].x - inputPosition.x); + float distY = fabsf(buttonPositions[i].y - inputPosition.y); + + if ((distX + distY < buttonRadius)) { - //draw label - DrawText(TextSubtext(dpadLabel,i,1), - (int)dpadCollider[i][0]-7, - (int)dpadCollider[i][1]-8,20,BLACK); + pressedButton = i; + break; } } + } + + // Move player according to pressed button + switch (pressedButton) + { + case BUTTON_UP: + { + playerPosition.y -= playerSpeed*GetFrameTime(); + break; + } + case BUTTON_LEFT: + { + playerPosition.x -= playerSpeed*GetFrameTime(); + break; + } + case BUTTON_RIGHT: + { + playerPosition.x += playerSpeed*GetFrameTime(); + break; + } + case BUTTON_DOWN: + { + playerPosition.y += playerSpeed*GetFrameTime(); + break; + } + default: break; + }; + + //-------------------------------------------------------------------------- + // Draw + //-------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + // Draw world + DrawCircleV(playerPosition, 50, MAROON); + + // Draw GUI + for (int i = 0; i < BUTTON_MAX; i++) + { + DrawCircleV(buttonPositions[i], buttonRadius, (i == pressedButton)? DARKGRAY : BLACK); + + DrawText(buttonLabels[i], + (int)buttonPositions[i].x - 7, (int)buttonPositions[i].y - 8, + 20, buttonLabelColors[i]); + } + + DrawText("move the player with D-Pad buttons", 10, 10, 20, DARKGRAY); - DrawRectangleRec((Rectangle) { playerX - 4, playerY - 4, 75, 28 }, RED); - DrawText("Player", (int)playerX, (int)playerY, 20, WHITE); EndDrawing(); - //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- } // De-Initialization diff --git a/examples/core/core_input_virtual_controls.png b/examples/core/core_input_virtual_controls.png index cb1444598017b9d7ff83480f66909c8523ece519..83097a54ca46ebed8c1958e4ed7854cbbd2286a6 100644 GIT binary patch literal 1802 zcmbVMdpJ~E6hC8T@+zP+%e_WKxE0ZxyhfA4(Bm@X?laUM_s_e(Z=d~JzqR&WXRZA^=d7!<{URkTB?y8R z(P`V~I>}7;fhozAKm&ew-QV z54kb}+2MxHcJ8p5p|PQ{Z-v`J5F_ySq_gPsb&vuuh>#YJ2;l&708@J&gExlAIJ}IP z1K1cR2dRP88_d8&f{Z@|FgC^`aL{{D*pKx;Ng?3k$wLGXiEJ=Ia5v^o#WE6a%$;-z zU~I^NbLC`_Zk8JXn%`xNAei?ge?Z#S;6VlZF4MQ6?vbxPy`2eqy&Y=o#aqUjli70k zJvZ=o*ZUylUrj=ku>Q#Vl%XKesr8n#RwN`cal?d7JW3s1 zv9kBm$WC5Ey=r&#=Sou0v7BU>>0C;E^j>hOZaQUj^9;XJ6793{SO~Wc7t=N@?j!fB z9_P&`=G^~7vN-?JYJ zJsg3Xq2}mk6vr*<%)XpgW0s^}e$ktfN{;grvsHZ`zp^dKpe;d#3TgQ@Ym(BNCKNRa zy7R}50QZQp@8c+Q-~vq1*xopYanVrUv1!#j8O(%%VN!TDD)gPp_Pcy)a8{ z;2X7vO|W!kDEAfD$~ajMmM@qbmPaq>(=yF{TdXp%nmS5}k|)jIrz+B`Vd-MM=>i1o}c%RK3;IaIyA~@1uP*%es&= z3j`-H=&w-Mf`x5l$6dVu7OiSyjaip6i#G@WPJxCKZ*dmT( zKQHw3D4^>Xd*XJ*EESg^dC(I~fpG56WL!k1Ho>+p{WkQ+4=RuURUNTXm zpmK}wa}>9Xng4Wk%F4i~p^K*XNk9K3f5kgYs^*mm8>%#8V2q{PId8kY^+4ReKF!R@ literal 9094 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 H{`@}x#HYs# From 93a67417b336a4e0814d37dc37b4591f03b9588c Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Sun, 8 Dec 2024 08:46:43 -0300 Subject: [PATCH 109/194] Fix examples Makefile PLATFORM define (#4582) --- examples/Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index a65a4961e..34cf36f04 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -54,10 +54,15 @@ # Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB PLATFORM ?= PLATFORM_DESKTOP -ifeq ($(PLATFORM), PLATFORM_DESKTOP) - TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW +ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW)) + TARGET_PLATFORM := $(PLATFORM) + override PLATFORM = PLATFORM_DESKTOP else - TARGET_PLATFORM = $(PLATFORM) + ifeq ($(PLATFORM), PLATFORM_DESKTOP) + TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW + else + TARGET_PLATFORM = $(PLATFORM) + endif endif # Define required raylib variables @@ -653,7 +658,7 @@ OTHERS = \ ifeq ($(TARGET_PLATFORM), PLATFORM_DESKTOP_GFLW) OTHERS += others/rlgl_standalone endif - + CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST)) From d2cd2a01524ca5b14cfa6d72255e891c76b29bd0 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 8 Dec 2024 12:48:54 +0100 Subject: [PATCH 110/194] [rlgl][rmodels] Add instranceTransform shader location index #4538 (#4579) --- .../resources/shaders/glsl330/lighting_instancing.vs | 2 +- examples/shaders/shaders_mesh_instancing.c | 3 +-- src/config.h | 2 ++ src/raylib.h | 3 ++- src/rcore.c | 1 + src/rlgl.h | 7 +++++++ src/rmodels.c | 8 ++++---- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl330/lighting_instancing.vs b/examples/shaders/resources/shaders/glsl330/lighting_instancing.vs index 3e4da1e28..32db8cdd4 100644 --- a/examples/shaders/resources/shaders/glsl330/lighting_instancing.vs +++ b/examples/shaders/resources/shaders/glsl330/lighting_instancing.vs @@ -25,7 +25,7 @@ void main() // Send vertex attributes to fragment shader fragPosition = vec3(instanceTransform*vec4(vertexPosition, 1.0)); fragTexCoord = vertexTexCoord; - //fragColor = vertexColor; + fragColor = vec4(1.0); fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0))); // Calculate final vertex position, note that we multiply mvp by instanceTransform diff --git a/examples/shaders/shaders_mesh_instancing.c b/examples/shaders/shaders_mesh_instancing.c index eb42cb471..1e0bf0696 100644 --- a/examples/shaders/shaders_mesh_instancing.c +++ b/examples/shaders/shaders_mesh_instancing.c @@ -61,7 +61,7 @@ int main(void) { Matrix translation = MatrixTranslate((float)GetRandomValue(-50, 50), (float)GetRandomValue(-50, 50), (float)GetRandomValue(-50, 50)); Vector3 axis = Vector3Normalize((Vector3){ (float)GetRandomValue(0, 360), (float)GetRandomValue(0, 360), (float)GetRandomValue(0, 360) }); - float angle = (float)GetRandomValue(0, 10)*DEG2RAD; + float angle = (float)GetRandomValue(0, 180)*DEG2RAD; Matrix rotation = MatrixRotate(axis, angle); transforms[i] = MatrixMultiply(rotation, translation); @@ -73,7 +73,6 @@ int main(void) // Get shader locations shader.locs[SHADER_LOC_MATRIX_MVP] = GetShaderLocation(shader, "mvp"); shader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos"); - shader.locs[SHADER_LOC_MATRIX_MODEL] = GetShaderLocationAttrib(shader, "instanceTransform"); // Set shader value: ambient light level int ambientLoc = GetShaderLocation(shader, "ambient"); diff --git a/src/config.h b/src/config.h index d8f7112eb..74e0a1353 100644 --- a/src/config.h +++ b/src/config.h @@ -151,6 +151,8 @@ #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS 7 #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS 8 #endif +#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCE_TX 9 + // Default shader vertex attribute names to set location points // NOTE: When a new shader is loaded, the following locations are tried to be set for convenience diff --git a/src/raylib.h b/src/raylib.h index 641bd10e0..73c8cca5d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -801,7 +801,8 @@ typedef enum { SHADER_LOC_MAP_BRDF, // Shader location: sampler2d texture: brdf SHADER_LOC_VERTEX_BONEIDS, // Shader location: vertex attribute: boneIds SHADER_LOC_VERTEX_BONEWEIGHTS, // Shader location: vertex attribute: boneWeights - SHADER_LOC_BONE_MATRICES // Shader location: array of matrices uniform: boneMatrices + SHADER_LOC_BONE_MATRICES, // Shader location: array of matrices uniform: boneMatrices + SHADER_LOC_VERTEX_INSTANCE_TX // Shader location: vertex attribute: instanceTransform } ShaderLocationIndex; #define SHADER_LOC_MAP_DIFFUSE SHADER_LOC_MAP_ALBEDO diff --git a/src/rcore.c b/src/rcore.c index bcff5acb0..d69fa0f6c 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1346,6 +1346,7 @@ Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode) shader.locs[SHADER_LOC_VERTEX_COLOR] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR); shader.locs[SHADER_LOC_VERTEX_BONEIDS] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_BONEIDS); shader.locs[SHADER_LOC_VERTEX_BONEWEIGHTS] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS); + shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] = rlGetLocationAttrib(shader.id, RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCE_TX); // Get handles to GLSL uniform locations (vertex shader) shader.locs[SHADER_LOC_MATRIX_MVP] = rlGetLocationUniform(shader.id, RL_DEFAULT_SHADER_UNIFORM_NAME_MVP); diff --git a/src/rlgl.h b/src/rlgl.h index c08623de3..b09b04b18 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -355,6 +355,9 @@ #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS 8 #endif #endif +#ifndef RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCE_TX + #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCE_TX 9 +#endif //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -998,6 +1001,9 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS "vertexBoneWeights" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS #endif +#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCE_TX + #define RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCE_TX "instanceTransform" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCE_TX +#endif #ifndef RL_DEFAULT_SHADER_UNIFORM_NAME_MVP #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix @@ -4216,6 +4222,7 @@ unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId) glBindAttribLocation(program, RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR, RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR); glBindAttribLocation(program, RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT, RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT); glBindAttribLocation(program, RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2, RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2); + glBindAttribLocation(program, RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCE_TX, RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCE_TX); #ifdef RL_SUPPORT_MESH_GPU_SKINNING glBindAttribLocation(program, RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS, RL_DEFAULT_SHADER_ATTRIB_NAME_BONEIDS); diff --git a/src/rmodels.c b/src/rmodels.c index 24f4a4fc9..a159d5432 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1734,12 +1734,12 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i // no faster, since we're transferring all the transform matrices anyway instancesVboId = rlLoadVertexBuffer(instanceTransforms, instances*sizeof(float16), false); - // Instances transformation matrices are send to shader attribute location: SHADER_LOC_MATRIX_MODEL + // Instances transformation matrices are sent to shader attribute location: SHADER_LOC_VERTEX_INSTANCE_TX for (unsigned int i = 0; i < 4; i++) { - rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_MATRIX_MODEL] + i); - rlSetVertexAttribute(material.shader.locs[SHADER_LOC_MATRIX_MODEL] + i, 4, RL_FLOAT, 0, sizeof(Matrix), i*sizeof(Vector4)); - rlSetVertexAttributeDivisor(material.shader.locs[SHADER_LOC_MATRIX_MODEL] + i, 1); + rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] + i); + rlSetVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] + i, 4, RL_FLOAT, 0, sizeof(Matrix), i*sizeof(Vector4)); + rlSetVertexAttributeDivisor(material.shader.locs[SHADER_LOC_VERTEX_INSTANCE_TX] + i, 1); } rlDisableVertexBuffer(); From 732da949b72a629fbd6b7e7f9fcab3d88f8355ee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 8 Dec 2024 11:49:07 +0000 Subject: [PATCH 111/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 5 +++++ parser/output/raylib_api.lua | 5 +++++ parser/output/raylib_api.txt | 3 ++- parser/output/raylib_api.xml | 3 ++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 3eb438392..9614f0cac 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -2543,6 +2543,11 @@ "name": "SHADER_LOC_BONE_MATRICES", "value": 28, "description": "Shader location: array of matrices uniform: boneMatrices" + }, + { + "name": "SHADER_LOC_VERTEX_INSTANCE_TX", + "value": 29, + "description": "Shader location: vertex attribute: instanceTransform" } ] }, diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index da3faf073..00547334e 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -2543,6 +2543,11 @@ return { name = "SHADER_LOC_BONE_MATRICES", value = 28, description = "Shader location: array of matrices uniform: boneMatrices" + }, + { + name = "SHADER_LOC_VERTEX_INSTANCE_TX", + value = 29, + description = "Shader location: vertex attribute: instanceTransform" } } }, diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 5c7c38701..09dc8cfeb 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -795,7 +795,7 @@ Enum 08: MaterialMapIndex (11 values) Value[MATERIAL_MAP_IRRADIANCE]: 8 Value[MATERIAL_MAP_PREFILTER]: 9 Value[MATERIAL_MAP_BRDF]: 10 -Enum 09: ShaderLocationIndex (29 values) +Enum 09: ShaderLocationIndex (30 values) Name: ShaderLocationIndex Description: Shader location index Value[SHADER_LOC_VERTEX_POSITION]: 0 @@ -827,6 +827,7 @@ Enum 09: ShaderLocationIndex (29 values) Value[SHADER_LOC_VERTEX_BONEIDS]: 26 Value[SHADER_LOC_VERTEX_BONEWEIGHTS]: 27 Value[SHADER_LOC_BONE_MATRICES]: 28 + Value[SHADER_LOC_VERTEX_INSTANCE_TX]: 29 Enum 10: ShaderUniformDataType (9 values) Name: ShaderUniformDataType Description: Shader uniform data type diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 81cb6a371..9e870437f 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -507,7 +507,7 @@ - + @@ -537,6 +537,7 @@ + From 2a2acff2d5208b443f6303fc18efe8946c35be06 Mon Sep 17 00:00:00 2001 From: Rico P Date: Sun, 8 Dec 2024 12:52:06 +0100 Subject: [PATCH 112/194] Make sure ShaderUniformDataType matches rlShaderUniformDataType (#4577) * Make sure ShaderUniformDataType matches rlShaderUniformDataType * Update raylib_api.* by CI --------- Co-authored-by: github-actions[bot] Co-authored-by: Ray --- parser/output/raylib_api.json | 22 +++++++++++++++++++++- parser/output/raylib_api.lua | 22 +++++++++++++++++++++- parser/output/raylib_api.txt | 9 ++++++--- parser/output/raylib_api.xml | 8 ++++++-- src/raylib.h | 4 ++++ 5 files changed, 58 insertions(+), 7 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 9614f0cac..e05d8a748 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -2596,8 +2596,28 @@ "description": "Shader uniform type: ivec4 (4 int)" }, { - "name": "SHADER_UNIFORM_SAMPLER2D", + "name": "SHADER_UNIFORM_UINT", "value": 8, + "description": "Shader uniform type: unsigned int" + }, + { + "name": "SHADER_UNIFORM_UIVEC2", + "value": 9, + "description": "Shader uniform type: uivec2 (2 unsigned int)" + }, + { + "name": "SHADER_UNIFORM_UIVEC3", + "value": 10, + "description": "Shader uniform type: uivec3 (3 unsigned int)" + }, + { + "name": "SHADER_UNIFORM_UIVEC4", + "value": 11, + "description": "Shader uniform type: uivec4 (4 unsigned int)" + }, + { + "name": "SHADER_UNIFORM_SAMPLER2D", + "value": 12, "description": "Shader uniform type: sampler2d" } ] diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 00547334e..d8a848b45 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -2596,8 +2596,28 @@ return { description = "Shader uniform type: ivec4 (4 int)" }, { - name = "SHADER_UNIFORM_SAMPLER2D", + name = "SHADER_UNIFORM_UINT", value = 8, + description = "Shader uniform type: unsigned int" + }, + { + name = "SHADER_UNIFORM_UIVEC2", + value = 9, + description = "Shader uniform type: uivec2 (2 unsigned int)" + }, + { + name = "SHADER_UNIFORM_UIVEC3", + value = 10, + description = "Shader uniform type: uivec3 (3 unsigned int)" + }, + { + name = "SHADER_UNIFORM_UIVEC4", + value = 11, + description = "Shader uniform type: uivec4 (4 unsigned int)" + }, + { + name = "SHADER_UNIFORM_SAMPLER2D", + value = 12, description = "Shader uniform type: sampler2d" } } diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 09dc8cfeb..d3b6eb895 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -827,8 +827,7 @@ Enum 09: ShaderLocationIndex (30 values) Value[SHADER_LOC_VERTEX_BONEIDS]: 26 Value[SHADER_LOC_VERTEX_BONEWEIGHTS]: 27 Value[SHADER_LOC_BONE_MATRICES]: 28 - Value[SHADER_LOC_VERTEX_INSTANCE_TX]: 29 -Enum 10: ShaderUniformDataType (9 values) +Enum 10: ShaderUniformDataType (13 values) Name: ShaderUniformDataType Description: Shader uniform data type Value[SHADER_UNIFORM_FLOAT]: 0 @@ -839,7 +838,11 @@ Enum 10: ShaderUniformDataType (9 values) Value[SHADER_UNIFORM_IVEC2]: 5 Value[SHADER_UNIFORM_IVEC3]: 6 Value[SHADER_UNIFORM_IVEC4]: 7 - Value[SHADER_UNIFORM_SAMPLER2D]: 8 + Value[SHADER_UNIFORM_UINT]: 8 + Value[SHADER_UNIFORM_UIVEC2]: 9 + Value[SHADER_UNIFORM_UIVEC3]: 10 + Value[SHADER_UNIFORM_UIVEC4]: 11 + Value[SHADER_UNIFORM_SAMPLER2D]: 12 Enum 11: ShaderAttributeDataType (4 values) Name: ShaderAttributeDataType Description: Shader attribute data types diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 9e870437f..e1b1f35e2 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -539,7 +539,7 @@ - + @@ -548,7 +548,11 @@ - + + + + + diff --git a/src/raylib.h b/src/raylib.h index 73c8cca5d..7482d4392 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -818,6 +818,10 @@ typedef enum { SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int) SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int) SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int) + SHADER_UNIFORM_UINT, // Shader uniform type: unsigned int + SHADER_UNIFORM_UIVEC2, // Shader uniform type: uivec2 (2 unsigned int) + SHADER_UNIFORM_UIVEC3, // Shader uniform type: uivec3 (3 unsigned int) + SHADER_UNIFORM_UIVEC4, // Shader uniform type: uivec4 (4 unsigned int) SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d } ShaderUniformDataType; From 83f6f3dabeb14b8f5268bf3abdcc898f50cfeb17 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 8 Dec 2024 11:52:21 +0000 Subject: [PATCH 113/194] Update raylib_api.* by CI --- parser/output/raylib_api.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index d3b6eb895..7c7b003c4 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -827,6 +827,7 @@ Enum 09: ShaderLocationIndex (30 values) Value[SHADER_LOC_VERTEX_BONEIDS]: 26 Value[SHADER_LOC_VERTEX_BONEWEIGHTS]: 27 Value[SHADER_LOC_BONE_MATRICES]: 28 + Value[SHADER_LOC_VERTEX_INSTANCE_TX]: 29 Enum 10: ShaderUniformDataType (13 values) Name: ShaderUniformDataType Description: Shader uniform data type From aeb33e6301fd614e1f38aed66ab6b219a824df3c Mon Sep 17 00:00:00 2001 From: Legendary Redfox <128002430+legendaryredfox@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:24:02 -0300 Subject: [PATCH 114/194] Adding my bindings to the list (#4586) * updated raylib-lua version * Updated some bindings * removed 404 bindings * adding my bindings project to the list --- BINDINGS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 873e6af0e..ccba2dd2b 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -42,7 +42,8 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** | | [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | | [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC | -| [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | MIT | +| [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC | +| [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | **???** | | [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib | | [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 5.6-dev | [Ruby](https://www.ruby-lang.org/en) | Zlib | | [naylib](https://github.com/planetis-m/naylib) | **5.1-dev** | [Nim](https://nim-lang.org) | MIT | From b747eeefa4542cb1737997498991273d7a559d3f Mon Sep 17 00:00:00 2001 From: Legendary Redfox <128002430+legendaryredfox@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:05:46 -0300 Subject: [PATCH 115/194] [documentation] Adding a related project (#4589) * updated raylib-lua version * Updated some bindings * removed 404 bindings * adding my bindings project to the list * Adding a related project * fixing the license foi ReiLua --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index ccba2dd2b..56c7e79c1 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -43,6 +43,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib | | [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC | | [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC | +| [ReiLua](https://github.com/nullstare/ReiLua) | 5.5 | [Lua](http://www.lua.org) | MIT | | [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | **???** | | [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib | | [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 5.6-dev | [Ruby](https://www.ruby-lang.org/en) | Zlib | From 6b220f2798837687599d54c690d65dcc4a6a7161 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 12 Dec 2024 12:13:17 +0100 Subject: [PATCH 116/194] Review formating --- src/platforms/rcore_android.c | 6 +++--- src/platforms/rcore_desktop_rgfw.c | 14 +++++++------- src/platforms/rcore_desktop_sdl.c | 6 +++--- src/platforms/rcore_drm.c | 6 +++--- src/platforms/rcore_web.c | 10 +++++----- src/rcore.c | 2 +- src/rtextures.c | 5 +---- 7 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 47dc5cabc..4528c810d 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -699,7 +699,7 @@ void PollInputEvents(void) // Poll Events (registered events) until we reach TIMEOUT which indicates there are no events left to poll // NOTE: Activity is paused if not enabled (platform.appEnabled) - while ((pollResult = ALooper_pollOnce(platform.appEnabled? 0 : -1, NULL, &pollEvents, (void**)&platform.source)) > ALOOPER_POLL_TIMEOUT) + while ((pollResult = ALooper_pollOnce(platform.appEnabled? 0 : -1, NULL, &pollEvents, ((void **)&platform.source)) > ALOOPER_POLL_TIMEOUT)) { // Process this event if (platform.source != NULL) platform.source->process(platform.app, platform.source); @@ -786,7 +786,7 @@ int InitPlatform(void) while (!CORE.Window.ready) { // Process events until we reach TIMEOUT, which indicates no more events queued. - while ((pollResult = ALooper_pollOnce(0, NULL, &pollEvents, (void**)&platform.source)) > ALOOPER_POLL_TIMEOUT) + while ((pollResult = ALooper_pollOnce(0, NULL, &pollEvents, ((void **)&platform.source)) > ALOOPER_POLL_TIMEOUT)) { // Process this event if (platform.source != NULL) platform.source->process(platform.app, platform.source); @@ -1226,7 +1226,7 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) return 1; // Handled gamepad button } - KeyboardKey key = (keycode > 0 && keycode < KEYCODE_MAP_SIZE)? mapKeycode[keycode] : KEY_NULL; + KeyboardKey key = ((keycode > 0) && (keycode < KEYCODE_MAP_SIZE))? mapKeycode[keycode] : KEY_NULL; if (key != KEY_NULL) { // Save current key and its state diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 913223511..a6ef60c9e 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -485,7 +485,7 @@ void SetWindowIcons(Image *images, int count) // Set title for window void SetWindowTitle(const char *title) { - RGFW_window_setName(platform.window, (char*)title); + RGFW_window_setName(platform.window, (char *)title); CORE.Window.title = title; } @@ -542,9 +542,9 @@ void SetWindowFocused(void) void *GetWindowHandle(void) { #ifdef RGFW_WEBASM - return (void*)platform.window->src.ctx; + return (void *)platform.window->src.ctx; #else - return (void*)platform.window->src.window; + return (void *)platform.window->src.window; #endif } @@ -587,7 +587,7 @@ Vector2 GetMonitorPosition(int monitor) { RGFW_monitor *mons = RGFW_getMonitors(); - return (Vector2){(float)mons[monitor].rect.x, (float)mons[monitor].rect.y}; + return (Vector2){ (float)mons[monitor].rect.x, (float)mons[monitor].rect.y }; } // Get selected monitor width (currently used by monitor) @@ -609,7 +609,7 @@ int GetMonitorHeight(int monitor) // Get selected monitor physical width in millimetres int GetMonitorPhysicalWidth(int monitor) { - RGFW_monitor* mons = RGFW_getMonitors(); + RGFW_monitor *mons = RGFW_getMonitors(); return (int)mons[monitor].physW; } @@ -654,7 +654,7 @@ Vector2 GetWindowScaleDPI(void) // Set clipboard text content void SetClipboardText(const char *text) { - RGFW_writeClipboard(text, (u32)strlen(text)); + RGFW_writeClipboard(text, strlen(text)); } // Get clipboard text content @@ -1336,7 +1336,7 @@ int InitPlatform(void) // Load OpenGL extensions // NOTE: GL procedures address loader is required to load extensions //---------------------------------------------------------------------------- - rlLoadExtensions((void*)RGFW_getProcAddress); + rlLoadExtensions((void *)RGFW_getProcAddress); //---------------------------------------------------------------------------- // TODO: Initialize input events system diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 99de9af22..d051ae83f 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -68,7 +68,7 @@ #define MAX_CLIPBOARD_BUFFER_LENGTH 1024 // Size of the clipboard buffer used on GetClipboardText() #endif -#if ((defined(SDL_MAJOR_VERSION) && SDL_MAJOR_VERSION == 3) && (defined(SDL_MINOR_VERSION) && SDL_MINOR_VERSION >= 1)) +#if ((defined(SDL_MAJOR_VERSION) && (SDL_MAJOR_VERSION == 3)) && (defined(SDL_MINOR_VERSION) && (SDL_MINOR_VERSION >= 1))) #ifndef PLATFORM_DESKTOP_SDL3 #define PLATFORM_DESKTOP_SDL3 #endif @@ -405,7 +405,7 @@ int SDL_GetNumTouchFingers(SDL_TouchID touchID) // Since SDL2 doesn't have this function we leave a stub // SDL_GetClipboardData function is available since SDL 3.1.3. (e.g. SDL3) -void* SDL_GetClipboardData(const char *mime_type, size_t *size) +void *SDL_GetClipboardData(const char *mime_type, size_t *size) { TRACELOG(LOG_WARNING, "Getting clipboard data that is not text is only available in SDL3"); @@ -1971,7 +1971,7 @@ void ClosePlatform(void) // Scancode to keycode mapping static KeyboardKey ConvertScancodeToKey(SDL_Scancode sdlScancode) { - if (sdlScancode >= 0 && sdlScancode < SCANCODE_MAPPED_NUM) + if ((sdlScancode >= 0) && (sdlScancode < SCANCODE_MAPPED_NUM)) { return mapScancodeToKey[sdlScancode]; } diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index e9a236868..425b1d4a6 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -1529,7 +1529,7 @@ static void ConfigureEvdevDevice(char *device) platform.absRange.height = absinfo[ABS_Y].info.maximum - absinfo[ABS_Y].info.minimum; } } - else if (isGamepad && !isMouse && !isKeyboard && platform.gamepadCount < MAX_GAMEPADS) + else if (isGamepad && !isMouse && !isKeyboard && (platform.gamepadCount < MAX_GAMEPADS)) { deviceKindStr = "gamepad"; int index = platform.gamepadCount++; @@ -1893,7 +1893,7 @@ static int FindExactConnectorMode(const drmModeConnector *connector, uint width, TRACELOG(LOG_TRACE, "DISPLAY: DRM Mode %d %ux%u@%u %s", i, mode->hdisplay, mode->vdisplay, mode->vrefresh, (mode->flags & DRM_MODE_FLAG_INTERLACE)? "interlaced" : "progressive"); - if ((mode->flags & DRM_MODE_FLAG_INTERLACE) && (!allowInterlaced)) continue; + if ((mode->flags & DRM_MODE_FLAG_INTERLACE) && !allowInterlaced) continue; if ((mode->hdisplay == width) && (mode->vdisplay == height) && (mode->vrefresh == fps)) return i; } @@ -1923,7 +1923,7 @@ static int FindNearestConnectorMode(const drmModeConnector *connector, uint widt continue; } - if ((mode->flags & DRM_MODE_FLAG_INTERLACE) && (!allowInterlaced)) + if ((mode->flags & DRM_MODE_FLAG_INTERLACE) && !allowInterlaced) { TRACELOG(LOG_TRACE, "DISPLAY: DRM shouldn't choose an interlaced mode"); continue; diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index d0be02514..d28ed55c2 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -319,7 +319,7 @@ void ToggleBorderlessWindowed(void) // Set window state: maximized, if resizable void MaximizeWindow(void) { - if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE && !(CORE.Window.flags & FLAG_WINDOW_MAXIMIZED)) + if ((glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE) && !(CORE.Window.flags & FLAG_WINDOW_MAXIMIZED)) { platform.unmaximizedWidth = CORE.Window.screen.width; platform.unmaximizedHeight = CORE.Window.screen.height; @@ -342,7 +342,7 @@ void MinimizeWindow(void) // Set window state: not minimized/maximized void RestoreWindow(void) { - if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE && (CORE.Window.flags & FLAG_WINDOW_MAXIMIZED)) + if ((glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE) && (CORE.Window.flags & FLAG_WINDOW_MAXIMIZED)) { if (platform.unmaximizedWidth && platform.unmaximizedHeight) glfwSetWindowSize(platform.handle, platform.unmaximizedWidth, platform.unmaximizedHeight); @@ -1664,10 +1664,10 @@ static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent * int height = EM_ASM_INT( return window.innerHeight; ); if (width < (int)CORE.Window.screenMin.width) width = CORE.Window.screenMin.width; - else if (width > (int)CORE.Window.screenMax.width && CORE.Window.screenMax.width > 0) width = CORE.Window.screenMax.width; + else if ((width > (int)CORE.Window.screenMax.width) && (CORE.Window.screenMax.width > 0)) width = CORE.Window.screenMax.width; if (height < (int)CORE.Window.screenMin.height) height = CORE.Window.screenMin.height; - else if (height > (int)CORE.Window.screenMax.height && CORE.Window.screenMax.height > 0) height = CORE.Window.screenMax.height; + else if ((height > (int)CORE.Window.screenMax.height) && (CORE.Window.screenMax.height > 0)) height = CORE.Window.screenMax.height; emscripten_set_canvas_element_size("#canvas", width, height); @@ -1722,7 +1722,7 @@ static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadE for (int i = 0; i < gamepadEvent->numButtons; ++i) TRACELOGD("Button %d: Digital: %d, Analog: %g", i, gamepadEvent->digitalButton[i], gamepadEvent->analogButton[i]); */ - if ((gamepadEvent->connected) && (gamepadEvent->index < MAX_GAMEPADS)) + if (gamepadEvent->connected && (gamepadEvent->index < MAX_GAMEPADS)) { CORE.Input.Gamepad.ready[gamepadEvent->index] = true; sprintf(CORE.Input.Gamepad.name[gamepadEvent->index], "%s", gamepadEvent->id); diff --git a/src/rcore.c b/src/rcore.c index d69fa0f6c..571abf97c 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2063,7 +2063,7 @@ const char *GetDirectoryPath(const char *filePath) // In case provided path does not contain a root drive letter (C:\, D:\) nor leading path separator (\, /), // we add the current directory path to dirPath - if (filePath[1] != ':' && filePath[0] != '\\' && filePath[0] != '/') + if ((filePath[1] != ':') && (filePath[0] != '\\') && (filePath[0] != '/')) { // For security, we set starting path to current directory, // obtained path will be concatenated to this diff --git a/src/rtextures.c b/src/rtextures.c index 57ee57604..06f81e577 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -833,10 +833,7 @@ Image GenImageGradientLinear(int width, int height, int direction, Color start, // bottom-right or vice-versa), pixel (0, 0) is the farthest point on the gradient // (i.e. the pixel which should become one of the gradient's ends color); while for // directions that lie in the second or fourth quadrant, that point is pixel (width, 0). - float maxPosValue = - ((signbit(sinDir) != 0) == (signbit(cosDir) != 0)) - ? fabsf(startingPos) - : fabsf(startingPos+width*cosDir); + float maxPosValue = ((signbit(sinDir) != 0) == (signbit(cosDir) != 0))? fabsf(startingPos) : fabsf(startingPos + width*cosDir); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) From 1f704be4e4aba6b25e56bde3c30cc136b6e94049 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 12 Dec 2024 12:13:38 +0100 Subject: [PATCH 117/194] Review comments spacing for better alignment --- src/raylib.h | 125 +++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 63 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 7482d4392..dcaaa44c7 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1155,20 +1155,19 @@ RLAPI unsigned char *CompressData(const unsigned char *data, int dataSize, int * RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree() RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree() RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() -RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code -RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes) -RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) - +RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code +RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes) +RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) // Automation events functionality -RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS -RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file -RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file -RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to -RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording -RLAPI void StartAutomationEventRecording(void); // Start recording automation events (AutomationEventList must be set) -RLAPI void StopAutomationEventRecording(void); // Stop recording automation events -RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event +RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS +RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file +RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file +RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to +RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording +RLAPI void StartAutomationEventRecording(void); // Start recording automation events (AutomationEventList must be set) +RLAPI void StopAutomationEventRecording(void); // Stop recording automation events +RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event //------------------------------------------------------------------------------------ // Input Handling Functions (Module: core) @@ -1186,16 +1185,16 @@ RLAPI const char *GetKeyName(int key); // Get name of a Q RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) // Input-related functions: gamepads -RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available -RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id -RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once -RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed -RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once -RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed -RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed -RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad -RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis -RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) +RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available +RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id +RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once +RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed +RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once +RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed +RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed +RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad +RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis +RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds) // Input-related functions: mouse @@ -1224,19 +1223,19 @@ RLAPI int GetTouchPointCount(void); // Get number of t //------------------------------------------------------------------------------------ // Gestures and Touch Handling Functions (Module: rgestures) //------------------------------------------------------------------------------------ -RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags -RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected -RLAPI int GetGestureDetected(void); // Get latest detected gesture -RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in seconds -RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector -RLAPI float GetGestureDragAngle(void); // Get gesture drag angle -RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta -RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle +RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags +RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected +RLAPI int GetGestureDetected(void); // Get latest detected gesture +RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in seconds +RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector +RLAPI float GetGestureDragAngle(void); // Get gesture drag angle +RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta +RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle //------------------------------------------------------------------------------------ // Camera System Functions (Module: rcamera) //------------------------------------------------------------------------------------ -RLAPI void UpdateCamera(Camera *camera, int mode); // Update camera position for selected mode +RLAPI void UpdateCamera(Camera *camera, int mode); // Update camera position for selected mode RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, float zoom); // Update camera movement/rotation //------------------------------------------------------------------------------------ @@ -1245,9 +1244,9 @@ RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, f // Set texture and rectangle to be used on shapes drawing // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call -RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing -RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing -RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing +RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing +RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing +RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing // Basic shapes drawing functions RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel using geometry [Can be slow, use with care] @@ -1289,11 +1288,11 @@ RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters // Splines drawing functions -RLAPI void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points -RLAPI void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points -RLAPI void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points -RLAPI void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] -RLAPI void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] +RLAPI void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points +RLAPI void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points +RLAPI void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points +RLAPI void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] +RLAPI void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] RLAPI void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color); // Draw spline segment: Linear, 2 points RLAPI void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: B-Spline, 4 points RLAPI void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: Catmull-Rom, 4 points @@ -1492,15 +1491,15 @@ RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found // Text codepoints management functions (unicode characters) -RLAPI char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array -RLAPI void UnloadUTF8(char *text); // Unload UTF-8 text encoded from codepoints array -RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter -RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory -RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string -RLAPI int GetCodepoint(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure -RLAPI int GetCodepointNext(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure -RLAPI int GetCodepointPrevious(const char *text, int *codepointSize); // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure -RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) +RLAPI char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array +RLAPI void UnloadUTF8(char *text); // Unload UTF-8 text encoded from codepoints array +RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter +RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory +RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string +RLAPI int GetCodepoint(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure +RLAPI int GetCodepointNext(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure +RLAPI int GetCodepointPrevious(const char *text, int *codepointSize); // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure +RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) // Text strings management functions (no UTF-8 strings, only byte chars) // NOTE: Some strings allocate memory internally for returned strings, just be careful! @@ -1515,14 +1514,14 @@ RLAPI const char *TextJoin(const char **textList, int count, const char *delimit RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string -RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string -RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string -RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string -RLAPI const char *TextToSnake(const char *text); // Get Snake case notation version of provided string -RLAPI const char *TextToCamel(const char *text); // Get Camel case notation version of provided string +RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string +RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string +RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI const char *TextToSnake(const char *text); // Get Snake case notation version of provided string +RLAPI const char *TextToCamel(const char *text); // Get Camel case notation version of provided string -RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) -RLAPI float TextToFloat(const char *text); // Get float value from text (negative values not supported) +RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) +RLAPI float TextToFloat(const char *text); // Get float value from text (negative values not supported) //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) @@ -1615,14 +1614,14 @@ RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match // Collision detection functions -RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres -RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes -RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere -RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere -RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box -RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh -RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle -RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad +RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres +RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes +RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere +RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere +RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box +RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh +RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle +RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) From 8a5a95c13a899564b98483f356d51a3024586870 Mon Sep 17 00:00:00 2001 From: __hexmaster111 Date: Fri, 13 Dec 2024 02:21:13 -0600 Subject: [PATCH 118/194] Removed inaccurate comment about negitves not being supported with TextToFloat And TextToInt Methods (#4596) --- src/raylib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index dcaaa44c7..7e1a1f838 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1520,8 +1520,8 @@ RLAPI const char *TextToPascal(const char *text); RLAPI const char *TextToSnake(const char *text); // Get Snake case notation version of provided string RLAPI const char *TextToCamel(const char *text); // Get Camel case notation version of provided string -RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) -RLAPI float TextToFloat(const char *text); // Get float value from text (negative values not supported) +RLAPI int TextToInteger(const char *text); // Get integer value from text +RLAPI float TextToFloat(const char *text); // Get float value from text //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) From 0a26d9a26f1ddd734ee844bc6730dc91aad4c1c3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 13 Dec 2024 08:21:27 +0000 Subject: [PATCH 119/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 4 ++-- parser/output/raylib_api.lua | 4 ++-- parser/output/raylib_api.txt | 4 ++-- parser/output/raylib_api.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index e05d8a748..853f591d4 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -9801,7 +9801,7 @@ }, { "name": "TextToInteger", - "description": "Get integer value from text (negative values not supported)", + "description": "Get integer value from text", "returnType": "int", "params": [ { @@ -9812,7 +9812,7 @@ }, { "name": "TextToFloat", - "description": "Get float value from text (negative values not supported)", + "description": "Get float value from text", "returnType": "float", "params": [ { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index d8a848b45..2983456f3 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -6969,7 +6969,7 @@ return { }, { name = "TextToInteger", - description = "Get integer value from text (negative values not supported)", + description = "Get integer value from text", returnType = "int", params = { {type = "const char *", name = "text"} @@ -6977,7 +6977,7 @@ return { }, { name = "TextToFloat", - description = "Get float value from text (negative values not supported)", + description = "Get float value from text", returnType = "float", params = { {type = "const char *", name = "text"} diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 7c7b003c4..038b43e17 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -3757,12 +3757,12 @@ Function 438: TextToCamel() (1 input parameters) Function 439: TextToInteger() (1 input parameters) Name: TextToInteger Return type: int - Description: Get integer value from text (negative values not supported) + Description: Get integer value from text Param[1]: text (type: const char *) Function 440: TextToFloat() (1 input parameters) Name: TextToFloat Return type: float - Description: Get float value from text (negative values not supported) + Description: Get float value from text Param[1]: text (type: const char *) Function 441: DrawLine3D() (3 input parameters) Name: DrawLine3D diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index e1b1f35e2..734f96465 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -2487,10 +2487,10 @@ - + - + From 93a1e75741175b9a2136593064b3714e79a363e2 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Fri, 13 Dec 2024 00:21:45 -0800 Subject: [PATCH 120/194] Disable the threading example in MSVC for release and debug build (was disabled for dll builds already) (#4594) --- projects/VS2022/raylib.sln | 4 ---- 1 file changed, 4 deletions(-) diff --git a/projects/VS2022/raylib.sln b/projects/VS2022/raylib.sln index 5142c14a1..feb0f2c35 100644 --- a/projects/VS2022/raylib.sln +++ b/projects/VS2022/raylib.sln @@ -693,16 +693,12 @@ Global {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x64.ActiveCfg = Debug|x64 - {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x64.Build.0 = Debug|x64 {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x86.ActiveCfg = Debug|Win32 - {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Debug|x86.Build.0 = Debug|Win32 {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release.DLL|x64.ActiveCfg = Release.DLL|x64 {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release.DLL|x86.Build.0 = Release.DLL|Win32 {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x64.ActiveCfg = Release|x64 - {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x64.Build.0 = Release|x64 {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x86.ActiveCfg = Release|Win32 - {F026020F-7B00-40C8-91C3-5DE85EC45A95}.Release|x86.Build.0 = Release|Win32 {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64 {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x64.Build.0 = Debug.DLL|x64 {6B8BAAF1-75C7-4C68-80B8-0E2A9EABBD9A}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 From d0504800d2c5a5e722a65a9023ddadca17f930bc Mon Sep 17 00:00:00 2001 From: Per Hallsmark Date: Sun, 15 Dec 2024 11:16:08 +0100 Subject: [PATCH 121/194] install rcamera.h (#4603) Signed-off-by: Per Hallsmark --- build.zig | 1 + src/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/build.zig b/build.zig index 866e70034..66e8fab4f 100644 --- a/build.zig +++ b/build.zig @@ -401,6 +401,7 @@ pub fn build(b: *std.Build) !void { const lib = try compileRaylib(b, target, optimize, Options.getOptions(b)); lib.installHeader(b.path("src/raylib.h"), "raylib.h"); + lib.installHeader(b.path("src/rcamera.h"), "rcamera.h"); lib.installHeader(b.path("src/raymath.h"), "raymath.h"); lib.installHeader(b.path("src/rlgl.h"), "rlgl.h"); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9735e267f..a7313a0b4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,6 +23,7 @@ endif() # Used as public API to be included into other projects set(raylib_public_headers raylib.h + rcamera.h rlgl.h raymath.h ) From 79facde3535af1f35942eec38f02f2851de618ab Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Mon, 16 Dec 2024 00:51:42 +0100 Subject: [PATCH 122/194] fix `rlActiveDrawBuffers` for OpenGL ES 3 (#4605) --- src/rlgl.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index b09b04b18..857e97511 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -1890,16 +1890,6 @@ void rlActiveDrawBuffers(int count) else { unsigned int buffers[8] = { -#if defined(GRAPHICS_API_OPENGL_ES3) - GL_COLOR_ATTACHMENT0_EXT, - GL_COLOR_ATTACHMENT1_EXT, - GL_COLOR_ATTACHMENT2_EXT, - GL_COLOR_ATTACHMENT3_EXT, - GL_COLOR_ATTACHMENT4_EXT, - GL_COLOR_ATTACHMENT5_EXT, - GL_COLOR_ATTACHMENT6_EXT, - GL_COLOR_ATTACHMENT7_EXT, -#else GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2, @@ -1908,14 +1898,9 @@ void rlActiveDrawBuffers(int count) GL_COLOR_ATTACHMENT5, GL_COLOR_ATTACHMENT6, GL_COLOR_ATTACHMENT7, -#endif }; -#if defined(GRAPHICS_API_OPENGL_ES3) - glDrawBuffersEXT(count, buffers); -#else glDrawBuffers(count, buffers); -#endif } } else TRACELOG(LOG_WARNING, "GL: One color buffer active by default"); From bdfbd6e8cc77b755d6552f90028ba8262d79ab92 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Mon, 16 Dec 2024 18:19:00 -0300 Subject: [PATCH 123/194] Fix maximizing, minimizing and restoring windows for SDL2 (#4607) --- src/platforms/rcore_desktop_sdl.c | 48 +++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index d051ae83f..de93a1f5e 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -497,20 +497,21 @@ void ToggleBorderlessWindowed(void) void MaximizeWindow(void) { SDL_MaximizeWindow(platform.window); - CORE.Window.flags |= FLAG_WINDOW_MAXIMIZED; + if ((CORE.Window.flags & FLAG_WINDOW_MAXIMIZED) == 0) CORE.Window.flags |= FLAG_WINDOW_MAXIMIZED; } // Set window state: minimized void MinimizeWindow(void) { SDL_MinimizeWindow(platform.window); - CORE.Window.flags |= FLAG_WINDOW_MINIMIZED; + if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) == 0) CORE.Window.flags |= FLAG_WINDOW_MINIMIZED; } // Set window state: not minimized/maximized void RestoreWindow(void) { - SDL_ShowWindow(platform.window); + SDL_RestoreWindow(platform.window); + // CORE.Window.flags will be removed on PollInputEvents() } // Set window configuration state using flags @@ -1448,6 +1449,22 @@ void PollInputEvents(void) CORE.Window.currentFbo.width = width; CORE.Window.currentFbo.height = height; CORE.Window.resizedLastFrame = true; + + #ifndef PLATFORM_DESKTOP_SDL3 + // Manually detect if the window was maximized (due to SDL2 restore being unreliable on some platforms) to remove the FLAG_WINDOW_MAXIMIZED accordingly + if ((CORE.Window.flags & FLAG_WINDOW_MAXIMIZED) > 0) + { + int borderTop = 0; + int borderLeft = 0; + int borderBottom = 0; + int borderRight = 0; + SDL_GetWindowBordersSize(platform.window, &borderTop, &borderLeft, &borderBottom, &borderRight); + SDL_Rect usableBounds; + SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(platform.window), &usableBounds); + + if ((width + borderLeft + borderRight != usableBounds.w) && (height + borderTop + borderBottom != usableBounds.h)) CORE.Window.flags &= ~FLAG_WINDOW_MAXIMIZED; + } + #endif } break; case SDL_WINDOWEVENT_ENTER: { @@ -1457,13 +1474,32 @@ void PollInputEvents(void) { CORE.Input.Mouse.cursorOnScreen = false; } break; - case SDL_WINDOWEVENT_HIDDEN: case SDL_WINDOWEVENT_MINIMIZED: + { + if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) == 0) CORE.Window.flags |= FLAG_WINDOW_MINIMIZED; + } break; + case SDL_WINDOWEVENT_MAXIMIZED: + { + if ((CORE.Window.flags & FLAG_WINDOW_MAXIMIZED) == 0) CORE.Window.flags |= FLAG_WINDOW_MAXIMIZED; + } break; + case SDL_WINDOWEVENT_RESTORED: + { + if ((SDL_GetWindowFlags(platform.window) & SDL_WINDOW_MINIMIZED) == 0) + { + if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; + } + + #ifdef PLATFORM_DESKTOP_SDL3 + if ((SDL_GetWindowFlags(platform.window) & SDL_WINDOW_MAXIMIZED) == 0) + { + if ((CORE.Window.flags & SDL_WINDOW_MAXIMIZED) > 0) CORE.Window.flags &= ~SDL_WINDOW_MAXIMIZED; + } + #endif + } break; + case SDL_WINDOWEVENT_HIDDEN: case SDL_WINDOWEVENT_FOCUS_LOST: case SDL_WINDOWEVENT_SHOWN: case SDL_WINDOWEVENT_FOCUS_GAINED: - case SDL_WINDOWEVENT_MAXIMIZED: - case SDL_WINDOWEVENT_RESTORED: #if defined(PLATFORM_DESKTOP_SDL3) break; #else From 714cd5ef5c88a878aaa77e835e0260ed0b1d6d0b Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:38:11 +0100 Subject: [PATCH 124/194] add SetGamepadVibration to rgfw and template (#4612) --- src/platforms/rcore_desktop_rgfw.c | 6 ++++++ src/platforms/rcore_template.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index a6ef60c9e..3cf005f25 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -780,6 +780,12 @@ int SetGamepadMappings(const char *mappings) return 0; } +// Set gamepad vibration +void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) +{ + TRACELOG(LOG_WARNING, "GamepadSetVibration() not available on target platform"); +} + // Set mouse position XY void SetMousePosition(int x, int y) { diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index 891c4ab34..9eca9726a 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -381,6 +381,12 @@ int SetGamepadMappings(const char *mappings) return 0; } +// Set gamepad vibration +void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) +{ + TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform"); +} + // Set mouse position XY void SetMousePosition(int x, int y) { From cdaff163cb8f2d0bb23e993be51190f4c07fb1b8 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Wed, 18 Dec 2024 07:39:30 -0300 Subject: [PATCH 125/194] Fix show, hide, focus and unfocus window/flags states for SDL2 (#4610) --- src/platforms/rcore_desktop_sdl.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index de93a1f5e..b7f00bc76 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1427,7 +1427,7 @@ void PollInputEvents(void) // Window events are also polled (Minimized, maximized, close...) - #ifndef PLATFORM_DESKTOP_SDL3 + #ifndef PLATFORM_DESKTOP_SDL3 // SDL3 states: // The SDL_WINDOWEVENT_* events have been moved to top level events, // and SDL_WINDOWEVENT has been removed. @@ -1437,7 +1437,7 @@ void PollInputEvents(void) { switch (event.window.event) { - #endif + #endif case SDL_WINDOWEVENT_RESIZED: case SDL_WINDOWEVENT_SIZE_CHANGED: { @@ -1466,6 +1466,7 @@ void PollInputEvents(void) } #endif } break; + case SDL_WINDOWEVENT_ENTER: { CORE.Input.Mouse.cursorOnScreen = true; @@ -1474,6 +1475,7 @@ void PollInputEvents(void) { CORE.Input.Mouse.cursorOnScreen = false; } break; + case SDL_WINDOWEVENT_MINIMIZED: { if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) == 0) CORE.Window.flags |= FLAG_WINDOW_MINIMIZED; @@ -1496,13 +1498,26 @@ void PollInputEvents(void) } #endif } break; + case SDL_WINDOWEVENT_HIDDEN: - case SDL_WINDOWEVENT_FOCUS_LOST: + { + if ((CORE.Window.flags & FLAG_WINDOW_HIDDEN) == 0) CORE.Window.flags |= FLAG_WINDOW_HIDDEN; + } break; case SDL_WINDOWEVENT_SHOWN: + { + if ((CORE.Window.flags & FLAG_WINDOW_HIDDEN) > 0) CORE.Window.flags &= ~FLAG_WINDOW_HIDDEN; + } break; + case SDL_WINDOWEVENT_FOCUS_GAINED: - #if defined(PLATFORM_DESKTOP_SDL3) - break; - #else + { + if ((CORE.Window.flags & FLAG_WINDOW_UNFOCUSED) > 0) CORE.Window.flags &= ~FLAG_WINDOW_UNFOCUSED; + } break; + case SDL_WINDOWEVENT_FOCUS_LOST: + { + if ((CORE.Window.flags & FLAG_WINDOW_UNFOCUSED) == 0) CORE.Window.flags |= FLAG_WINDOW_UNFOCUSED; + } break; + + #ifndef PLATFORM_DESKTOP_SDL3 default: break; } } break; From 35c24084130f14397ab252b91f115a8fedfd9b7b Mon Sep 17 00:00:00 2001 From: Kirandeep-Singh-Khehra <107160937+Kirandeep-Singh-Khehra@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:09:50 +0530 Subject: [PATCH 126/194] [rmodels] Optimized `UpdateModelAnimationBones()` function (#4602) - Updating bones only once instead for each mesh. - Updating only one `model.meshes[].boneMatrices` and then using deep copy for other meshes instead of calculating for each bone in each mesh. **Other points:** - Makes it a clean base/template/reference for bone updation functions. Because if using this as template then some calculations done in one mesh can affect bones in other mesh in next iteration(doubles the effect in for next mesh). Signed-off-by: Kirandeep-Singh-Khehra --- src/rmodels.c | 66 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index a159d5432..cf799aa58 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2270,38 +2270,62 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) { if (frame >= anim.frameCount) frame = frame%anim.frameCount; + // Get first mesh which have bones + int firstMeshWithBones = -1; + for (int i = 0; i < model.meshCount; i++) { if (model.meshes[i].boneMatrices) { assert(model.meshes[i].boneCount == anim.boneCount); - - for (int boneId = 0; boneId < model.meshes[i].boneCount; boneId++) + if (firstMeshWithBones == -1) { - Vector3 inTranslation = model.bindPose[boneId].translation; - Quaternion inRotation = model.bindPose[boneId].rotation; - Vector3 inScale = model.bindPose[boneId].scale; + firstMeshWithBones = i; + } + } + } - Vector3 outTranslation = anim.framePoses[frame][boneId].translation; - Quaternion outRotation = anim.framePoses[frame][boneId].rotation; - Vector3 outScale = anim.framePoses[frame][boneId].scale; + // Update all bones and boneMatrices of first mesh with bones. + for (int boneId = 0; boneId < anim.boneCount; boneId++) + { + Vector3 inTranslation = model.bindPose[boneId].translation; + Quaternion inRotation = model.bindPose[boneId].rotation; + Vector3 inScale = model.bindPose[boneId].scale; - Vector3 invTranslation = Vector3RotateByQuaternion(Vector3Negate(inTranslation), QuaternionInvert(inRotation)); - Quaternion invRotation = QuaternionInvert(inRotation); - Vector3 invScale = Vector3Divide((Vector3){ 1.0f, 1.0f, 1.0f }, inScale); + Vector3 outTranslation = anim.framePoses[frame][boneId].translation; + Quaternion outRotation = anim.framePoses[frame][boneId].rotation; + Vector3 outScale = anim.framePoses[frame][boneId].scale; - Vector3 boneTranslation = Vector3Add( - Vector3RotateByQuaternion(Vector3Multiply(outScale, invTranslation), - outRotation), outTranslation); - Quaternion boneRotation = QuaternionMultiply(outRotation, invRotation); - Vector3 boneScale = Vector3Multiply(outScale, invScale); + Vector3 invTranslation = Vector3RotateByQuaternion(Vector3Negate(inTranslation), QuaternionInvert(inRotation)); + Quaternion invRotation = QuaternionInvert(inRotation); + Vector3 invScale = Vector3Divide((Vector3){ 1.0f, 1.0f, 1.0f }, inScale); - Matrix boneMatrix = MatrixMultiply(MatrixMultiply( - QuaternionToMatrix(boneRotation), - MatrixTranslate(boneTranslation.x, boneTranslation.y, boneTranslation.z)), - MatrixScale(boneScale.x, boneScale.y, boneScale.z)); + Vector3 boneTranslation = Vector3Add( + Vector3RotateByQuaternion(Vector3Multiply(outScale, invTranslation), + outRotation), outTranslation); + Quaternion boneRotation = QuaternionMultiply(outRotation, invRotation); + Vector3 boneScale = Vector3Multiply(outScale, invScale); - model.meshes[i].boneMatrices[boneId] = boneMatrix; + Matrix boneMatrix = MatrixMultiply(MatrixMultiply( + QuaternionToMatrix(boneRotation), + MatrixTranslate(boneTranslation.x, boneTranslation.y, boneTranslation.z)), + MatrixScale(boneScale.x, boneScale.y, boneScale.z)); + + model.meshes[firstMeshWithBones].boneMatrices[boneId] = boneMatrix; + } + + // Update remaining meshes with bones (Use Deep copy because shallow copy results in double free with 'UnloadModel()') + if (firstMeshWithBones != -1) + { + for (int i = firstMeshWithBones + 1; i < model.meshCount; i++) + { + if (model.meshes[i].boneMatrices) + { + memcpy( + model.meshes[i].boneMatrices, + model.meshes[firstMeshWithBones].boneMatrices, + model.meshes[i].boneCount * sizeof(model.meshes[i].boneMatrices[0]) + ); } } } From f76734fc5059a58d6026d17ff0da985d8a228d5b Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 18 Dec 2024 11:43:43 +0100 Subject: [PATCH 127/194] REVIEWED: `UpdateModelAnimationBones()`, break on first mesh found and formating --- src/rmodels.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index cf799aa58..43997c318 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2281,6 +2281,7 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) if (firstMeshWithBones == -1) { firstMeshWithBones = i; + break; } } } @@ -2314,18 +2315,17 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) model.meshes[firstMeshWithBones].boneMatrices[boneId] = boneMatrix; } - // Update remaining meshes with bones (Use Deep copy because shallow copy results in double free with 'UnloadModel()') + // Update remaining meshes with bones + // NOTE: Using deep copy because shallow copy results in double free with 'UnloadModel()' if (firstMeshWithBones != -1) { for (int i = firstMeshWithBones + 1; i < model.meshCount; i++) { if (model.meshes[i].boneMatrices) { - memcpy( - model.meshes[i].boneMatrices, + memcpy(model.meshes[i].boneMatrices, model.meshes[firstMeshWithBones].boneMatrices, - model.meshes[i].boneCount * sizeof(model.meshes[i].boneMatrices[0]) - ); + model.meshes[i].boneCount * sizeof(model.meshes[i].boneMatrices[0])); } } } @@ -2338,6 +2338,7 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) { UpdateModelAnimationBones(model,anim,frame); + for (int m = 0; m < model.meshCount; m++) { Mesh mesh = model.meshes[m]; @@ -2346,8 +2347,9 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) int boneId = 0; int boneCounter = 0; float boneWeight = 0.0; - bool updated = false; // Flag to check when anim vertex information is updated + bool updated = false; // Flag to check when anim vertex information is updated const int vValues = mesh.vertexCount*3; + for (int vCounter = 0; vCounter < vValues; vCounter += 3) { mesh.animVertices[vCounter] = 0; From de6c09ee7aab56adb625eb6d2611f7e974af7c47 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 18 Dec 2024 11:45:55 +0100 Subject: [PATCH 128/194] WARNING: REVIEWED: Use `libraylib.web.a` naming on PLATFORM_WEB This change allows to have in same directory (currently `raylib/src`) two raylib build versions: Desktop and Web --- examples/Makefile | 2 +- examples/Makefile.Web | 2 +- src/Makefile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 34cf36f04..57a772229 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -482,7 +482,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) endif ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) # Libraries for web (HTML5) compiling - LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a + LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a endif # Define source code object files required diff --git a/examples/Makefile.Web b/examples/Makefile.Web index dd5dc6881..92bcfa229 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -365,7 +365,7 @@ ifeq ($(PLATFORM),PLATFORM_DRM) endif ifeq ($(PLATFORM),PLATFORM_WEB) # Libraries for web (HTML5) compiling - LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a + LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a endif # Define source code object files required diff --git a/src/Makefile b/src/Makefile index 7dde52fbd..1e3ddb791 100644 --- a/src/Makefile +++ b/src/Makefile @@ -662,8 +662,8 @@ raylib: $(OBJS) ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) # Compile raylib libray for web #$(CC) $(OBJS) -r -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc - $(AR) rcs $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(OBJS) - @echo "raylib library generated (lib$(RAYLIB_LIB_NAME).a)!" + $(AR) rcs $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).web.a $(OBJS) + @echo "raylib library generated (lib$(RAYLIB_LIB_NAME).web.a)!" else ifeq ($(RAYLIB_LIBTYPE),SHARED) ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW)) From 58004723d8c0b4fe211b3a20815a9a1f8f20b601 Mon Sep 17 00:00:00 2001 From: Colleague Riley Date: Wed, 18 Dec 2024 03:03:42 -0800 Subject: [PATCH 129/194] [rcore][RGFW] Add new backend option: `PLATFORM_WEB_RGFW` and update RGFW (#4480) * add PLATFORM_WEB_RGFW * fix some bugs * fix web_rgfw gamepad * send fake screensize * fix gamepad bugs (linux) | add L3 + R3 (gamepad) * fix? * update RGFW (again) * update raylib (merge) * fix xinput stuff * delete makefile added by mistake * update RGFW * update RGFW (rename joystick to gamepad to avoid misunderstandings * update RGFW (fix X11 bug) * update RGFW * use RL_MALLOC for RGFW * update RGFW (fixes xdnd bug) * fix some formating --- examples/Makefile | 37 +- examples/Makefile.Web | 25 +- src/Makefile | 20 +- src/external/RGFW.h | 1630 +++++++++++++++------------- src/platforms/rcore_desktop_rgfw.c | 279 ++--- src/rcore.c | 17 +- 6 files changed, 1049 insertions(+), 959 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 57a772229..c02cad434 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -20,6 +20,8 @@ # - Linux (X11 desktop mode) # - macOS/OSX (x64, arm64 (not tested)) # - Others (not tested) +# > PLATFORM_WEB_RGFW: +# - HTML5 (WebAssembly) # > PLATFORM_WEB: # - HTML5 (WebAssembly) # > PLATFORM_DRM: @@ -51,7 +53,7 @@ # Define required environment variables #------------------------------------------------------------------------------------------------ -# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB +# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB, PLATFORM_WEB_RGFW PLATFORM ?= PLATFORM_DESKTOP ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW)) @@ -107,7 +109,7 @@ BUILD_WEB_RESOURCES ?= TRUE BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources # Determine PLATFORM_OS when required -ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB)) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_WEB_RGFW)) # No uname.exe on MinGW!, but OS=Windows_NT on Windows! # ifeq ($(UNAME),Msys) -> Windows ifeq ($(OS),Windows_NT) @@ -158,7 +160,7 @@ endif # Define raylib release directory for compiled library RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(PLATFORM_OS),WINDOWS) # Emscripten required variables EMSDK_PATH ?= C:/raylib/emsdk @@ -184,8 +186,8 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) CC = clang endif endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) - # HTML5 emscripten compiler +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) + # HTML5 emscripten compiler # WARNING: To compile to HTML5, code must be redesigned # to use emscripten.h and emscripten_set_main_loop() CC = emcc @@ -203,7 +205,7 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) MAKE = mingw32-make endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(OS),Windows_NT) MAKE = mingw32-make else @@ -231,11 +233,11 @@ CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result ifeq ($(BUILD_MODE),DEBUG) CFLAGS += -g -D_DEBUG - ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) + ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) CFLAGS += -sASSERTIONS=1 --profiling endif -else - ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +else + ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) CFLAGS += -O3 else @@ -325,7 +327,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL) endif LDFLAGS += -L$(SDL_LIBRARY_PATH) endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # -Os # size optimization # -O2 # optimization level 2, if used, also set --memory-init-file 0 # -sUSE_GLFW=3 # Use glfw3 library (context/input management) @@ -341,9 +343,14 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) # --preload-file resources # specify a resources folder for data compilation # --source-map-base # allow debugging in browser with source map - LDFLAGS += -sUSE_GLFW=3 -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1 - # Build using asyncify + ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) + LDFLAGS += -sUSE_GLFW=3 + endif + + LDFLAGS += -sTOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -sFORCE_FILESYSTEM=1 + + # Build using asyncify ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) LDFLAGS += -sASYNCIFY endif @@ -480,7 +487,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) # NOTE: Required packages: libasound2-dev (ALSA) LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # Libraries for web (HTML5) compiling LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a endif @@ -681,7 +688,7 @@ others: $(OTHERS) %: %.c ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) $(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$< -else ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +else ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) $(MAKE) -f Makefile.Web $@ else $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -D$(TARGET_PLATFORM) @@ -710,7 +717,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) find . -type f -executable -delete rm -fv *.o endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(PLATFORM_OS),WINDOWS) del *.wasm *.html *.js *.data else diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 92bcfa229..a4470e09f 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -65,7 +65,7 @@ BUILD_WEB_HEAP_SIZE ?= 134217728 USE_WEBGL2 ?= FALSE # Determine PLATFORM_OS in case PLATFORM_DESKTOP or PLATFORM_WEB selected -ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB)) +ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_WEB PLATFORM_WEB_RGFW)) # No uname.exe on MinGW!, but OS=Windows_NT on Windows! # ifeq ($(UNAME),Msys) -> Windows ifeq ($(OS),Windows_NT) @@ -116,7 +116,7 @@ endif # Define raylib release directory for compiled library RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src -ifeq ($(PLATFORM),PLATFORM_WEB) +ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(PLATFORM_OS),WINDOWS) # Emscripten required variables EMSDK_PATH ?= C:/raylib/emsdk @@ -142,7 +142,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) CC = clang endif endif -ifeq ($(PLATFORM),PLATFORM_WEB) +ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # HTML5 emscripten compiler # WARNING: To compile to HTML5, code must be redesigned # to use emscripten.h and emscripten_set_main_loop() @@ -161,7 +161,7 @@ endif ifeq ($(PLATFORM),PLATFORM_ANDROID) MAKE = mingw32-make endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(OS),Windows_NT) MAKE = mingw32-make else @@ -189,11 +189,11 @@ CFLAGS = -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result ifeq ($(BUILD_MODE),DEBUG) CFLAGS += -g -D_DEBUG - ifeq ($(PLATFORM),PLATFORM_WEB) + ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) CFLAGS += -sASSERTIONS=1 --profiling endif else - ifeq ($(PLATFORM),PLATFORM_WEB) + ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) CFLAGS += -O3 else @@ -263,7 +263,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) LDFLAGS += -Lsrc -L$(RAYLIB_LIB_PATH) endif endif -ifeq ($(PLATFORM),PLATFORM_WEB) +ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # -Os # size optimization # -O2 # optimization level 2, if used, also set --memory-init-file 0 # -sUSE_GLFW=3 # Use glfw3 library (context/input management) @@ -279,7 +279,12 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) # --preload-file resources # specify a resources folder for data compilation # --source-map-base # allow debugging in browser with source map - LDFLAGS += -sUSE_GLFW=3 -sEXPORTED_RUNTIME_METHODS=ccall + + ifeq ($(PLATFORM),PLATFORM_WEB) + LDFLAGS += -sUSE_GLFW=3 + endif + + LDFLAGS += -sEXPORTED_RUNTIME_METHODS=ccall # Build using asyncify ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) @@ -363,7 +368,7 @@ ifeq ($(PLATFORM),PLATFORM_DRM) # NOTE: Required packages: libasound2-dev (ALSA) LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic endif -ifeq ($(PLATFORM),PLATFORM_WEB) +ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # Libraries for web (HTML5) compiling LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.web.a endif @@ -1225,7 +1230,7 @@ ifeq ($(PLATFORM),PLATFORM_DRM) find . -type f -executable -delete rm -fv *.o endif -ifeq ($(PLATFORM),PLATFORM_WEB) +ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) del *.o *.html *.js endif @echo Cleaning done diff --git a/src/Makefile b/src/Makefile index 1e3ddb791..4797b587f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,6 +20,8 @@ # - Linux (X11 desktop mode) # - macOS/OSX (x64, arm64 (not tested)) # - Others (not tested) +# > PLATFORM_WEB_RGFW: +# - HTML5 (WebAssembly) # > PLATFORM_WEB: # - HTML5 (WebAssembly) # > PLATFORM_DRM: @@ -130,7 +132,7 @@ HOST_PLATFORM_OS ?= WINDOWS PLATFORM_OS ?= WINDOWS # Determine PLATFORM_OS when required -ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_ANDROID)) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_WEB_RGFW PLATFORM_ANDROID)) # No uname.exe on MinGW!, but OS=Windows_NT on Windows! # ifeq ($(UNAME),Msys) -> Windows ifeq ($(OS),Windows_NT) @@ -172,7 +174,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) PLATFORM_SHELL = sh endif endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(PLATFORM_OS),LINUX) ifndef PLATFORM_SHELL PLATFORM_SHELL = sh @@ -180,7 +182,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) endif endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(PLATFORM_OS), WINDOWS) # Emscripten required variables EMSDK_PATH ?= C:/raylib/emsdk @@ -254,7 +256,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) # On DRM OpenGL ES 2.0 must be used GRAPHICS = GRAPHICS_API_OPENGL_ES2 endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # On HTML5 OpenGL ES 2.0 is used, emscripten translates it to WebGL 1.0 GRAPHICS = GRAPHICS_API_OPENGL_ES2 #GRAPHICS = GRAPHICS_API_OPENGL_ES3 @@ -288,7 +290,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) AR = $(RPI_TOOLCHAIN)/bin/$(RPI_TOOLCHAIN_NAME)-ar endif endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # HTML5 emscripten compiler CC = emcc AR = emar @@ -331,7 +333,7 @@ ifneq ($(RAYLIB_CONFIG_FLAGS), NONE) CFLAGS += -DEXTERNAL_CONFIG_FLAGS $(RAYLIB_CONFIG_FLAGS) endif -ifeq ($(TARGET_PLATFORM), PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # NOTE: When using multi-threading in the user code, it requires -pthread enabled CFLAGS += -std=gnu99 else @@ -347,7 +349,7 @@ ifeq ($(RAYLIB_BUILD_MODE),DEBUG) endif ifeq ($(RAYLIB_BUILD_MODE),RELEASE) - ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) + ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) CFLAGS += -Os endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) @@ -366,7 +368,7 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) CFLAGS += -Werror=implicit-function-declaration endif -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # -Os # size optimization # -O2 # optimization level 2, if used, also set --memory-init-file 0 # -sUSE_GLFW=3 # Use glfw3 library (context/input management) -> Only for linker! @@ -659,7 +661,7 @@ all: raylib # Compile raylib library # NOTE: Release directory is created if not exist raylib: $(OBJS) -ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) +ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # Compile raylib libray for web #$(CC) $(OBJS) -r -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc $(AR) rcs $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).web.a $(OBJS) diff --git a/src/external/RGFW.h b/src/external/RGFW.h index 978536f2d..2a10eda2c 100644 --- a/src/external/RGFW.h +++ b/src/external/RGFW.h @@ -59,9 +59,72 @@ #define RGFW_EXPORT - Use when building RGFW #define RGFW_IMPORT - Use when linking with RGFW (not as a single-header) - #define RGFW_STD_INT - force the use stdint.h (for systems that might not have stdint.h (msvc)) + #define RGFW_USE_INT - force the use c-types rather than stdint.h (for systems that might not have stdint.h (msvc)) */ +/* +Example to get you started : + +linux : gcc main.c -lX11 -lXrandr -lGL +windows : gcc main.c -lopengl32 -lwinmm -lshell32 -lgdi32 +macos : gcc main.c -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo + +#define RGFW_IMPLEMENTATION +#include "RGFW.h" + +u8 icon[4 * 3 * 3] = {0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF}; + +int main() { + RGFW_window* win = RGFW_createWindow("name", RGFW_RECT(500, 500, 500, 500), (u64)0); + + RGFW_window_setIcon(win, icon, RGFW_AREA(3, 3), 4); + + for (;;) { + RGFW_window_checkEvent(win); // NOTE: checking events outside of a while loop may cause input lag + if (win->event.type == RGFW_quit || RGFW_isPressed(win, RGFW_Escape)) + break; + + RGFW_window_swapBuffers(win); + + glClearColor(0xFF, 0XFF, 0xFF, 0xFF); + glClear(GL_COLOR_BUFFER_BIT); + } + + RGFW_window_close(win); +} + + compiling : + + if you wish to compile the library all you have to do is create a new file with this in it + + rgfw.c + #define RGFW_IMPLEMENTATION + #include "RGFW.h" + + You may also want to add + `#define RGFW_EXPORT` when compiling and + `#define RGFW_IMPORT`when linking RGFW on it's own: + this reduces inline functions and prevents bloat in the object file + + then you can use gcc (or whatever compile you wish to use) to compile the library into object file + + ex. gcc -c RGFW.c -fPIC + + after you compile the library into an object file, you can also turn the object file into an static or shared library + + (commands ar and gcc can be replaced with whatever equivalent your system uses) + static : ar rcs RGFW.a RGFW.o + shared : + windows: + gcc -shared RGFW.o -lwinmm -lopengl32 -lshell32 -lgdi32 -o RGFW.dll + linux: + gcc -shared RGFW.o -lX11 -lGL -lXrandr -o RGFW.so + macos: + gcc -shared RGFW.o -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo +*/ + + + /* Credits : EimaMei/Sacode : Much of the code for creating windows using winapi, Wrote the Silicon library, helped with MacOS Support, siliapp.h -> referencing @@ -88,6 +151,7 @@ Joshua Rowe (omnisci3nce) - bug fix, review (macOS) @lesleyrs -> bug fix, review (OpenGL) Nick Porcino (meshula) - testing, organization, review (MacOS, examples) + @DarekParodia -> code review (X11) (C++) */ #if _MSC_VER @@ -168,15 +232,15 @@ #define RGFW_HEADER #if !defined(u8) - #if ((defined(_MSC_VER) || defined(__SYMBIAN32__)) && !defined(RGFW_STD_INT)) /* MSVC might not have stdint.h */ + #ifdef RGFW_USE_INT /* optional for any system that might not have stdint.h */ typedef unsigned char u8; typedef signed char i8; typedef unsigned short u16; typedef signed short i16; - typedef unsigned int u32; - typedef signed int i32; - typedef unsigned long u64; - typedef signed long i64; + typedef unsigned long int u32; + typedef signed long int i32; + typedef unsigned long long u64; + typedef signed long long i64; #else /* use stdint standard types instead of c ""standard"" types */ #include @@ -344,12 +408,12 @@ typedef RGFW_ENUM(u8, RGFW_event_types) { RGFW_Event.button holds which mouse button was pressed */ - RGFW_jsButtonPressed, /*!< a joystick button was pressed */ - RGFW_jsButtonReleased, /*!< a joystick button was released */ - RGFW_jsAxisMove, /*!< an axis of a joystick was moved*/ - /*! joystick event note - RGFW_Event.joystick holds which joystick was altered, if any - RGFW_Event.button holds which joystick button was pressed + RGFW_gpButtonPressed, /*!< a gamepad button was pressed */ + RGFW_gpButtonReleased, /*!< a gamepad button was released */ + RGFW_gpAxisMove, /*!< an axis of a gamepad was moved*/ + /*! gamepad event note + RGFW_Event.gamepad holds which gamepad was altered, if any + RGFW_Event.button holds which gamepad button was pressed RGFW_Event.axis holds the data of all the axis RGFW_Event.axisCount says how many axis there are @@ -398,24 +462,26 @@ typedef RGFW_ENUM(u8, RGFW_event_types) { #define RGFW_CAPSLOCK (1L << 1) #define RGFW_NUMLOCK (1L << 2) -/*! joystick button codes (based on xbox/playstation), you may need to change these values per controller */ -#ifndef RGFW_joystick_codes - typedef RGFW_ENUM(u8, RGFW_joystick_codes) { - RGFW_JS_A = 0, /*!< or PS X button */ - RGFW_JS_B = 1, /*!< or PS circle button */ - RGFW_JS_Y = 2, /*!< or PS triangle button */ - RGFW_JS_X = 3, /*!< or PS square button */ - RGFW_JS_START = 9, /*!< start button */ - RGFW_JS_SELECT = 8, /*!< select button */ - RGFW_JS_HOME = 10, /*!< home button */ - RGFW_JS_UP = 13, /*!< dpad up */ - RGFW_JS_DOWN = 14, /*!< dpad down*/ - RGFW_JS_LEFT = 15, /*!< dpad left */ - RGFW_JS_RIGHT = 16, /*!< dpad right */ - RGFW_JS_L1 = 4, /*!< left bump */ - RGFW_JS_L2 = 5, /*!< left trigger*/ - RGFW_JS_R1 = 6, /*!< right bumper */ - RGFW_JS_R2 = 7, /*!< right trigger */ +/*! gamepad button codes (based on xbox/playstation), you may need to change these values per controller */ +#ifndef RGFW_gamepad_codes + typedef RGFW_ENUM(u8, RGFW_gamepad_codes) { + RGFW_GP_A = 0, /*!< or PS X button */ + RGFW_GP_B = 1, /*!< or PS circle button */ + RGFW_GP_Y = 2, /*!< or PS triangle button */ + RGFW_GP_X = 3, /*!< or PS square button */ + RGFW_GP_START = 9, /*!< start button */ + RGFW_GP_SELECT = 8, /*!< select button */ + RGFW_GP_HOME = 10, /*!< home button */ + RGFW_GP_UP = 13, /*!< dpad up */ + RGFW_GP_DOWN = 14, /*!< dpad down*/ + RGFW_GP_LEFT = 15, /*!< dpad left */ + RGFW_GP_RIGHT = 16, /*!< dpad right */ + RGFW_GP_L1 = 4, /*!< left bump */ + RGFW_GP_L2 = 5, /*!< left trigger*/ + RGFW_GP_R1 = 6, /*!< right bumper */ + RGFW_GP_R2 = 7, /*!< right trigger */ + RGFW_GP_L3 = 11, /* left thumb stick */ + RGFW_GP_R3 = 12 /*!< right thumb stick */ }; #endif @@ -450,7 +516,7 @@ typedef RGFW_ENUM(u8, RGFW_event_types) { char name[128]; /*!< monitor name */ RGFW_rect rect; /*!< monitor Workarea */ float scaleX, scaleY; /*!< monitor content scale*/ - float physW, physH; /*!< monitor physical size */ + float physW, physH; /*!< monitor physical size in inches*/ } RGFW_monitor; /* @@ -487,12 +553,14 @@ typedef struct RGFW_Event { u8 lockState; - u8 button; /* !< which mouse button was pressed */ + u8 button; /* !< which mouse (or gamepad) button was pressed */ double scroll; /*!< the raw mouse scroll value */ - u16 joystick; /*! which joystick this event applies to (if applicable to any) */ + u16 gamepad; /*! which gamepad this event applies to (if applicable to any) */ u8 axisesCount; /*!< number of axises */ - RGFW_point axis[2]; /*!< x, y of axises (-100 to 100) */ + + u8 whichAxis; /* which axis was effected */ + RGFW_point axis[4]; /*!< x, y of axises (-100 to 100) */ u64 frameTime, frameTime2; /*!< this is used for counting the fps */ } RGFW_Event; @@ -630,6 +698,8 @@ RGFWDEF void RGFW_setClassName(char* name); /*! this has to be set before createWindow is called, else the fulscreen size is used */ RGFWDEF void RGFW_setBufferSize(RGFW_area size); /*!< the buffer cannot be resized (by RGFW) */ +/* NOTE: (windows)If the executable has an icon resource named RGFW_ICON, it will be set as the initial icon for the window.*/ + RGFWDEF RGFW_window* RGFW_createWindow( const char* name, /* name of the window */ RGFW_rect rect, /* rect of window */ @@ -869,10 +939,10 @@ typedef void (* RGFW_windowrefreshfunc)(RGFW_window* win); typedef void (* RGFW_keyfunc)(RGFW_window* win, u32 keycode, char keyName[16], u8 lockState, b8 pressed); /*! RGFW_mouseButtonPressed / RGFW_mouseButtonReleased, the window that got the event, the button that was pressed, the scroll value, if it was a press (else it's a release) */ typedef void (* RGFW_mousebuttonfunc)(RGFW_window* win, u8 button, double scroll, b8 pressed); -/*! RGFW_jsButtonPressed / RGFW_jsButtonReleased, the window that got the event, the button that was pressed, the scroll value, if it was a press (else it's a release) */ -typedef void (* RGFW_jsButtonfunc)(RGFW_window* win, u16 joystick, u8 button, b8 pressed); -/*! RGFW_jsAxisMove, the window that got the event, the joystick in question, the axis values and the amount of axises */ -typedef void (* RGFW_jsAxisfunc)(RGFW_window* win, u16 joystick, RGFW_point axis[2], u8 axisesCount); +/*!gp /gp, the window that got the event, the button that was pressed, the scroll value, if it was a press (else it's a release) */ +typedef void (* RGFW_gpButtonfunc)(RGFW_window* win, u16 gamepad, u8 button, b8 pressed); +/*! RGFW_gpAxisMove, the window that got the event, the gamepad in question, the axis values and the amount of axises */ +typedef void (* RGFW_gpAxisfunc)(RGFW_window* win, u16 gamepad, RGFW_point axis[2], u8 axisesCount); /*! RGFW_dnd, the window that had the drop, the drop data and the amount files dropped returns previous callback function (if it was set) */ @@ -904,9 +974,9 @@ RGFWDEF RGFW_keyfunc RGFW_setKeyCallback(RGFW_keyfunc func); /*! set callback for a mouse button (press / release ) event returns previous callback function (if it was set) */ RGFWDEF RGFW_mousebuttonfunc RGFW_setMouseButtonCallback(RGFW_mousebuttonfunc func); /*! set callback for a controller button (press / release ) event returns previous callback function (if it was set) */ -RGFWDEF RGFW_jsButtonfunc RGFW_setjsButtonCallback(RGFW_jsButtonfunc func); -/*! set callback for a joystick axis mov event returns previous callback function (if it was set) */ -RGFWDEF RGFW_jsAxisfunc RGFW_setjsAxisCallback(RGFW_jsAxisfunc func); +RGFWDEF RGFW_gpButtonfunc RGFW_setgpButtonCallback(RGFW_gpButtonfunc func); +/*! set callback for a gamepad axis mov event returns previous callback function (if it was set) */ +RGFWDEF RGFW_gpAxisfunc RGFW_setgpAxisCallback(RGFW_gpAxisfunc func); /** @} */ @@ -937,15 +1007,15 @@ RGFWDEF RGFW_jsAxisfunc RGFW_setjsAxisCallback(RGFW_jsAxisfunc func); /** @} */ -/** * @defgroup joystick +/** * @defgroup gamepad * @{ */ -/*! joystick count starts at 0*/ -/*!< register joystick to window based on a number (the number is based on when it was connected eg. /dev/js0)*/ -RGFWDEF u16 RGFW_registerJoystick(RGFW_window* win, i32 jsNumber); -RGFWDEF u16 RGFW_registerJoystickF(RGFW_window* win, char* file); +/*! gamepad count starts at 0*/ +/*!< register gamepad to window based on a number (the number is based on when it was connected eg. /dev/js0)*/ +RGFWDEF u16 RGFW_registerGamepad(RGFW_window* win, i32 gpNumber); +RGFWDEF u16 RGFW_registerGamepadF(RGFW_window* win, char* file); -RGFWDEF u32 RGFW_isPressedJS(RGFW_window* win, u16 controller, u8 button); +RGFWDEF u32 RGFW_isPressedGP(RGFW_window* win, u16 controller, u8 button); /** @} */ @@ -1144,63 +1214,6 @@ typedef RGFW_ENUM(u8, RGFW_mouseIcons) { /** @} */ #endif /* RGFW_HEADER */ - -/* -Example to get you started : - -linux : gcc main.c -lX11 -lXcursor -lGL -windows : gcc main.c -lopengl32 -lshell32 -lgdi32 -macos : gcc main.c -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo - -#define RGFW_IMPLEMENTATION -#include "RGFW.h" - -u8 icon[4 * 3 * 3] = {0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF}; - -int main() { - RGFW_window* win = RGFW_createWindow("name", RGFW_RECT(500, 500, 500, 500), (u64)0); - - RGFW_window_setIcon(win, icon, RGFW_AREA(3, 3), 4); - - for (;;) { - RGFW_window_checkEvent(win); // NOTE: checking events outside of a while loop may cause input lag - if (win->event.type == RGFW_quit || RGFW_isPressed(win, RGFW_Escape)) - break; - - RGFW_window_swapBuffers(win); - - glClearColor(0xFF, 0XFF, 0xFF, 0xFF); - glClear(GL_COLOR_BUFFER_BIT); - } - - RGFW_window_close(win); -} - - compiling : - - if you wish to compile the library all you have to do is create a new file with this in it - - rgfw.c - #define RGFW_IMPLEMENTATION - #include "RGFW.h" - - then you can use gcc (or whatever compile you wish to use) to compile the library into object file - - ex. gcc -c RGFW.c -fPIC - - after you compile the library into an object file, you can also turn the object file into an static or shared library - - (commands ar and gcc can be replaced with whatever equivalent your system uses) - static : ar rcs RGFW.a RGFW.o - shared : - windows: - gcc -shared RGFW.o -lwinmm -lopengl32 -lshell32 -lgdi32 -o RGFW.dll - linux: - gcc -shared RGFW.o -lX11 -lXcursor -lGL -lXrandr -o RGFW.so - macos: - gcc -shared RGFW.o -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo -*/ - #ifdef RGFW_X11 #define RGFW_OS_BASED_VALUE(l, w, m, h, ww) l #elif defined(RGFW_WINDOWS) @@ -1442,11 +1455,11 @@ char RGFW_keyCodeToCharAuto(u32 keycode, u8 lockState) { return RGFW_keyCodeToCh this is the end of keycode data */ -/* joystick data */ -u8 RGFW_jsPressed[4][16]; /*!< if a key is currently pressed or not (per joystick) */ +/* gamepad data */ +u8 RGFW_gpPressed[4][16]; /*!< if a key is currently pressed or not (per gamepad) */ -i32 RGFW_joysticks[4]; /*!< limit of 4 joysticks at a time */ -u16 RGFW_joystickCount; /*!< the actual amount of joysticks */ +i32 RGFW_gamepads[4]; /*!< limit of 4 gamepads at a time */ +u16 RGFW_gamepadCount; /*!< the actual amount of gamepads */ /* event callback defines start here @@ -1468,8 +1481,8 @@ void RGFW_dndInitfuncEMPTY(RGFW_window* win, RGFW_point point) {RGFW_UNUSED(win) void RGFW_windowrefreshfuncEMPTY(RGFW_window* win) {RGFW_UNUSED(win); } void RGFW_keyfuncEMPTY(RGFW_window* win, u32 keycode, char keyName[16], u8 lockState, b8 pressed) {RGFW_UNUSED(win); RGFW_UNUSED(keycode); RGFW_UNUSED(keyName); RGFW_UNUSED(lockState); RGFW_UNUSED(pressed);} void RGFW_mousebuttonfuncEMPTY(RGFW_window* win, u8 button, double scroll, b8 pressed) {RGFW_UNUSED(win); RGFW_UNUSED(button); RGFW_UNUSED(scroll); RGFW_UNUSED(pressed);} -void RGFW_jsButtonfuncEMPTY(RGFW_window* win, u16 joystick, u8 button, b8 pressed){RGFW_UNUSED(win); RGFW_UNUSED(joystick); RGFW_UNUSED(button); RGFW_UNUSED(pressed); } -void RGFW_jsAxisfuncEMPTY(RGFW_window* win, u16 joystick, RGFW_point axis[2], u8 axisesCount){RGFW_UNUSED(win); RGFW_UNUSED(joystick); RGFW_UNUSED(axis); RGFW_UNUSED(axisesCount); } +void RGFW_gpButtonfuncEMPTY(RGFW_window* win, u16 gamepad, u8 button, b8 pressed){RGFW_UNUSED(win); RGFW_UNUSED(gamepad); RGFW_UNUSED(button); RGFW_UNUSED(pressed); } +void RGFW_gpAxisfuncEMPTY(RGFW_window* win, u16 gamepad, RGFW_point axis[2], u8 axisesCount){RGFW_UNUSED(win); RGFW_UNUSED(gamepad); RGFW_UNUSED(axis); RGFW_UNUSED(axisesCount); } #ifdef RGFW_ALLOC_DROPFILES void RGFW_dndfuncEMPTY(RGFW_window* win, char** droppedFiles, u32 droppedFilesCount) {RGFW_UNUSED(win); RGFW_UNUSED(droppedFiles); RGFW_UNUSED(droppedFilesCount);} @@ -1488,8 +1501,8 @@ RGFW_dndfunc RGFW_dndCallback = RGFW_dndfuncEMPTY; RGFW_dndInitfunc RGFW_dndInitCallback = RGFW_dndInitfuncEMPTY; RGFW_keyfunc RGFW_keyCallback = RGFW_keyfuncEMPTY; RGFW_mousebuttonfunc RGFW_mouseButtonCallback = RGFW_mousebuttonfuncEMPTY; -RGFW_jsButtonfunc RGFW_jsButtonCallback = RGFW_jsButtonfuncEMPTY; -RGFW_jsAxisfunc RGFW_jsAxisCallback = RGFW_jsAxisfuncEMPTY; +RGFW_gpButtonfunc RGFW_gpButtonCallback = RGFW_gpButtonfuncEMPTY; +RGFW_gpAxisfunc RGFW_gpAxisCallback = RGFW_gpAxisfuncEMPTY; void RGFW_window_checkEvents(RGFW_window* win, i32 waitMS) { RGFW_window_eventWait(win, waitMS); @@ -1560,14 +1573,14 @@ RGFW_mousebuttonfunc RGFW_setMouseButtonCallback(RGFW_mousebuttonfunc func) { RGFW_mouseButtonCallback = func; return prev; } -RGFW_jsButtonfunc RGFW_setjsButtonCallback(RGFW_jsButtonfunc func) { - RGFW_jsButtonfunc prev = (RGFW_jsButtonCallback == RGFW_jsButtonfuncEMPTY) ? NULL : RGFW_jsButtonCallback; - RGFW_jsButtonCallback = func; +RGFW_gpButtonfunc RGFW_setgpButtonCallback(RGFW_gpButtonfunc func) { + RGFW_gpButtonfunc prev = (RGFW_gpButtonCallback == RGFW_gpButtonfuncEMPTY) ? NULL : RGFW_gpButtonCallback; + RGFW_gpButtonCallback = func; return prev; } -RGFW_jsAxisfunc RGFW_setjsAxisCallback(RGFW_jsAxisfunc func) { - RGFW_jsAxisfunc prev = (RGFW_jsAxisCallback == RGFW_jsAxisfuncEMPTY) ? NULL : RGFW_jsAxisCallback; - RGFW_jsAxisCallback = func; +RGFW_gpAxisfunc RGFW_setgpAxisCallback(RGFW_gpAxisfunc func) { + RGFW_gpAxisfunc prev = (RGFW_gpAxisCallback == RGFW_gpAxisfuncEMPTY) ? NULL : RGFW_gpAxisCallback; + RGFW_gpAxisCallback = func; return prev; } /* @@ -1629,7 +1642,7 @@ RGFW_window* RGFW_window_basic_init(RGFW_rect rect, u16 args) { win->r = rect; win->event.inFocus = 1; win->event.droppedFilesCount = 0; - RGFW_joystickCount = 0; + RGFW_gamepadCount = 0; win->_winArgs = 0; win->event.lockState = 0; @@ -1640,7 +1653,7 @@ RGFW_window* RGFW_window_basic_init(RGFW_rect rect, u16 args) { void RGFW_window_scaleToMonitor(RGFW_window* win) { RGFW_monitor monitor = RGFW_window_getMonitor(win); - RGFW_window_resize(win, RGFW_AREA((u32)(monitor.scaleX * (float)win->r.w), (u32)(monitor.scaleX * (float)win->r.h))); + RGFW_window_resize(win, RGFW_AREA((u32)(monitor.scaleX * (float)win->r.w), (u32)(monitor.scaleY * (float)win->r.h))); } #endif @@ -1808,9 +1821,9 @@ u32 RGFW_window_checkFPS(RGFW_window* win, u32 fpsCap) { return output_fps; } -u32 RGFW_isPressedJS(RGFW_window* win, u16 c, u8 button) { +u32 RGFW_isPressedGP(RGFW_window* win, u16 c, u8 button) { RGFW_UNUSED(win); - return RGFW_jsPressed[c][button]; + return RGFW_gpPressed[c][button]; } #if defined(RGFW_X11) || defined(RGFW_WINDOWS) @@ -2261,48 +2274,56 @@ This is where OS specific stuff starts #if defined(RGFW_WAYLAND) || defined(RGFW_X11) int RGFW_eventWait_forceStop[] = {0, 0, 0}; /* for wait events */ + + #ifdef __linux__ #include #include #include - - RGFW_Event* RGFW_linux_updateJoystick(RGFW_window* win) { - static int xAxis = 0, yAxis = 0; + + RGFW_Event* RGFW_linux_updateGamepad(RGFW_window* win) { u8 i; - for (i = 0; i < RGFW_joystickCount; i++) { + for (i = 0; i < RGFW_gamepadCount; i++) { struct js_event e; - if (RGFW_joysticks[i] == 0) + if (RGFW_gamepads[i] == 0) continue; - i32 flags = fcntl(RGFW_joysticks[i], F_GETFL, 0); - fcntl(RGFW_joysticks[i], F_SETFL, flags | O_NONBLOCK); + i32 flags = fcntl(RGFW_gamepads[i], F_GETFL, 0); + fcntl(RGFW_gamepads[i], F_SETFL, flags | O_NONBLOCK); ssize_t bytes; - while ((bytes = read(RGFW_joysticks[i], &e, sizeof(e))) > 0) { + while ((bytes = read(RGFW_gamepads[i], &e, sizeof(e))) > 0) { switch (e.type) { case JS_EVENT_BUTTON: - win->event.type = e.value ? RGFW_jsButtonPressed : RGFW_jsButtonReleased; + win->event.type = e.value ? RGFW_gpButtonPressed : RGFW_gpButtonReleased; win->event.button = e.number; - RGFW_jsPressed[i][e.number] = e.value; - RGFW_jsButtonCallback(win, i, e.number, e.value); + RGFW_gpPressed[i][e.number + 1] = e.value; + RGFW_gpButtonCallback(win, i, e.number, e.value); + return &win->event; - case JS_EVENT_AXIS: - ioctl(RGFW_joysticks[i], JSIOCGAXES, &win->event.axisesCount); + case JS_EVENT_AXIS: { + size_t axis = e.number / 2; + if (axis == 2) axis = 1; - if ((e.number == 0 || e.number % 2) && e.number != 1) - xAxis = e.value; - else - yAxis = e.value; + ioctl(RGFW_gamepads[i], JSIOCGAXES, &win->event.axisesCount); + win->event.axisesCount = 2; + + if (axis < 3) { + if (e.number == 0 || e.number == 3) + win->event.axis[axis].x = (e.value / 32767.0f) * 100; + else if (e.number == 1 || e.number == 4) { + win->event.axis[axis].y = (e.value / 32767.0f) * 100; + } + } - win->event.axis[e.number / 2].x = xAxis; - win->event.axis[e.number / 2].y = yAxis; - win->event.type = RGFW_jsAxisMove; - win->event.joystick = i; - RGFW_jsAxisCallback(win, i, win->event.axis, win->event.axisesCount); + win->event.type = RGFW_gpAxisMove; + win->event.gamepad = i; + win->event.whichAxis = axis; + RGFW_gpAxisCallback(win, i, win->event.axis, win->event.axisesCount); return &win->event; - + } default: break; } } @@ -2647,580 +2668,594 @@ Start of Linux / Unix defines } if (args & RGFW_NO_RESIZE) { /* make it so the user can't resize the window*/ - XSizeHints* sh = XAllocSizeHints(); - sh->flags = (1L << 4) | (1L << 5); - sh->min_width = sh->max_width = win->r.w; - sh->min_height = sh->max_height = win->r.h; + XSizeHints sh = {0}; + sh.flags = (1L << 4) | (1L << 5); + sh.min_width = sh.max_width = win->r.w; + sh.min_height = sh.max_height = win->r.h; - XSetWMSizeHints((Display*) win->src.display, (Drawable) win->src.window, sh, XA_WM_NORMAL_HINTS); - XFree(sh); + XSetWMSizeHints((Display*) win->src.display, (Drawable) win->src.window, &sh, XA_WM_NORMAL_HINTS); + + win->_winArgs |= RGFW_NO_RESIZE; } - if (args & RGFW_NO_BORDER) { - RGFW_window_setBorder(win, 0); - } + if (args & RGFW_NO_BORDER) { + RGFW_window_setBorder(win, 0); + } - XSelectInput((Display*) win->src.display, (Drawable) win->src.window, event_mask); /*!< tell X11 what events we want*/ + XSelectInput((Display*) win->src.display, (Drawable) win->src.window, event_mask); /*!< tell X11 what events we want*/ - /* make it so the user can't close the window until the program does*/ - if (wm_delete_window == 0) - wm_delete_window = XInternAtom((Display*) win->src.display, "WM_DELETE_WINDOW", False); + /* make it so the user can't close the window until the program does*/ + if (wm_delete_window == 0) + wm_delete_window = XInternAtom((Display*) win->src.display, "WM_DELETE_WINDOW", False); - XSetWMProtocols((Display*) win->src.display, (Drawable) win->src.window, &wm_delete_window, 1); + XSetWMProtocols((Display*) win->src.display, (Drawable) win->src.window, &wm_delete_window, 1); - /* connect the context to the window*/ + /* connect the context to the window*/ #ifdef RGFW_OPENGL - if ((args & RGFW_NO_INIT_API) == 0) - glXMakeCurrent((Display*) win->src.display, (Drawable) win->src.window, (GLXContext) win->src.ctx); + if ((args & RGFW_NO_INIT_API) == 0) + glXMakeCurrent((Display*) win->src.display, (Drawable) win->src.window, (GLXContext) win->src.ctx); #endif - /* set the background*/ - XStoreName((Display*) win->src.display, (Drawable) win->src.window, name); /*!< set the name*/ + /* set the background*/ + XStoreName((Display*) win->src.display, (Drawable) win->src.window, name); /*!< set the name*/ - XMapWindow((Display*) win->src.display, (Drawable) win->src.window); /* draw the window*/ - XMoveWindow((Display*) win->src.display, (Drawable) win->src.window, win->r.x, win->r.y); /*!< move the window to it's proper cords*/ + XMapWindow((Display*) win->src.display, (Drawable) win->src.window); /* draw the window*/ + XMoveWindow((Display*) win->src.display, (Drawable) win->src.window, win->r.x, win->r.y); /*!< move the window to it's proper cords*/ - if (args & RGFW_ALLOW_DND) { /* init drag and drop atoms and turn on drag and drop for this window */ - win->_winArgs |= RGFW_ALLOW_DND; + if (args & RGFW_ALLOW_DND) { /* init drag and drop atoms and turn on drag and drop for this window */ + win->_winArgs |= RGFW_ALLOW_DND; - XdndTypeList = XInternAtom((Display*) win->src.display, "XdndTypeList", False); - XdndSelection = XInternAtom((Display*) win->src.display, "XdndSelection", False); + XdndTypeList = XInternAtom((Display*) win->src.display, "XdndTypeList", False); + XdndSelection = XInternAtom((Display*) win->src.display, "XdndSelection", False); - /* client messages */ - XdndEnter = XInternAtom((Display*) win->src.display, "XdndEnter", False); - XdndPosition = XInternAtom((Display*) win->src.display, "XdndPosition", False); - XdndStatus = XInternAtom((Display*) win->src.display, "XdndStatus", False); - XdndLeave = XInternAtom((Display*) win->src.display, "XdndLeave", False); - XdndDrop = XInternAtom((Display*) win->src.display, "XdndDrop", False); - XdndFinished = XInternAtom((Display*) win->src.display, "XdndFinished", False); + /* client messages */ + XdndEnter = XInternAtom((Display*) win->src.display, "XdndEnter", False); + XdndPosition = XInternAtom((Display*) win->src.display, "XdndPosition", False); + XdndStatus = XInternAtom((Display*) win->src.display, "XdndStatus", False); + XdndLeave = XInternAtom((Display*) win->src.display, "XdndLeave", False); + XdndDrop = XInternAtom((Display*) win->src.display, "XdndDrop", False); + XdndFinished = XInternAtom((Display*) win->src.display, "XdndFinished", False); - /* actions */ - XdndActionCopy = XInternAtom((Display*) win->src.display, "XdndActionCopy", False); + /* actions */ + XdndActionCopy = XInternAtom((Display*) win->src.display, "XdndActionCopy", False); - XtextUriList = XInternAtom((Display*) win->src.display, "text/uri-list", False); - XtextPlain = XInternAtom((Display*) win->src.display, "text/plain", False); + XtextUriList = XInternAtom((Display*) win->src.display, "text/uri-list", False); + XtextPlain = XInternAtom((Display*) win->src.display, "text/plain", False); - XdndAware = XInternAtom((Display*) win->src.display, "XdndAware", False); - const u8 version = 5; + XdndAware = XInternAtom((Display*) win->src.display, "XdndAware", False); + const u8 version = 5; - XChangeProperty((Display*) win->src.display, (Window) win->src.window, - XdndAware, 4, 32, - PropModeReplace, &version, 1); /*!< turns on drag and drop */ + XChangeProperty((Display*) win->src.display, (Window) win->src.window, + XdndAware, 4, 32, + PropModeReplace, &version, 1); /*!< turns on drag and drop */ + } + + #ifdef RGFW_EGL + if ((args & RGFW_NO_INIT_API) == 0) + RGFW_createOpenGLContext(win); + #endif + + RGFW_window_setMouseDefault(win); + + RGFW_windowsOpen++; + + return win; /*return newly created window*/ } - #ifdef RGFW_EGL - if ((args & RGFW_NO_INIT_API) == 0) - RGFW_createOpenGLContext(win); - #endif + RGFW_area RGFW_getScreenSize(void) { + assert(RGFW_root != NULL); - RGFW_window_setMouseDefault(win); - - RGFW_windowsOpen++; - - return win; /*return newly created window*/ - } - - RGFW_area RGFW_getScreenSize(void) { - assert(RGFW_root != NULL); - - Screen* scrn = DefaultScreenOfDisplay((Display*) RGFW_root->src.display); - return RGFW_AREA(scrn->width, scrn->height); - } - - RGFW_point RGFW_getGlobalMousePoint(void) { - assert(RGFW_root != NULL); - - RGFW_point RGFWMouse; - - i32 x, y; - u32 z; - Window window1, window2; - XQueryPointer((Display*) RGFW_root->src.display, XDefaultRootWindow((Display*) RGFW_root->src.display), &window1, &window2, &RGFWMouse.x, &RGFWMouse.y, &x, &y, &z); - - return RGFWMouse; - } - - RGFW_point RGFW_window_getMousePoint(RGFW_window* win) { - assert(win != NULL); - - RGFW_point RGFWMouse; - - i32 x, y; - u32 z; - Window window1, window2; - XQueryPointer((Display*) win->src.display, win->src.window, &window1, &window2, &x, &y, &RGFWMouse.x, &RGFWMouse.y, &z); - - return RGFWMouse; - } - - int xAxis = 0, yAxis = 0; - - RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { - assert(win != NULL); - - static struct { - long source, version; - i32 format; - } xdnd; - - if (win->event.type == 0) - RGFW_resetKey(); - - if (win->event.type == RGFW_quit) { - return NULL; + Screen* scrn = DefaultScreenOfDisplay((Display*) RGFW_root->src.display); + return RGFW_AREA(scrn->width, scrn->height); } - win->event.type = 0; + RGFW_point RGFW_getGlobalMousePoint(void) { + assert(RGFW_root != NULL); + + RGFW_point RGFWMouse; + + i32 x, y; + u32 z; + Window window1, window2; + XQueryPointer((Display*) RGFW_root->src.display, XDefaultRootWindow((Display*) RGFW_root->src.display), &window1, &window2, &RGFWMouse.x, &RGFWMouse.y, &x, &y, &z); + + return RGFWMouse; + } + + RGFW_point RGFW_window_getMousePoint(RGFW_window* win) { + assert(win != NULL); + + RGFW_point RGFWMouse; + + i32 x, y; + u32 z; + Window window1, window2; + XQueryPointer((Display*) win->src.display, win->src.window, &window1, &window2, &x, &y, &RGFWMouse.x, &RGFWMouse.y, &z); + + return RGFWMouse; + } + + int xAxis = 0, yAxis = 0; + + RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { + assert(win != NULL); + + static struct { + long source, version; + i32 format; + } xdnd; + + if (win->event.type == 0) + RGFW_resetKey(); + + if (win->event.type == RGFW_quit) { + return NULL; + } + + win->event.type = 0; #ifdef __linux__ - RGFW_Event* event = RGFW_linux_updateJoystick(win); - if (event != NULL) - return event; + RGFW_Event* event = RGFW_linux_updateGamepad(win); + if (event != NULL) + return event; #endif - XPending(win->src.display); + XPending(win->src.display); - XEvent E; /*!< raw X11 event */ + XEvent E; /*!< raw X11 event */ - /* if there is no unread qued events, get a new one */ - if ((QLength(win->src.display) || XEventsQueued((Display*) win->src.display, QueuedAlready) + XEventsQueued((Display*) win->src.display, QueuedAfterReading)) - && win->event.type != RGFW_quit - ) - XNextEvent((Display*) win->src.display, &E); - else { - return NULL; - } - - u32 i; - win->event.type = 0; - - - switch (E.type) { - case KeyPress: - case KeyRelease: { - win->event.repeat = RGFW_FALSE; - /* check if it's a real key release */ - if (E.type == KeyRelease && XEventsQueued((Display*) win->src.display, QueuedAfterReading)) { /* get next event if there is one*/ - XEvent NE; - XPeekEvent((Display*) win->src.display, &NE); - - if (E.xkey.time == NE.xkey.time && E.xkey.keycode == NE.xkey.keycode) /* check if the current and next are both the same*/ - win->event.repeat = RGFW_TRUE; + /* if there is no unread qued events, get a new one */ + if ((QLength(win->src.display) || XEventsQueued((Display*) win->src.display, QueuedAlready) + XEventsQueued((Display*) win->src.display, QueuedAfterReading)) + && win->event.type != RGFW_quit + ) + XNextEvent((Display*) win->src.display, &E); + else { + return NULL; } - /* set event key data */ - KeySym sym = (KeySym)XkbKeycodeToKeysym((Display*) win->src.display, E.xkey.keycode, 0, E.xkey.state & ShiftMask ? 1 : 0); - win->event.keyCode = RGFW_apiKeyCodeToRGFW(E.xkey.keycode); - - char* str = (char*)XKeysymToString(sym); - if (str != NULL) - strncpy(win->event.keyName, str, 16); + u32 i; + win->event.type = 0; + XEvent reply = { ClientMessage }; - win->event.keyName[15] = '\0'; + switch (E.type) { + case KeyPress: + case KeyRelease: { + win->event.repeat = RGFW_FALSE; + /* check if it's a real key release */ + if (E.type == KeyRelease && XEventsQueued((Display*) win->src.display, QueuedAfterReading)) { /* get next event if there is one*/ + XEvent NE; + XPeekEvent((Display*) win->src.display, &NE); - RGFW_keyboard[win->event.keyCode].prev = RGFW_isPressed(win, win->event.keyCode); - - /* get keystate data */ - win->event.type = (E.type == KeyPress) ? RGFW_keyPressed : RGFW_keyReleased; - - XKeyboardState keystate; - XGetKeyboardControl((Display*) win->src.display, &keystate); - - RGFW_updateLockState(win, (keystate.led_mask & 1), (keystate.led_mask & 2)); - RGFW_keyboard[win->event.keyCode].current = (E.type == KeyPress); - RGFW_keyCallback(win, win->event.keyCode, win->event.keyName, win->event.lockState, (E.type == KeyPress)); - break; - } - case ButtonPress: - case ButtonRelease: - win->event.type = RGFW_mouseButtonPressed + (E.type == ButtonRelease); // the events match - - switch(win->event.button) { - case RGFW_mouseScrollUp: - win->event.scroll = 1; - break; - case RGFW_mouseScrollDown: - win->event.scroll = -1; - break; - default: break; - } - - win->event.button = E.xbutton.button; - RGFW_mouseButtons[win->event.button].prev = RGFW_mouseButtons[win->event.button].current; - - if (win->event.repeat == RGFW_FALSE) - win->event.repeat = RGFW_isPressed(win, win->event.keyCode); - - RGFW_mouseButtons[win->event.button].current = (E.type == ButtonPress); - RGFW_mouseButtonCallback(win, win->event.button, win->event.scroll, (E.type == ButtonPress)); - break; - - case MotionNotify: - win->event.point.x = E.xmotion.x; - win->event.point.y = E.xmotion.y; - - if ((win->_winArgs & RGFW_HOLD_MOUSE)) { - win->event.point.y = E.xmotion.y; - - win->event.point.x = win->_lastMousePoint.x - abs(win->event.point.x); - win->event.point.y = win->_lastMousePoint.y - abs(win->event.point.y); - } - - win->_lastMousePoint = RGFW_POINT(E.xmotion.x, E.xmotion.y); - - win->event.type = RGFW_mousePosChanged; - RGFW_mousePosCallback(win, win->event.point); - break; - - case GenericEvent: { - /* MotionNotify is used for mouse events if the mouse isn't held */ - if (!(win->_winArgs & RGFW_HOLD_MOUSE)) { - XFreeEventData(win->src.display, &E.xcookie); - break; - } - - XGetEventData(win->src.display, &E.xcookie); - if (E.xcookie.evtype == XI_RawMotion) { - XIRawEvent *raw = (XIRawEvent *)E.xcookie.data; - if (raw->valuators.mask_len == 0) { - XFreeEventData(win->src.display, &E.xcookie); - break; + if (E.xkey.time == NE.xkey.time && E.xkey.keycode == NE.xkey.keycode) /* check if the current and next are both the same*/ + win->event.repeat = RGFW_TRUE; } - double deltaX = 0.0f; - double deltaY = 0.0f; - - /* check if relative motion data exists where we think it does */ - if (XIMaskIsSet(raw->valuators.mask, 0) != 0) - deltaX += raw->raw_values[0]; - if (XIMaskIsSet(raw->valuators.mask, 1) != 0) - deltaY += raw->raw_values[1]; - - win->event.point = RGFW_POINT((i32)deltaX, (i32)deltaY); + /* set event key data */ + KeySym sym = (KeySym)XkbKeycodeToKeysym((Display*) win->src.display, E.xkey.keycode, 0, E.xkey.state & ShiftMask ? 1 : 0); + win->event.keyCode = RGFW_apiKeyCodeToRGFW(E.xkey.keycode); - RGFW_window_moveMouse(win, RGFW_POINT(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); + char* str = (char*)XKeysymToString(sym); + if (str != NULL) + strncpy(win->event.keyName, str, 16); + + win->event.keyName[15] = '\0'; + + RGFW_keyboard[win->event.keyCode].prev = RGFW_isPressed(win, win->event.keyCode); + + /* get keystate data */ + win->event.type = (E.type == KeyPress) ? RGFW_keyPressed : RGFW_keyReleased; + + XKeyboardState keystate; + XGetKeyboardControl((Display*) win->src.display, &keystate); + + RGFW_updateLockState(win, (keystate.led_mask & 1), (keystate.led_mask & 2)); + RGFW_keyboard[win->event.keyCode].current = (E.type == KeyPress); + RGFW_keyCallback(win, win->event.keyCode, win->event.keyName, win->event.lockState, (E.type == KeyPress)); + break; + } + case ButtonPress: + case ButtonRelease: + win->event.type = RGFW_mouseButtonPressed + (E.type == ButtonRelease); // the events match + + switch(win->event.button) { + case RGFW_mouseScrollUp: + win->event.scroll = 1; + break; + case RGFW_mouseScrollDown: + win->event.scroll = -1; + break; + default: break; + } + + win->event.button = E.xbutton.button; + RGFW_mouseButtons[win->event.button].prev = RGFW_mouseButtons[win->event.button].current; + + if (win->event.repeat == RGFW_FALSE) + win->event.repeat = RGFW_isPressed(win, win->event.keyCode); + + RGFW_mouseButtons[win->event.button].current = (E.type == ButtonPress); + RGFW_mouseButtonCallback(win, win->event.button, win->event.scroll, (E.type == ButtonPress)); + break; + + case MotionNotify: + win->event.point.x = E.xmotion.x; + win->event.point.y = E.xmotion.y; + + if ((win->_winArgs & RGFW_HOLD_MOUSE)) { + win->event.point.y = E.xmotion.y; + + win->event.point.x = win->_lastMousePoint.x - abs(win->event.point.x); + win->event.point.y = win->_lastMousePoint.y - abs(win->event.point.y); + } + + win->_lastMousePoint = RGFW_POINT(E.xmotion.x, E.xmotion.y); win->event.type = RGFW_mousePosChanged; RGFW_mousePosCallback(win, win->event.point); - } + break; - XFreeEventData(win->src.display, &E.xcookie); - break; - } - - case Expose: - win->event.type = RGFW_windowRefresh; - RGFW_windowRefreshCallback(win); - break; + case GenericEvent: { + /* MotionNotify is used for mouse events if the mouse isn't held */ + if (!(win->_winArgs & RGFW_HOLD_MOUSE)) { + XFreeEventData(win->src.display, &E.xcookie); + break; + } + + XGetEventData(win->src.display, &E.xcookie); + if (E.xcookie.evtype == XI_RawMotion) { + XIRawEvent *raw = (XIRawEvent *)E.xcookie.data; + if (raw->valuators.mask_len == 0) { + XFreeEventData(win->src.display, &E.xcookie); + break; + } - case ClientMessage: - /* if the client closed the window*/ - if (E.xclient.data.l[0] == (i64) wm_delete_window) { - win->event.type = RGFW_quit; - RGFW_windowQuitCallback(win); + double deltaX = 0.0f; + double deltaY = 0.0f; + + /* check if relative motion data exists where we think it does */ + if (XIMaskIsSet(raw->valuators.mask, 0) != 0) + deltaX += raw->raw_values[0]; + if (XIMaskIsSet(raw->valuators.mask, 1) != 0) + deltaY += raw->raw_values[1]; + + win->event.point = RGFW_POINT((i32)deltaX, (i32)deltaY); + + RGFW_window_moveMouse(win, RGFW_POINT(win->r.x + (win->r.w / 2), win->r.y + (win->r.h / 2))); + + win->event.type = RGFW_mousePosChanged; + RGFW_mousePosCallback(win, win->event.point); + } + + XFreeEventData(win->src.display, &E.xcookie); break; } - /* reset DND values */ - if (win->event.droppedFilesCount) { - for (i = 0; i < win->event.droppedFilesCount; i++) - win->event.droppedFiles[i][0] = '\0'; - } - - win->event.droppedFilesCount = 0; - - if ((win->_winArgs & RGFW_ALLOW_DND) == 0) + case Expose: + win->event.type = RGFW_windowRefresh; + RGFW_windowRefreshCallback(win); break; - XEvent reply = { ClientMessage }; - reply.xclient.window = xdnd.source; - reply.xclient.format = 32; - reply.xclient.data.l[0] = (long) win->src.window; - reply.xclient.data.l[1] = 0; - reply.xclient.data.l[2] = None; - - if (E.xclient.message_type == XdndEnter) { - unsigned long count; - Atom* formats; - Atom real_formats[6]; - - Bool list = E.xclient.data.l[1] & 1; - - xdnd.source = E.xclient.data.l[0]; - xdnd.version = E.xclient.data.l[1] >> 24; - xdnd.format = None; - - if (xdnd.version > 5) + case ClientMessage: + /* if the client closed the window*/ + if (E.xclient.data.l[0] == (i64) wm_delete_window) { + win->event.type = RGFW_quit; + RGFW_windowQuitCallback(win); break; - - if (list) { - Atom actualType; - i32 actualFormat; - unsigned long bytesAfter; - - XGetWindowProperty((Display*) win->src.display, - xdnd.source, - XdndTypeList, - 0, - LONG_MAX, - False, - 4, - &actualType, - &actualFormat, - &count, - &bytesAfter, - (u8**) &formats); - } else { - count = 0; - - if (E.xclient.data.l[2] != None) - real_formats[count++] = E.xclient.data.l[2]; - if (E.xclient.data.l[3] != None) - real_formats[count++] = E.xclient.data.l[3]; - if (E.xclient.data.l[4] != None) - real_formats[count++] = E.xclient.data.l[4]; - - formats = real_formats; + } + + /* reset DND values */ + if (win->event.droppedFilesCount) { + for (i = 0; i < win->event.droppedFilesCount; i++) + win->event.droppedFiles[i][0] = '\0'; } - unsigned long i; - for (i = 0; i < count; i++) { - if (formats[i] == XtextUriList || formats[i] == XtextPlain) { - xdnd.format = formats[i]; - break; - } - } + win->event.droppedFilesCount = 0; - if (list) { - XFree(formats); - } - - break; - } - if (E.xclient.message_type == XdndPosition) { - const i32 xabs = (E.xclient.data.l[2] >> 16) & 0xffff; - const i32 yabs = (E.xclient.data.l[2]) & 0xffff; - Window dummy; - i32 xpos, ypos; - - if (xdnd.version > 5) + if ((win->_winArgs & RGFW_ALLOW_DND) == 0) break; - XTranslateCoordinates((Display*) win->src.display, - XDefaultRootWindow((Display*) win->src.display), - (Window) win->src.window, - xabs, yabs, - &xpos, &ypos, - &dummy); - - win->event.point.x = xpos; - win->event.point.y = ypos; - reply.xclient.window = xdnd.source; - reply.xclient.message_type = XdndStatus; + reply.xclient.format = 32; + reply.xclient.data.l[0] = (long) win->src.window; + reply.xclient.data.l[1] = 0; + reply.xclient.data.l[2] = None; + + if (E.xclient.message_type == XdndEnter) { + unsigned long count; + Atom* formats; + Atom real_formats[6]; + + Bool list = E.xclient.data.l[1] & 1; + + xdnd.source = E.xclient.data.l[0]; + xdnd.version = E.xclient.data.l[1] >> 24; + + xdnd.format = None; + + if (xdnd.version > 5) + break; + + if (list) { + Atom actualType; + i32 actualFormat; + unsigned long bytesAfter; + + XGetWindowProperty((Display*) win->src.display, + xdnd.source, + XdndTypeList, + 0, + LONG_MAX, + False, + 4, + &actualType, + &actualFormat, + &count, + &bytesAfter, + (u8**) &formats); + } else { + count = 0; + + if (E.xclient.data.l[2] != None) + real_formats[count++] = E.xclient.data.l[2]; + if (E.xclient.data.l[3] != None) + real_formats[count++] = E.xclient.data.l[3]; + if (E.xclient.data.l[4] != None) + real_formats[count++] = E.xclient.data.l[4]; + + formats = real_formats; + } + + unsigned long i; + for (i = 0; i < count; i++) { + if (formats[i] == XtextUriList || formats[i] == XtextPlain) { + xdnd.format = formats[i]; + break; + } + } + + if (list) { + XFree(formats); + } + + break; + } + if (E.xclient.message_type == XdndPosition) { + const i32 xabs = (E.xclient.data.l[2] >> 16) & 0xffff; + const i32 yabs = (E.xclient.data.l[2]) & 0xffff; + Window dummy; + i32 xpos, ypos; + + if (xdnd.version > 5) + break; + + XTranslateCoordinates((Display*) win->src.display, + XDefaultRootWindow((Display*) win->src.display), + (Window) win->src.window, + xabs, yabs, + &xpos, &ypos, + &dummy); + + win->event.point.x = xpos; + win->event.point.y = ypos; + + reply.xclient.window = xdnd.source; + reply.xclient.message_type = XdndStatus; + + if (xdnd.format) { + reply.xclient.data.l[1] = 1; + if (xdnd.version >= 2) + reply.xclient.data.l[4] = XdndActionCopy; + } + + XSendEvent((Display*) win->src.display, xdnd.source, False, NoEventMask, &reply); + XFlush((Display*) win->src.display); + break; + } + + if (E.xclient.message_type != XdndDrop) + break; + + if (xdnd.version > 5) + break; + + win->event.type = RGFW_dnd_init; if (xdnd.format) { - reply.xclient.data.l[1] = 1; - if (xdnd.version >= 2) - reply.xclient.data.l[4] = XdndActionCopy; + Time time = CurrentTime; + + if (xdnd.version >= 1) + time = E.xclient.data.l[2]; + + XConvertSelection((Display*) win->src.display, + XdndSelection, + xdnd.format, + XdndSelection, + (Window) win->src.window, + time); + } else if (xdnd.version >= 2) { + XEvent reply = { ClientMessage }; + + XSendEvent((Display*) win->src.display, xdnd.source, + False, NoEventMask, &reply); + XFlush((Display*) win->src.display); } - XSendEvent((Display*) win->src.display, xdnd.source, False, NoEventMask, &reply); - XFlush((Display*) win->src.display); + RGFW_dndInitCallback(win, win->event.point); break; - } - - if (E.xclient.message_type != XdndDrop) - break; - - if (xdnd.version > 5) - break; - - win->event.type = RGFW_dnd_init; - - if (xdnd.format) { - Time time = CurrentTime; - - if (xdnd.version >= 1) - time = E.xclient.data.l[2]; - - XConvertSelection((Display*) win->src.display, - XdndSelection, - xdnd.format, - XdndSelection, - (Window) win->src.window, - time); - } else if (xdnd.version >= 2) { - XEvent reply = { ClientMessage }; - - XSendEvent((Display*) win->src.display, xdnd.source, - False, NoEventMask, &reply); - XFlush((Display*) win->src.display); - } - - RGFW_dndInitCallback(win, win->event.point); - break; - case SelectionNotify: { - /* this is only for checking for xdnd drops */ - if (E.xselection.property != XdndSelection || !(win->_winArgs | RGFW_ALLOW_DND)) - break; - - char* data; - unsigned long result; - - Atom actualType; - i32 actualFormat; - unsigned long bytesAfter; - - XGetWindowProperty((Display*) win->src.display, E.xselection.requestor, E.xselection.property, 0, LONG_MAX, False, E.xselection.target, &actualType, &actualFormat, &result, &bytesAfter, (u8**) &data); - - if (result == 0) - break; - - /* - SOURCED FROM GLFW _glfwParseUriList - Copyright (c) 2002-2006 Marcus Geelnard - Copyright (c) 2006-2019 Camilla Löwy - */ - - const char* prefix = (const char*)"file://"; - - char* line; - - win->event.droppedFilesCount = 0; - - win->event.type = RGFW_dnd; - - while ((line = strtok(data, "\r\n"))) { - char path[RGFW_MAX_PATH]; - - data = NULL; - - if (line[0] == '#') - continue; - - char* l; - for (l = line; 1; l++) { - if ((l - line) > 7) - break; - else if (*l != prefix[(l - line)]) - break; - else if (*l == '\0' && prefix[(l - line)] == '\0') { - line += 7; - while (*line != '/') - line++; - break; - } else if (*l == '\0') - break; - } - - win->event.droppedFilesCount++; - - size_t index = 0; - while (*line) { - if (line[0] == '%' && line[1] && line[2]) { - const char digits[3] = { line[1], line[2], '\0' }; - path[index] = (char) strtol(digits, NULL, 16); - line += 2; - } else - path[index] = *line; - - index++; - line++; - } - path[index] = '\0'; - strncpy(win->event.droppedFiles[win->event.droppedFilesCount - 1], path, index + 1); - } - - if (data) - XFree(data); - - if (xdnd.version >= 2) { - reply.xclient.message_type = XdndFinished; - reply.xclient.data.l[1] = result; - reply.xclient.data.l[2] = XdndActionCopy; - - XSendEvent((Display*) win->src.display, xdnd.source, False, NoEventMask, &reply); - XFlush((Display*) win->src.display); - } - - RGFW_dndCallback(win, win->event.droppedFiles, win->event.droppedFilesCount); - break; - } - case FocusIn: - win->event.inFocus = 1; - win->event.type = RGFW_focusIn; - RGFW_focusCallback(win, 1); - break; - - break; - case FocusOut: - win->event.inFocus = 0; - win->event.type = RGFW_focusOut; - RGFW_focusCallback(win, 0); - break; - - case EnterNotify: { - win->event.type = RGFW_mouseEnter; - win->event.point.x = E.xcrossing.x; - win->event.point.y = E.xcrossing.y; - RGFW_mouseNotifyCallBack(win, win->event.point, 1); - break; - } - - case LeaveNotify: { - win->event.type = RGFW_mouseLeave; - RGFW_mouseNotifyCallBack(win, win->event.point, 0); - break; - } - - case ConfigureNotify: { - /* detect resize */ - if (E.xconfigure.width != win->r.w || E.xconfigure.height != win->r.h) { - win->event.type = RGFW_windowResized; - win->r = RGFW_RECT(win->r.x, win->r.y, E.xconfigure.width, E.xconfigure.height); - RGFW_windowResizeCallback(win, win->r); + case SelectionNotify: { + /* this is only for checking for xdnd drops */ + if (E.xselection.property != XdndSelection || !(win->_winArgs | RGFW_ALLOW_DND)) break; - } - - /* detect move */ - if (E.xconfigure.x != win->r.x || E.xconfigure.y != win->r.y) { - win->event.type = RGFW_windowMoved; - win->r = RGFW_RECT(E.xconfigure.x, E.xconfigure.y, win->r.w, win->r.h); - RGFW_windowMoveCallback(win, win->r); + + char* data; + unsigned long result; + + Atom actualType; + i32 actualFormat; + unsigned long bytesAfter; + + XGetWindowProperty((Display*) win->src.display, E.xselection.requestor, E.xselection.property, 0, LONG_MAX, False, E.xselection.target, &actualType, &actualFormat, &result, &bytesAfter, (u8**) &data); + + if (result == 0) break; - } + + /* + SOURCED FROM GLFW _glfwParseUriList + Copyright (c) 2002-2006 Marcus Geelnard + Copyright (c) 2006-2019 Camilla Löwy + */ + + const char* prefix = (const char*)"file://"; + + char* line; + + win->event.droppedFilesCount = 0; + + win->event.type = RGFW_dnd; + + while ((line = strtok(data, "\r\n"))) { + char path[RGFW_MAX_PATH]; + + data = NULL; + + if (line[0] == '#') + continue; + + char* l; + for (l = line; 1; l++) { + if ((l - line) > 7) + break; + else if (*l != prefix[(l - line)]) + break; + else if (*l == '\0' && prefix[(l - line)] == '\0') { + line += 7; + while (*line != '/') + line++; + break; + } else if (*l == '\0') + break; + } + + win->event.droppedFilesCount++; + + size_t index = 0; + while (*line) { + if (line[0] == '%' && line[1] && line[2]) { + const char digits[3] = { line[1], line[2], '\0' }; + path[index] = (char) strtol(digits, NULL, 16); + line += 2; + } else + path[index] = *line; + + index++; + line++; + } + path[index] = '\0'; + strncpy(win->event.droppedFiles[win->event.droppedFilesCount - 1], path, index + 1); + } + + if (data) + XFree(data); + + if (xdnd.version >= 2) { + XEvent reply = { ClientMessage }; + reply.xclient.format = 32; + reply.xclient.message_type = XdndFinished; + reply.xclient.data.l[1] = result; + reply.xclient.data.l[2] = XdndActionCopy; + + XSendEvent((Display*) win->src.display, xdnd.source, False, NoEventMask, &reply); + XFlush((Display*) win->src.display); + } + + RGFW_dndCallback(win, win->event.droppedFiles, win->event.droppedFilesCount); + break; + } + case FocusIn: + win->event.inFocus = 1; + win->event.type = RGFW_focusIn; + RGFW_focusCallback(win, 1); + break; break; - } - default: { - break; - } + case FocusOut: + win->event.inFocus = 0; + win->event.type = RGFW_focusOut; + RGFW_focusCallback(win, 0); + break; + + case EnterNotify: { + win->event.type = RGFW_mouseEnter; + win->event.point.x = E.xcrossing.x; + win->event.point.y = E.xcrossing.y; + RGFW_mouseNotifyCallBack(win, win->event.point, 1); + break; + } + + case LeaveNotify: { + win->event.type = RGFW_mouseLeave; + RGFW_mouseNotifyCallBack(win, win->event.point, 0); + break; + } + + case ConfigureNotify: { + /* detect resize */ + if (E.xconfigure.width != win->r.w || E.xconfigure.height != win->r.h) { + win->event.type = RGFW_windowResized; + win->r = RGFW_RECT(win->r.x, win->r.y, E.xconfigure.width, E.xconfigure.height); + RGFW_windowResizeCallback(win, win->r); + break; + } + + /* detect move */ + if (E.xconfigure.x != win->r.x || E.xconfigure.y != win->r.y) { + win->event.type = RGFW_windowMoved; + win->r = RGFW_RECT(E.xconfigure.x, E.xconfigure.y, win->r.w, win->r.h); + RGFW_windowMoveCallback(win, win->r); + break; + } + + break; + } + default: { + break; + } + } + + XFlush((Display*) win->src.display); + + if (win->event.type) + return &win->event; + else + return NULL; } - XFlush((Display*) win->src.display); + void RGFW_window_move(RGFW_window* win, RGFW_point v) { + assert(win != NULL); + win->r.x = v.x; + win->r.y = v.y; - if (win->event.type) - return &win->event; - else - return NULL; - } - - void RGFW_window_move(RGFW_window* win, RGFW_point v) { - assert(win != NULL); - win->r.x = v.x; - win->r.y = v.y; - - XMoveWindow((Display*) win->src.display, (Window) win->src.window, v.x, v.y); - } + XMoveWindow((Display*) win->src.display, (Window) win->src.window, v.x, v.y); + } - void RGFW_window_resize(RGFW_window* win, RGFW_area a) { - assert(win != NULL); - win->r.w = a.w; - win->r.h = a.h; + void RGFW_window_resize(RGFW_window* win, RGFW_area a) { + assert(win != NULL); + win->r.w = a.w; + win->r.h = a.h; - XResizeWindow((Display*) win->src.display, (Window) win->src.window, a.w, a.h); + + XResizeWindow((Display*) win->src.display, (Window) win->src.window, a.w, a.h); + + if (!(win->_winArgs & RGFW_NO_RESIZE)) + return; + + XSizeHints sh = {0}; + sh.flags = (1L << 4) | (1L << 5); + sh.min_width = sh.max_width = a.w; + sh.min_height = sh.max_height = a.h; + + XSetWMSizeHints((Display*) win->src.display, (Drawable) win->src.window, &sh, XA_WM_NORMAL_HINTS); } void RGFW_window_setMinSize(RGFW_window* win, RGFW_area a) { @@ -3727,8 +3762,8 @@ Start of Linux / Unix defines RGFW_area size = RGFW_getScreenSize(); monitor.rect = RGFW_RECT(0, 0, size.w, size.h); - monitor.physW = DisplayWidthMM(display, screen); - monitor.physH = DisplayHeightMM(display, screen); + monitor.physW = DisplayWidthMM(display, screen) / 25.4; + monitor.physH = DisplayHeightMM(display, screen) / 25.4; XGetSystemContentScale(display, &monitor.scaleX, &monitor.scaleY); XRRScreenResources* sr = XRRGetScreenResourcesCurrent(display, RootWindow(display, screen)); @@ -3741,8 +3776,8 @@ Start of Linux / Unix defines } if (ci == NULL) { - float dpi_width = round((double)monitor.rect.w/(((double)monitor.physW)/25.4)); - float dpi_height = round((double)monitor.rect.h/(((double)monitor.physH)/25.4)); + float dpi_width = round((double)monitor.rect.w/(double)monitor.physW); + float dpi_height = round((double)monitor.rect.h/(double)monitor.physH); monitor.scaleX = (float) (dpi_width) / (float) 96; monitor.scaleY = (float) (dpi_height) / (float) 96; @@ -3752,24 +3787,24 @@ Start of Linux / Unix defines } XRROutputInfo* info = XRRGetOutputInfo (display, sr, sr->outputs[screen]); - monitor.physW = info->mm_width; - monitor.physH = info->mm_height; + monitor.physW = info->mm_width / 25.4; + monitor.physH = info->mm_height / 25.4; monitor.rect.x = ci->x; monitor.rect.y = ci->y; monitor.rect.w = ci->width; monitor.rect.h = ci->height; - float dpi_width = round((double)monitor.rect.w/(((double)monitor.physW)/25.4)); - float dpi_height = round((double)monitor.rect.h/(((double)monitor.physH)/25.4)); + float dpi_width = round((double)monitor.rect.w/(double)monitor.physW); + float dpi_height = round((double)monitor.rect.h/(double)monitor.physH); monitor.scaleX = (float) (dpi_width) / (float) 96; monitor.scaleY = (float) (dpi_height) / (float) 96; - if (monitor.scaleX > 1 && monitor.scaleX < 1.1) + if (isinf(monitor.scaleX) || (monitor.scaleX > 1 && monitor.scaleX < 1.1)) monitor.scaleX = 1; - if (monitor.scaleY > 1 && monitor.scaleY < 1.1) + if (isinf(monitor.scaleY) || (monitor.scaleY > 1 && monitor.scaleY < 1.1)) monitor.scaleY = 1; XRRFreeCrtcInfo(ci); @@ -3951,8 +3986,8 @@ Start of Linux / Unix defines } u8 i; - for (i = 0; i < RGFW_joystickCount; i++) - close(RGFW_joysticks[i]); + for (i = 0; i < RGFW_gamepadCount; i++) + close(RGFW_gamepads[i]); } /* set cleared display / window to NULL for error checking */ @@ -3975,43 +4010,43 @@ Start of Linux / Unix defines #include #include #include - u16 RGFW_registerJoystickF(RGFW_window* win, char* file) { + u16 RGFW_registerGamepadF(RGFW_window* win, char* file) { assert(win != NULL); #ifdef __linux__ i32 js = open(file, O_RDONLY); - if (js && RGFW_joystickCount < 4) { - RGFW_joystickCount++; + if (js && RGFW_gamepadCount < 4) { + RGFW_gamepadCount++; - RGFW_joysticks[RGFW_joystickCount - 1] = open(file, O_RDONLY); + RGFW_gamepads[RGFW_gamepadCount - 1] = open(file, O_RDONLY); u8 i; for (i = 0; i < 16; i++) - RGFW_jsPressed[RGFW_joystickCount - 1][i] = 0; + RGFW_gpPressed[RGFW_gamepadCount - 1][i] = 0; } else { #ifdef RGFW_PRINT_ERRORS RGFW_error = 1; - fprintf(stderr, "Error RGFW_registerJoystickF : Cannot open file %s\n", file); + fprintf(stderr, "Error RGFW_registerGamepadF : Cannot open file %s\n", file); #endif } - return RGFW_joystickCount - 1; + return RGFW_gamepadCount - 1; #endif } - u16 RGFW_registerJoystick(RGFW_window* win, i32 jsNumber) { + u16 RGFW_registerGamepad(RGFW_window* win, i32 gpNumber) { assert(win != NULL); #ifdef __linux__ char file[15]; - sprintf(file, "/dev/input/js%i", jsNumber); + sprintf(file, "/dev/input/js%i", gpNumber); - return RGFW_registerJoystickF(win, file); + return RGFW_registerGamepadF(win, file); #endif } @@ -4047,7 +4082,7 @@ Start of Linux / Unix defines { ConnectionNumber(win->src.display), POLLIN, 0 }, #endif { RGFW_eventWait_forceStop[0], POLLIN, 0 }, - #ifdef __linux__ /* blank space for 4 joystick files*/ + #ifdef __linux__ /* blank space for 4 gamepad files*/ { -1, POLLIN, 0 }, {-1, POLLIN, 0 }, {-1, POLLIN, 0 }, {-1, POLLIN, 0} #endif }; @@ -4055,11 +4090,11 @@ Start of Linux / Unix defines u8 index = 2; #if defined(__linux__) - for (i = 0; i < RGFW_joystickCount; i++) { - if (RGFW_joysticks[i] == 0) + for (i = 0; i < RGFW_gamepadCount; i++) { + if (RGFW_gamepads[i] == 0) continue; - fds[index].fd = RGFW_joysticks[i]; + fds[index].fd = RGFW_gamepads[i]; index++; } #endif @@ -4745,7 +4780,7 @@ static const struct wl_callback_listener wl_surface_frame_listener = { } #ifdef __linux__ - RGFW_Event* event = RGFW_linux_updateJoystick(win); + RGFW_Event* event = RGFW_linux_updateGamepad(win); if (event != NULL) return event; #endif @@ -5071,7 +5106,7 @@ static const struct wl_callback_listener wl_surface_frame_listener = { #define wglGetSwapIntervalEXT wglGetSwapIntervalEXTSrc - void* RGFWjoystickApi = NULL; + void* RGFWgamepadApi = NULL; /* these two wgl functions need to be preloaded */ typedef HGLRC (WINAPI *PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC hdc, HGLRC hglrc, const int *attribList); @@ -5186,22 +5221,29 @@ static HMODULE wglinstance = NULL; u32 i; static const char* names[] = { "xinput1_4.dll", - "xinput1_3.dll", "xinput9_1_0.dll", "xinput1_2.dll", "xinput1_1.dll" }; - for (i = 0; i < sizeof(names) / sizeof(const char*); i++) { + for (i = 0; i < sizeof(names) / sizeof(const char*) && (XInputGetStateSRC == NULL || XInputGetStateSRC != NULL); i++) { RGFW_XInput_dll = LoadLibraryA(names[i]); - if (RGFW_XInput_dll) { + if (RGFW_XInput_dll == NULL) + continue; + + if (XInputGetStateSRC == NULL) XInputGetStateSRC = (PFN_XInputGetState)(void*)GetProcAddress(RGFW_XInput_dll, "XInputGetState"); - - if (XInputGetStateSRC == NULL) - printf("Failed to load XInputGetState"); - } + + if (XInputGetKeystrokeSRC == NULL) + XInputGetKeystrokeSRC = (PFN_XInputGetKeystroke)(void*)GetProcAddress(RGFW_XInput_dll, "XInputGetKeystroke"); } + + if (XInputGetStateSRC == NULL) + printf("RGFW ERR: Failed to load XInputGetState\n"); + if (XInputGetKeystrokeSRC == NULL) + printf("RGFW ERR: Failed to load XInputGetKeystroke\n"); + } #endif @@ -5276,7 +5318,9 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ if (RGFW_Shcore_dll == NULL) { RGFW_Shcore_dll = LoadLibraryA("shcore.dll"); GetDpiForMonitorSRC = (PFN_GetDpiForMonitor)(void*)GetProcAddress(RGFW_Shcore_dll, "GetDpiForMonitor"); - SetProcessDPIAware(); + #if (_WIN32_WINNT >= 0x0600) + SetProcessDPIAware(); + #endif } #endif @@ -5319,6 +5363,11 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ Class.hCursor = LoadCursor(NULL, IDC_ARROW); Class.lpfnWndProc = WndProc; + Class.hIcon = LoadImageA(GetModuleHandleW(NULL), "RGFW_ICON", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED); + if (Class.hIcon == NULL) { + Class.hIcon = LoadImageA(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED); + } + RegisterClassA(&Class); DWORD window_style = WS_CLIPSIBLINGS | WS_CLIPCHILDREN; @@ -5331,7 +5380,8 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ if (!(args & RGFW_NO_RESIZE)) window_style |= WS_SIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME; } else - window_style |= WS_POPUP | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX; + window_style |= WS_POPUP | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX; + HWND dummyWin = CreateWindowA(Class.lpszClassName, name, window_style, win->r.x, win->r.y, win->r.w, win->r.h, 0, 0, inh, 0); @@ -5623,26 +5673,27 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ u8 RGFW_xinput2RGFW[] = { - RGFW_JS_A, /* or PS X button */ - RGFW_JS_B, /* or PS circle button */ - RGFW_JS_X, /* or PS square button */ - RGFW_JS_Y, /* or PS triangle button */ - RGFW_JS_R1, /* right bumper */ - RGFW_JS_L1, /* left bump */ - RGFW_JS_L2, /* left trigger*/ - RGFW_JS_R2, /* right trigger */ + RGFW_GP_A, /* or PS X button */ + RGFW_GP_B, /* or PS circle button */ + RGFW_GP_X, /* or PS square button */ + RGFW_GP_Y, /* or PS triangle button */ + RGFW_GP_R1, /* right bumper */ + RGFW_GP_L1, /* left bump */ + RGFW_GP_L2, /* left trigger*/ + RGFW_GP_R2, /* right trigger */ 0, 0, 0, 0, 0, 0, 0, 0, - RGFW_JS_UP, /* dpad up */ - RGFW_JS_DOWN, /* dpad down*/ - RGFW_JS_LEFT, /* dpad left */ - RGFW_JS_RIGHT, /* dpad right */ - RGFW_JS_START, /* start button */ - RGFW_JS_SELECT/* select button */ + RGFW_GP_UP, /* dpad up */ + RGFW_GP_DOWN, /* dpad down*/ + RGFW_GP_LEFT, /* dpad left */ + RGFW_GP_RIGHT, /* dpad right */ + RGFW_GP_START, /* start button */ + RGFW_GP_SELECT,/* select button */ + RGFW_GP_L3, + RGFW_GP_R3, }; static i32 RGFW_checkXInput(RGFW_window* win, RGFW_Event* e) { RGFW_UNUSED(win) - size_t i; for (i = 0; i < 4; i++) { XINPUT_KEYSTROKE keystroke; @@ -5655,14 +5706,14 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ if ((keystroke.Flags & XINPUT_KEYSTROKE_REPEAT) == 0 && result != ERROR_EMPTY) { if (result != ERROR_SUCCESS) return 0; - - if (keystroke.VirtualKey > VK_PAD_BACK) + + if (keystroke.VirtualKey > VK_PAD_RTHUMB_PRESS) continue; - - // RGFW_jsButtonPressed + 1 = RGFW_jsButtonReleased - e->type = RGFW_jsButtonPressed + !(keystroke.Flags & XINPUT_KEYSTROKE_KEYDOWN); + + //gp + 1 = RGFW_gpButtonReleased + e->type = RGFW_gpButtonPressed + !(keystroke.Flags & XINPUT_KEYSTROKE_KEYDOWN); e->button = RGFW_xinput2RGFW[keystroke.VirtualKey - 0x5800]; - RGFW_jsPressed[i][e->button] = !(keystroke.Flags & XINPUT_KEYSTROKE_KEYDOWN); + RGFW_gpPressed[i][e->button] = !(keystroke.Flags & XINPUT_KEYSTROKE_KEYDOWN); return 1; } @@ -5672,6 +5723,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ XInputGetState((DWORD) i, &state) == ERROR_DEVICE_NOT_CONNECTED ) return 0; + #define INPUT_DEADZONE ( 0.24f * (float)(0x7FFF) ) // Default to 24% of the +/- 32767 range. This is a reasonable default value but can be altered if needed. if ((state.Gamepad.sThumbLX < INPUT_DEADZONE && @@ -5693,20 +5745,26 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ } e->axisesCount = 2; - RGFW_point axis1 = RGFW_POINT(state.Gamepad.sThumbLX, state.Gamepad.sThumbLY); - RGFW_point axis2 = RGFW_POINT(state.Gamepad.sThumbRX, state.Gamepad.sThumbRY); + RGFW_point axis1 = RGFW_POINT(((float)state.Gamepad.sThumbLX / 32768.0f) * 100, ((float)state.Gamepad.sThumbLY / -32768.0f) * 100); + RGFW_point axis2 = RGFW_POINT(((float)state.Gamepad.sThumbRX / 32768.0f) * 100, ((float)state.Gamepad.sThumbRY / -32768.0f) * 100); - if (axis1.x != e->axis[0].x || axis1.y != e->axis[0].y || axis2.x != e->axis[1].x || axis2.y != e->axis[1].y) { - e->type = RGFW_jsAxisMove; + if (axis1.x != e->axis[0].x || axis1.y != e->axis[0].y){ + win->event.whichAxis = 0; + + e->type = RGFW_gpAxisMove; e->axis[0] = axis1; - e->axis[1] = axis2; return 1; } - e->axis[0] = axis1; - e->axis[1] = axis2; + if (axis2.x != e->axis[1].x || axis2.y != e->axis[1].y) { + win->event.whichAxis = 1; + e->type = RGFW_gpAxisMove; + e->axis[1] = axis2; + + return 1; + } } return 0; @@ -6501,19 +6559,19 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ CloseClipboard(); } - u16 RGFW_registerJoystick(RGFW_window* win, i32 jsNumber) { + u16 RGFW_registerGamepad(RGFW_window* win, i32 gpNumber) { assert(win != NULL); - RGFW_UNUSED(jsNumber) + RGFW_UNUSED(gpNumber) - return RGFW_registerJoystickF(win, (char*) ""); + return RGFW_registerGamepadF(win, (char*) ""); } - u16 RGFW_registerJoystickF(RGFW_window* win, char* file) { + u16 RGFW_registerGamepadF(RGFW_window* win, char* file) { assert(win != NULL); RGFW_UNUSED(file) - return RGFW_joystickCount - 1; + return RGFW_gamepadCount - 1; } void RGFW_window_moveMouse(RGFW_window* win, RGFW_point p) { @@ -8046,11 +8104,20 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ monitor.rect = RGFW_RECT((int) bounds.origin.x, (int) bounds.origin.y, (int) bounds.size.width, (int) bounds.size.height); CGSize screenSizeMM = CGDisplayScreenSize(display); - monitor.physW = screenSizeMM.width; - monitor.physH = screenSizeMM.height; + monitor.physW = (float)screenSizeMM.width / 25.4f; + monitor.physH = (float)screenSizeMM.height / 25.4f; - monitor.scaleX = ((monitor.rect.w / (screenSizeMM.width / 25.4)) / 96) + 0.25; - monitor.scaleY = ((monitor.rect.h / (screenSizeMM.height / 25.4)) / 96) + 0.25; + float dpi_width = round((double)monitor.rect.w/(double)monitor.physW); + float dpi_height = round((double)monitor.rect.h/(double)monitor.physH); + + monitor.scaleX = (float) (dpi_width) / (float) 96; + monitor.scaleY = (float) (dpi_height) / (float) 96; + + if (isinf(monitor.scaleX) || (monitor.scaleX > 1 && monitor.scaleX < 1.1)) + monitor.scaleX = 1; + + if (isinf(monitor.scaleY) || (monitor.scaleY > 1 && monitor.scaleY < 1.1)) + monitor.scaleY = 1; return monitor; } @@ -8111,20 +8178,20 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ NSPasteBoard_setString(NSPasteboard_generalPasteboard(), text, NSPasteboardTypeString); } - u16 RGFW_registerJoystick(RGFW_window* win, i32 jsNumber) { - RGFW_UNUSED(jsNumber); + u16 RGFW_registerGamepad(RGFW_window* win, i32 gpNumber) { + RGFW_UNUSED(gpNumber); assert(win != NULL); - return RGFW_registerJoystickF(win, (char*) ""); + return RGFW_registerGamepadF(win, (char*) ""); } - u16 RGFW_registerJoystickF(RGFW_window* win, char* file) { + u16 RGFW_registerGamepadF(RGFW_window* win, char* file) { RGFW_UNUSED(file); assert(win != NULL); - return RGFW_joystickCount - 1; + return RGFW_gamepadCount - 1; } #ifdef RGFW_OPENGL @@ -8311,16 +8378,47 @@ EM_BOOL Emscripten_on_resize(int eventType, const EmscriptenUiEvent* e, void* us } EM_BOOL Emscripten_on_fullscreenchange(int eventType, const EmscriptenFullscreenChangeEvent* e, void* userData) { - RGFW_UNUSED(eventType); RGFW_UNUSED(userData); + static u8 fullscreen = RGFW_FALSE; + static RGFW_rect ogRect; + + if (fullscreen == RGFW_FALSE) { + ogRect = RGFW_root->r; + } + fullscreen = !fullscreen; + + RGFW_UNUSED(eventType); RGFW_UNUSED(userData); + RGFW_events[RGFW_eventLen].type = RGFW_windowResized; RGFW_eventLen++; + + RGFW_root->r = RGFW_RECT(0, 0, e->screenWidth, e->screenHeight); + + EM_ASM("Module.canvas.focus();"); + + if (fullscreen == RGFW_FALSE) { + RGFW_root->r = RGFW_RECT(0, 0, ogRect.w, ogRect.h); + // emscripten_request_fullscreen("#canvas", 0); + } else { + #if __EMSCRIPTEN_major__ >= 1 && __EMSCRIPTEN_minor__ >= 29 && __EMSCRIPTEN_tiny__ >= 0 + EmscriptenFullscreenStrategy FSStrat = {0}; + FSStrat.scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH;//EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT;// : EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH; + FSStrat.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_HIDEF; + FSStrat.filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT; + emscripten_request_fullscreen_strategy("#canvas", 1, &FSStrat); + #else + emscripten_request_fullscreen("#canvas", 1); + #endif + } + + emscripten_set_canvas_element_size("#canvas", RGFW_root->r.w, RGFW_root->r.h); - RGFW_root->r = RGFW_RECT(0, 0, e->elementWidth, e->elementHeight); RGFW_windowResizeCallback(RGFW_root, RGFW_root->r); - return EM_TRUE; + return EM_TRUE; } + + EM_BOOL Emscripten_on_focusin(int eventType, const EmscriptenFocusEvent* e, void* userData) { RGFW_UNUSED(eventType); RGFW_UNUSED(userData); RGFW_UNUSED(e); @@ -8399,7 +8497,7 @@ EM_BOOL Emscripten_on_wheel(int eventType, const EmscriptenWheelEvent* e, void* RGFW_events[RGFW_eventLen].type = RGFW_mouseButtonPressed; RGFW_events[RGFW_eventLen].point = RGFW_POINT(e->mouse.targetX, e->mouse.targetY); RGFW_events[RGFW_eventLen].button = RGFW_mouseScrollUp + (e->deltaY < 0); - RGFW_events[RGFW_eventLen].scroll = e->deltaY; + RGFW_events[RGFW_eventLen].scroll = e->deltaY < 0 ? 1 : -1; RGFW_mouseButtons[RGFW_events[RGFW_eventLen].button].prev = RGFW_mouseButtons[RGFW_events[RGFW_eventLen].button].current; RGFW_mouseButtons[RGFW_events[RGFW_eventLen].button].current = 1; @@ -8472,8 +8570,8 @@ EM_BOOL Emscripten_on_gamepad(int eventType, const EmscriptenGamepadEvent *gamep if (gamepadEvent->index >= 4) return 0; - - RGFW_joysticks[gamepadEvent->index] = gamepadEvent->connected; + + RGFW_gamepads[gamepadEvent->index] = gamepadEvent->connected; return 1; // The event was consumed by the callback handler } @@ -8532,8 +8630,7 @@ void EMSCRIPTEN_KEEPALIVE RGFW_makeSetValue(size_t index, char* file) { */ RGFW_events[RGFW_eventLen].type = RGFW_dnd; - char** arr = (char**)&RGFW_events[RGFW_eventLen].droppedFiles[index]; - *arr = file; + strcpy((char*)RGFW_events[RGFW_eventLen].droppedFiles[index], file); } #include @@ -8687,49 +8784,58 @@ RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, u16 args) { RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { static u8 index = 0; - if (index == 0) + if (index == 0) { RGFW_resetKey(); - + } + + emscripten_sample_gamepad_data(); /* check gamepads */ for (int i = 0; (i < emscripten_get_num_gamepads()) && (i < 4); i++) { - if (RGFW_joysticks[i] == 0) - continue;; - + if (RGFW_gamepads[i] == 0) + continue; EmscriptenGamepadEvent gamepadState; if (emscripten_get_gamepad_status(i, &gamepadState) != EMSCRIPTEN_RESULT_SUCCESS) break; - + // Register buttons data for every connected gamepad for (int j = 0; (j < gamepadState.numButtons) && (j < 16); j++) { u32 map[] = { - RGFW_JS_A, RGFW_JS_X, RGFW_JS_B, RGFW_JS_Y, - RGFW_JS_L1, RGFW_JS_R1, RGFW_JS_L2, RGFW_JS_R2, - RGFW_JS_SELECT, RGFW_JS_START, - 0, 0, - RGFW_JS_UP, RGFW_JS_DOWN, RGFW_JS_LEFT, RGFW_JS_RIGHT + RGFW_GP_A, RGFW_GP_B, RGFW_GP_X, RGFW_GP_Y, + RGFW_GP_L1, RGFW_GP_R1, RGFW_GP_L2, RGFW_GP_R2, + RGFW_GP_SELECT, RGFW_GP_START, + RGFW_GP_L3, RGFW_GP_R3, + RGFW_GP_UP, RGFW_GP_DOWN, RGFW_GP_LEFT, RGFW_GP_RIGHT }; + u32 button = map[j]; - if (RGFW_jsPressed[i][button] != gamepadState.digitalButton[j]) { - win->event.type = RGFW_jsButtonPressed; - win->event.joystick = i; + if (button == 404) + continue; + + if (RGFW_gpPressed[i][button] != gamepadState.digitalButton[j]) { + if (gamepadState.digitalButton[j]) + win->event.type = RGFW_gpButtonPressed; + else + win->event.type = RGFW_gpButtonReleased; + + win->event.gamepad = i; win->event.button = map[j]; + RGFW_gpPressed[i][button] = gamepadState.digitalButton[j]; return &win->event; } - - RGFW_jsPressed[i][button] = gamepadState.digitalButton[j]; } for (int j = 0; (j < gamepadState.numAxes) && (j < 4); j += 2) { - win->event.axisesCount = gamepadState.numAxes; - if (win->event.axis[j].x != gamepadState.axis[j] || - win->event.axis[j].y != gamepadState.axis[j + 1] + win->event.axisesCount = gamepadState.numAxes / 2; + if (win->event.axis[j / 2].x != (i8)(gamepadState.axis[j] * 100.0f) || + win->event.axis[j / 2].y != (i8)(gamepadState.axis[j + 1] * 100.0f) ) { - win->event.axis[j].x = gamepadState.axis[j]; - win->event.axis[j].y = gamepadState.axis[j + 1]; - win->event.type = RGFW_jsAxisMove; - win->event.joystick = i; + win->event.axis[j / 2].x = (i8)(gamepadState.axis[j] * 100.0f); + win->event.axis[j / 2].y = (i8)(gamepadState.axis[j + 1] * 100.0f); + win->event.type = RGFW_gpAxisMove; + win->event.gamepad = i; + win->event.whichAxis = j / 2; return &win->event; } } @@ -8738,7 +8844,7 @@ RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { /* check queued events */ if (RGFW_eventLen == 0) return NULL; - + RGFW_events[index].frameTime = win->event.frameTime; RGFW_events[index].frameTime2 = win->event.frameTime2; RGFW_events[index].inFocus = win->event.inFocus; diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 3cf005f25..d9ba8185c 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -6,6 +6,8 @@ * - Windows (Win32, Win64) * - Linux (X11/Wayland desktop mode) * - MacOS (Cocoa) +* - HTML5 (Emscripten) +* - Others (untested) * * LIMITATIONS: * - TODO @@ -46,7 +48,11 @@ * **********************************************************************************************/ -#if defined(GRAPHICS_API_OPENGL_ES2) +#if defined(PLATFORM_WEB_RGFW) +#define RGFW_NO_GL_HEADER +#endif + +#if defined(GRAPHICS_API_OPENGL_ES2) && !defined(PLATFORM_WEB_RGFW) #define RGFW_OPENGL_ES2 #endif @@ -80,6 +86,10 @@ void CloseWindow(void); #define Size NSSIZE #endif +#define RGFW_MALLOC RL_MALLOC +#define RGFW_FREE RL_FREE +#define RGFW_CALLOC RL_CALLOC + #include "../external/RGFW.h" #if defined(_WIN32) || defined(_WIN64) @@ -118,6 +128,7 @@ static bool RGFW_disableCursor = false; static const unsigned short keyMappingRGFW[] = { [RGFW_KEY_NULL] = KEY_NULL, + [RGFW_Return] = KEY_ENTER, [RGFW_Quote] = KEY_APOSTROPHE, [RGFW_Comma] = KEY_COMMA, [RGFW_Minus] = KEY_MINUS, @@ -246,7 +257,7 @@ bool WindowShouldClose(void) // Toggle fullscreen mode void ToggleFullscreen(void) -{ +{ RGFW_window_maximize(platform.window); ToggleBorderlessWindowed(); } @@ -611,7 +622,7 @@ int GetMonitorPhysicalWidth(int monitor) { RGFW_monitor *mons = RGFW_getMonitors(); - return (int)mons[monitor].physW; + return mons[monitor].physW; } // Get selected monitor physical height in millimetres @@ -664,39 +675,42 @@ const char *GetClipboardText(void) return RGFW_readClipboard(NULL); } + #if defined(SUPPORT_CLIPBOARD_IMAGE) -#if defined(_WIN32) - #define WIN32_CLIPBOARD_IMPLEMENTATION - #define WINUSER_ALREADY_INCLUDED - #define WINBASE_ALREADY_INCLUDED - #define WINGDI_ALREADY_INCLUDED - #include "../external/win32_clipboard.h" + +#ifdef _WIN32 +# define WIN32_CLIPBOARD_IMPLEMENTATION +# define WINUSER_ALREADY_INCLUDED +# define WINBASE_ALREADY_INCLUDED +# define WINGDI_ALREADY_INCLUDED +# include "../external/win32_clipboard.h" #endif -#endif // SUPPORT_CLIPBOARD_IMAGE // Get clipboard image Image GetClipboardImage(void) { - Image image = { 0 }; - -#if defined(SUPPORT_CLIPBOARD_IMAGE) -#if defined(_WIN32) + Image image = {0}; unsigned long long int dataSize = 0; - void *fileData = NULL; - int width = 0; - int height = 0; + void* fileData = NULL; +#ifdef _WIN32 + int width, height; fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); - - if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); - else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); #else - TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); + TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement `GetClipboardImage` for this OS"); #endif -#endif // SUPPORT_CLIPBOARD_IMAGE + if (fileData == NULL) + { + TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); + } + else + { + image = LoadImageFromMemory(".bmp", fileData, dataSize); + } return image; } +#endif // SUPPORT_CLIPBOARD_IMAGE // Show mouse cursor void ShowCursor(void) @@ -861,6 +875,28 @@ char RSGL_keystrToChar(const char *str) return '\0'; } +int RGFW_gpConvTable[18] = { + [RGFW_GP_Y] = GAMEPAD_BUTTON_RIGHT_FACE_UP, + [RGFW_GP_B] = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, + [RGFW_GP_A] = GAMEPAD_BUTTON_RIGHT_FACE_DOWN, + [RGFW_GP_X] = GAMEPAD_BUTTON_RIGHT_FACE_LEFT, + [RGFW_GP_L1] = GAMEPAD_BUTTON_LEFT_TRIGGER_1, + [RGFW_GP_R1] = GAMEPAD_BUTTON_RIGHT_TRIGGER_1, + [RGFW_GP_L2] = GAMEPAD_BUTTON_LEFT_TRIGGER_2, + [RGFW_GP_R2] = GAMEPAD_BUTTON_RIGHT_TRIGGER_2, + [RGFW_GP_SELECT] = GAMEPAD_BUTTON_MIDDLE_LEFT, + [RGFW_GP_HOME] = GAMEPAD_BUTTON_MIDDLE, + [RGFW_GP_START] = GAMEPAD_BUTTON_MIDDLE_RIGHT, + [RGFW_GP_UP] = GAMEPAD_BUTTON_LEFT_FACE_UP, + [RGFW_GP_RIGHT] = GAMEPAD_BUTTON_LEFT_FACE_RIGHT, + [RGFW_GP_DOWN] = GAMEPAD_BUTTON_LEFT_FACE_DOWN, + [RGFW_GP_LEFT] = GAMEPAD_BUTTON_LEFT_FACE_LEFT, + [RGFW_GP_L3] = GAMEPAD_BUTTON_LEFT_THUMB, + [RGFW_GP_R3] = GAMEPAD_BUTTON_RIGHT_THUMB, +}; + + + // Register all input events void PollInputEvents(void) { @@ -869,7 +905,7 @@ void PollInputEvents(void) // because ProcessGestureEvent() is just called on an event, not every frame UpdateGestures(); #endif - + // Reset keys/chars pressed registered CORE.Input.Keyboard.keyPressedQueueCount = 0; CORE.Input.Keyboard.charPressedQueueCount = 0; @@ -933,27 +969,27 @@ void PollInputEvents(void) while (RGFW_window_checkEvent(platform.window)) { - if ((platform.window->event.type >= RGFW_jsButtonPressed) && (platform.window->event.type <= RGFW_jsAxisMove)) + if ((platform.window->event.type >= RGFW_gpButtonPressed) && (platform.window->event.type <= RGFW_gpAxisMove)) { - if (!CORE.Input.Gamepad.ready[platform.window->event.joystick]) + if (!CORE.Input.Gamepad.ready[platform.window->event.gamepad]) { - CORE.Input.Gamepad.ready[platform.window->event.joystick] = true; - CORE.Input.Gamepad.axisCount[platform.window->event.joystick] = platform.window->event.axisesCount; - CORE.Input.Gamepad.name[platform.window->event.joystick][0] = '\0'; - CORE.Input.Gamepad.axisState[platform.window->event.joystick][GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f; - CORE.Input.Gamepad.axisState[platform.window->event.joystick][GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f; + CORE.Input.Gamepad.ready[platform.window->event.gamepad] = true; + CORE.Input.Gamepad.axisCount[platform.window->event.gamepad] = platform.window->event.axisesCount; + CORE.Input.Gamepad.name[platform.window->event.gamepad][0] = '\0'; + CORE.Input.Gamepad.axisState[platform.window->event.gamepad][GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f; + CORE.Input.Gamepad.axisState[platform.window->event.gamepad][GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f; } } RGFW_Event *event = &platform.window->event; - // All input events can be processed after polling - switch (event->type) + + switch (event->type) { case RGFW_quit: CORE.Window.shouldClose = true; break; case RGFW_dnd: // Dropped file { - for (u32 i = 0; i < event->droppedFilesCount; i++) + for (int i = 0; i < event->droppedFilesCount; i++) { if (CORE.Window.dropFileCount == 0) { @@ -964,7 +1000,7 @@ void PollInputEvents(void) CORE.Window.dropFilepaths[CORE.Window.dropFileCount] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char)); strcpy(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], event->droppedFiles[i]); - + CORE.Window.dropFileCount++; } else if (CORE.Window.dropFileCount < 1024) @@ -998,7 +1034,6 @@ void PollInputEvents(void) case RGFW_keyPressed: { KeyboardKey key = ConvertScancodeToKey(event->keyCode); - if (key != KEY_NULL) { // If key was up, add it to the key pressed queue @@ -1037,7 +1072,7 @@ void PollInputEvents(void) { if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown)) { - CORE.Input.Mouse.currentWheelMove.y = (float)event->scroll; + CORE.Input.Mouse.currentWheelMove.y = event->scroll; break; } @@ -1053,10 +1088,9 @@ void PollInputEvents(void) } break; case RGFW_mouseButtonReleased: { - if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown)) { - CORE.Input.Mouse.currentWheelMove.y = (float)event->scroll; + CORE.Input.Mouse.currentWheelMove.y = event->scroll; break; } @@ -1087,124 +1121,53 @@ void PollInputEvents(void) CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; touchAction = 2; } break; - case RGFW_jsButtonPressed: + case RGFW_gpButtonPressed: { - int button = -1; - - switch (event->button) - { - case RGFW_JS_Y: button = GAMEPAD_BUTTON_RIGHT_FACE_UP; break; - case RGFW_JS_B: button = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT; break; - case RGFW_JS_A: button = GAMEPAD_BUTTON_RIGHT_FACE_DOWN; break; - case RGFW_JS_X: button = GAMEPAD_BUTTON_RIGHT_FACE_LEFT; break; - - case RGFW_JS_L1: button = GAMEPAD_BUTTON_LEFT_TRIGGER_1; break; - case RGFW_JS_R1: button = GAMEPAD_BUTTON_RIGHT_TRIGGER_1; break; - - case RGFW_JS_L2: button = GAMEPAD_BUTTON_LEFT_TRIGGER_2; break; - case RGFW_JS_R2: button = GAMEPAD_BUTTON_RIGHT_TRIGGER_2; break; - - case RGFW_JS_SELECT: button = GAMEPAD_BUTTON_MIDDLE_LEFT; break; - case RGFW_JS_HOME: button = GAMEPAD_BUTTON_MIDDLE; break; - case RGFW_JS_START: button = GAMEPAD_BUTTON_MIDDLE_RIGHT; break; - - case RGFW_JS_UP: button = GAMEPAD_BUTTON_LEFT_FACE_UP; break; - case RGFW_JS_RIGHT: button = GAMEPAD_BUTTON_LEFT_FACE_RIGHT; break; - case RGFW_JS_DOWN: button = GAMEPAD_BUTTON_LEFT_FACE_DOWN; break; - case RGFW_JS_LEFT: button = GAMEPAD_BUTTON_LEFT_FACE_LEFT; break; - - default: break; - } + int button = RGFW_gpConvTable[event->button]; if (button >= 0) { - CORE.Input.Gamepad.currentButtonState[event->joystick][button] = 1; + CORE.Input.Gamepad.currentButtonState[event->gamepad][button] = 1; CORE.Input.Gamepad.lastButtonPressed = button; } } break; - case RGFW_jsButtonReleased: + case RGFW_gpButtonReleased: { - int button = -1; - switch (event->button) - { - case RGFW_JS_Y: button = GAMEPAD_BUTTON_RIGHT_FACE_UP; break; - case RGFW_JS_B: button = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT; break; - case RGFW_JS_A: button = GAMEPAD_BUTTON_RIGHT_FACE_DOWN; break; - case RGFW_JS_X: button = GAMEPAD_BUTTON_RIGHT_FACE_LEFT; break; + int button = RGFW_gpConvTable[event->button]; - case RGFW_JS_L1: button = GAMEPAD_BUTTON_LEFT_TRIGGER_1; break; - case RGFW_JS_R1: button = GAMEPAD_BUTTON_RIGHT_TRIGGER_1; break; - - case RGFW_JS_L2: button = GAMEPAD_BUTTON_LEFT_TRIGGER_2; break; - case RGFW_JS_R2: button = GAMEPAD_BUTTON_RIGHT_TRIGGER_2; break; - - case RGFW_JS_SELECT: button = GAMEPAD_BUTTON_MIDDLE_LEFT; break; - case RGFW_JS_HOME: button = GAMEPAD_BUTTON_MIDDLE; break; - case RGFW_JS_START: button = GAMEPAD_BUTTON_MIDDLE_RIGHT; break; - - case RGFW_JS_UP: button = GAMEPAD_BUTTON_LEFT_FACE_UP; break; - case RGFW_JS_RIGHT: button = GAMEPAD_BUTTON_LEFT_FACE_RIGHT; break; - case RGFW_JS_DOWN: button = GAMEPAD_BUTTON_LEFT_FACE_DOWN; break; - case RGFW_JS_LEFT: button = GAMEPAD_BUTTON_LEFT_FACE_LEFT; break; - default: break; - } - - if (button >= 0) - { - CORE.Input.Gamepad.currentButtonState[event->joystick][button] = 0; - if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; - } + CORE.Input.Gamepad.currentButtonState[event->gamepad][button] = 0; + if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; } break; - case RGFW_jsAxisMove: + case RGFW_gpAxisMove: { int axis = -1; - for (int i = 0; i < event->axisesCount; i++) + + float value = 0; + switch(event->whichAxis) { - switch(i) - { - case 0: - { - if (abs(event->axis[i].x) > abs(event->axis[i].y)) - { - axis = GAMEPAD_AXIS_LEFT_X; - break; - } - - axis = GAMEPAD_AXIS_LEFT_Y; - } break; - case 1: - { - if (abs(event->axis[i].x) > abs(event->axis[i].y)) - { - axis = GAMEPAD_AXIS_RIGHT_X; - break; - } - - axis = GAMEPAD_AXIS_RIGHT_Y; - } break; - case 2: axis = GAMEPAD_AXIS_LEFT_TRIGGER; break; - case 3: axis = GAMEPAD_AXIS_RIGHT_TRIGGER; break; - default: break; - } - - #ifdef __linux__ - float value = (event->axis[i].x + event->axis[i].y)/(float)32767; - #else - float value = (event->axis[i].x + -event->axis[i].y)/(float)32767; - #endif - CORE.Input.Gamepad.axisState[event->joystick][axis] = value; - - // Register button state for triggers in addition to their axes - if ((axis == GAMEPAD_AXIS_LEFT_TRIGGER) || (axis == GAMEPAD_AXIS_RIGHT_TRIGGER)) - { - int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER)? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2; - int pressed = (value > 0.1f); - CORE.Input.Gamepad.currentButtonState[event->joystick][button] = pressed; - - if (pressed) CORE.Input.Gamepad.lastButtonPressed = button; - else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; - } - } + case 0: + { + CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_LEFT_X] = event->axis[0].x / 100.0f; + CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_LEFT_Y] = event->axis[0].y / 100.0f; + } break; + case 1: + { + CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_RIGHT_X] = event->axis[1].x / 100.0f; + CORE.Input.Gamepad.axisState[event->gamepad][GAMEPAD_AXIS_RIGHT_Y] = event->axis[1].y / 100.0f; + } break; + case 2: axis = GAMEPAD_AXIS_LEFT_TRIGGER; + case 3: + { + if (axis == -1) axis = GAMEPAD_AXIS_RIGHT_TRIGGER; + int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER)? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2; + int pressed = (value > 0.1f); + CORE.Input.Gamepad.currentButtonState[event->gamepad][button] = pressed; + + if (pressed) CORE.Input.Gamepad.lastButtonPressed = button; + else if (CORE.Input.Gamepad.lastButtonPressed == button) CORE.Input.Gamepad.lastButtonPressed = 0; + } + default: break; + } } break; default: break; } @@ -1289,17 +1252,22 @@ int InitPlatform(void) platform.window = RGFW_createWindow(CORE.Window.title, RGFW_RECT(0, 0, CORE.Window.screen.width, CORE.Window.screen.height), flags); + +#ifndef PLATFORM_WEB_RGFW RGFW_area screenSize = RGFW_getScreenSize(); CORE.Window.display.width = screenSize.w; CORE.Window.display.height = screenSize.h; - /* - I think this is needed by Raylib now ? +#else + CORE.Window.display.width = CORE.Window.screen.width; + CORE.Window.display.height = CORE.Window.screen.height; +#endif + /* + I think this is needed by Raylib now ? If so, rcore_destkop_sdl should be updated too */ - SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height); - - if (CORE.Window.flags & FLAG_VSYNC_HINT) RGFW_window_swapInterval(platform.window, 1); - + //SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height); + + if (CORE.Window.flags & FLAG_VSYNC_HINT) RGFW_window_swapInterval(platform.window, 1); RGFW_window_makeCurrent(platform.window); // Check surface and context activation @@ -1311,12 +1279,6 @@ int InitPlatform(void) CORE.Window.render.height = CORE.Window.screen.height; CORE.Window.currentFbo.width = CORE.Window.render.width; CORE.Window.currentFbo.height = CORE.Window.render.height; - - TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully"); - TRACELOG(LOG_INFO, " > Display size: %i x %i", CORE.Window.display.width, CORE.Window.display.height); - TRACELOG(LOG_INFO, " > Screen size: %i x %i", CORE.Window.screen.width, CORE.Window.screen.height); - TRACELOG(LOG_INFO, " > Render size: %i x %i", CORE.Window.render.width, CORE.Window.render.height); - TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y); } else { @@ -1366,12 +1328,11 @@ int InitPlatform(void) #ifdef RGFW_X11 for (int i = 0; (i < 4) && (i < MAX_GAMEPADS); i++) { - RGFW_registerJoystick(platform.window, i); + RGFW_registergamepad(platform.window, i); } #endif TRACELOG(LOG_INFO, "PLATFORM: CUSTOM: Initialized successfully"); - return 0; } @@ -1385,6 +1346,6 @@ void ClosePlatform(void) static KeyboardKey ConvertScancodeToKey(u32 keycode) { if (keycode > sizeof(keyMappingRGFW)/sizeof(unsigned short)) return 0; - - return keyMappingRGFW[keycode]; + + return keyMappingRGFW[keycode]; } diff --git a/src/rcore.c b/src/rcore.c index 571abf97c..40167718c 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -12,6 +12,13 @@ * - Windows (Win32, Win64) * - Linux (X11/Wayland desktop mode) * - Others (not tested) +* > PLATFORM_DESKTOP_RGFW (RGFW backend): +* - Windows (Win32, Win64) +* - Linux (X11/Wayland desktop mode) +* - macOS/OSX (x64, arm64) +* - Others (not tested) +* > PLATFORM_WEB_RGFW: +* - HTML5 (WebAssembly) * > PLATFORM_WEB: * - HTML5 (WebAssembly) * > PLATFORM_DRM: @@ -85,12 +92,12 @@ //---------------------------------------------------------------------------------- // Feature Test Macros required for this module //---------------------------------------------------------------------------------- -#if (defined(__linux__) || defined(PLATFORM_WEB)) && (_XOPEN_SOURCE < 500) +#if (defined(__linux__) || defined(PLATFORM_WEB) || defined(PLATFORM_WEB_RGFW)) && (_XOPEN_SOURCE < 500) #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 500 // Required for: readlink if compiled with c99 without gnu ext. #endif -#if (defined(__linux__) || defined(PLATFORM_WEB)) && (_POSIX_C_SOURCE < 199309L) +#if (defined(__linux__) || defined(PLATFORM_WEB) || defined(PLATFORM_WEB_RGFW)) && (_POSIX_C_SOURCE < 199309L) #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 199309L // Required for: CLOCK_MONOTONIC if compiled with c99 without gnu ext. #endif @@ -540,7 +547,7 @@ const char *TextFormat(const char *text, ...); // Formatting of tex #include "platforms/rcore_desktop_glfw.c" #elif defined(PLATFORM_DESKTOP_SDL) #include "platforms/rcore_desktop_sdl.c" -#elif defined(PLATFORM_DESKTOP_RGFW) +#elif (defined(PLATFORM_DESKTOP_RGFW) || defined(PLATFORM_WEB_RGFW)) #include "platforms/rcore_desktop_rgfw.c" #elif defined(PLATFORM_WEB) #include "platforms/rcore_web.c" @@ -611,6 +618,8 @@ void InitWindow(int width, int height, const char *title) TRACELOG(LOG_INFO, "Platform backend: DESKTOP (SDL)"); #elif defined(PLATFORM_DESKTOP_RGFW) TRACELOG(LOG_INFO, "Platform backend: DESKTOP (RGFW)"); +#elif defined(PLATFORM_WEB_RGFW) + TRACELOG(LOG_INFO, "Platform backend: WEB (RGFW) (HTML5)"); #elif defined(PLATFORM_WEB) TRACELOG(LOG_INFO, "Platform backend: WEB (HTML5)"); #elif defined(PLATFORM_DRM) @@ -3573,7 +3582,7 @@ void SetupViewport(int width, int height) // NOTE: Global variables CORE.Window.render.width/CORE.Window.render.height and CORE.Window.renderOffset.x/CORE.Window.renderOffset.y can be modified void SetupFramebuffer(int width, int height) { - // Calculate CORE.Window.render.width and CORE.Window.render.height, we have the display size (input params) and the desired screen size (global var) + // Calculate CORE.Window.render.width and CORE.Window.render.height, we have the display size (input params) and the desired screen size (global var) if ((CORE.Window.screen.width > CORE.Window.display.width) || (CORE.Window.screen.height > CORE.Window.display.height)) { TRACELOG(LOG_WARNING, "DISPLAY: Downscaling required: Screen size (%ix%i) is bigger than display size (%ix%i)", CORE.Window.screen.width, CORE.Window.screen.height, CORE.Window.display.width, CORE.Window.display.height); From 783ca612ccfe6f291998bbbe50480c0531659b7f Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 18 Dec 2024 12:51:00 +0100 Subject: [PATCH 130/194] Update Makefile --- src/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 4797b587f..b5fa2ecff 100644 --- a/src/Makefile +++ b/src/Makefile @@ -61,11 +61,10 @@ #------------------------------------------------------------------------------------------------ # Define target platform PLATFORM ?= PLATFORM_DESKTOP - ifeq ($(PLATFORM), PLATFORM_DESKTOP) - TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW + TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW else - TARGET_PLATFORM = $(PLATFORM) + TARGET_PLATFORM = $(PLATFORM) endif # Define required raylib variables @@ -122,7 +121,6 @@ SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib SDL_LIBRARIES ?= -lSDL2 -lSDL2main - # Determine if the file has root access (only required to install raylib) # "whoami" prints the name of the user that calls him (so, if it is the root user, "whoami" prints "root") ROOT = $(shell whoami) From 99cb4cbc360181131f632ec63854d8b411a297d8 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Wed, 18 Dec 2024 10:53:50 -0300 Subject: [PATCH 131/194] Fix SetGamepadVibration() TRACELOG message (#4615) --- src/platforms/rcore_android.c | 2 +- src/platforms/rcore_desktop_glfw.c | 2 +- src/platforms/rcore_desktop_rgfw.c | 2 +- src/platforms/rcore_drm.c | 2 +- src/platforms/rcore_template.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 4528c810d..faa00c98b 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -627,7 +627,7 @@ int SetGamepadMappings(const char *mappings) // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { - TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform"); + TRACELOG(LOG_WARNING, "SetGamepadVibration() not implemented on target platform"); } // Set mouse position XY diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 5caf17ead..0d95cdd75 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1088,7 +1088,7 @@ int SetGamepadMappings(const char *mappings) // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { - TRACELOG(LOG_WARNING, "GamepadSetVibration() not available on target platform"); + TRACELOG(LOG_WARNING, "SetGamepadVibration() not available on target platform"); } // Set mouse position XY diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index d9ba8185c..9aea44971 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -797,7 +797,7 @@ int SetGamepadMappings(const char *mappings) // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { - TRACELOG(LOG_WARNING, "GamepadSetVibration() not available on target platform"); + TRACELOG(LOG_WARNING, "SetGamepadVibration() not available on target platform"); } // Set mouse position XY diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index 425b1d4a6..09cb80556 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -622,7 +622,7 @@ int SetGamepadMappings(const char *mappings) // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { - TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform"); + TRACELOG(LOG_WARNING, "SetGamepadVibration() not implemented on target platform"); } // Set mouse position XY diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index 9eca9726a..d7605950e 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -384,7 +384,7 @@ int SetGamepadMappings(const char *mappings) // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { - TRACELOG(LOG_WARNING, "GamepadSetVibration() not implemented on target platform"); + TRACELOG(LOG_WARNING, "SetGamepadVibration() not implemented on target platform"); } // Set mouse position XY From 6eb1206660730e3beb117b9336004356e59ed92f Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:07:48 +0100 Subject: [PATCH 132/194] fix `shaders_deffered_render.c` for OpenGL ES 3 (#4617) This fixes an incomplete framebuffer issue due to the use of a texture format not supported in ES 3. This commit also adds more information on how to manage deferred rendering. --- examples/shaders/shaders_deferred_render.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/shaders/shaders_deferred_render.c b/examples/shaders/shaders_deferred_render.c index 4f652fe33..52c713aa7 100644 --- a/examples/shaders/shaders_deferred_render.c +++ b/examples/shaders/shaders_deferred_render.c @@ -95,11 +95,19 @@ int main(void) rlEnableFramebuffer(gBuffer.framebuffer); - // Since we are storing position and normal data in these textures, - // we need to use a floating point format. - gBuffer.positionTexture = rlLoadTexture(NULL, screenWidth, screenHeight, RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32, 1); + // NOTE: Vertex positions are stored in a texture for simplicity. A better approach would use a depth texture + // (instead of a detph renderbuffer) to reconstruct world positions in the final render shader via clip-space position, + // depth, and the inverse view/projection matrices. + + // 16-bit precision ensures OpenGL ES 3 compatibility, though it may lack precision for real scenarios. + // But as mentioned above, the positions could be reconstructed instead of stored. If not targeting OpenGL ES + // and you wish to maintain this approach, consider using `RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32`. + gBuffer.positionTexture = rlLoadTexture(NULL, screenWidth, screenHeight, RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16, 1); + + // Similarly, 16-bit precision is used for normals ensures OpenGL ES 3 compatibility. + // This is generally sufficient, but a 16-bit fixed-point format offer a better uniform precision in all orientations. + gBuffer.normalTexture = rlLoadTexture(NULL, screenWidth, screenHeight, RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16, 1); - gBuffer.normalTexture = rlLoadTexture(NULL, screenWidth, screenHeight, RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32, 1); // Albedo (diffuse color) and specular strength can be combined into one texture. // The color in RGB, and the specular strength in the alpha channel. gBuffer.albedoSpecTexture = rlLoadTexture(NULL, screenWidth, screenHeight, RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, 1); From 03ff864087a3ca46a60cd64ef709650cd8d824f5 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 18 Dec 2024 18:44:23 +0100 Subject: [PATCH 133/194] Formating tweaks --- src/platforms/rcore_desktop_rgfw.c | 77 ++++++++++-------------------- 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 9aea44971..a74af2074 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -168,7 +168,6 @@ static const unsigned short keyMappingRGFW[] = { [RGFW_SuperL] = KEY_LEFT_SUPER, #ifndef RGFW_MACOS [RGFW_ShiftR] = KEY_RIGHT_SHIFT, - [RGFW_AltR] = KEY_RIGHT_ALT, #endif [RGFW_Space] = KEY_SPACE, @@ -677,40 +676,37 @@ const char *GetClipboardText(void) #if defined(SUPPORT_CLIPBOARD_IMAGE) - -#ifdef _WIN32 -# define WIN32_CLIPBOARD_IMPLEMENTATION -# define WINUSER_ALREADY_INCLUDED -# define WINBASE_ALREADY_INCLUDED -# define WINGDI_ALREADY_INCLUDED -# include "../external/win32_clipboard.h" +#if defined(_WIN32) + #define WIN32_CLIPBOARD_IMPLEMENTATION + #define WINUSER_ALREADY_INCLUDED + #define WINBASE_ALREADY_INCLUDED + #define WINGDI_ALREADY_INCLUDED + #include "../external/win32_clipboard.h" +#endif #endif // Get clipboard image Image GetClipboardImage(void) { - Image image = {0}; + Image image = { 0 }; unsigned long long int dataSize = 0; - void* fileData = NULL; + void *fileData = NULL; -#ifdef _WIN32 - int width, height; - fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); +#if defined(SUPPORT_CLIPBOARD_IMAGE) +#if defined(_WIN32) + int width = 0; + int height = 0; + fileData = (void *)Win32GetClipboardImageData(&width, &height, &dataSize); + + if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data"); + else image = LoadImageFromMemory(".bmp", fileData, dataSize); #else - TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement `GetClipboardImage` for this OS"); + TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement GetClipboardImage() for this OS"); #endif +#endif // SUPPORT_CLIPBOARD_IMAGE - if (fileData == NULL) - { - TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); - } - else - { - image = LoadImageFromMemory(".bmp", fileData, dataSize); - } return image; } -#endif // SUPPORT_CLIPBOARD_IMAGE // Show mouse cursor void ShowCursor(void) @@ -742,9 +738,7 @@ void EnableCursor(void) void DisableCursor(void) { RGFW_disableCursor = true; - RGFW_window_mouseHold(platform.window, RGFW_AREA(0, 0)); - HideCursor(); } @@ -875,6 +869,7 @@ char RSGL_keystrToChar(const char *str) return '\0'; } +// Gamepad buttons conversion table int RGFW_gpConvTable[18] = { [RGFW_GP_Y] = GAMEPAD_BUTTON_RIGHT_FACE_UP, [RGFW_GP_B] = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, @@ -895,8 +890,6 @@ int RGFW_gpConvTable[18] = { [RGFW_GP_R3] = GAMEPAD_BUTTON_RIGHT_THUMB, }; - - // Register all input events void PollInputEvents(void) { @@ -917,7 +910,6 @@ void PollInputEvents(void) // Register previous mouse position // Reset last gamepad button/axis registered state - for (int i = 0; (i < 4) && (i < MAX_GAMEPADS); i++) { // Check if gamepad is available @@ -1224,35 +1216,20 @@ int InitPlatform(void) if ((CORE.Window.flags & FLAG_WINDOW_UNDECORATED) > 0) flags |= RGFW_NO_BORDER; if ((CORE.Window.flags & FLAG_WINDOW_RESIZABLE) == 0) flags |= RGFW_NO_RESIZE; - if ((CORE.Window.flags & FLAG_WINDOW_TRANSPARENT) > 0) flags |= RGFW_TRANSPARENT_WINDOW; - if ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) > 0) flags |= RGFW_FULLSCREEN; // NOTE: Some OpenGL context attributes must be set before window creation // Check selection OpenGL version - if (rlGetVersion() == RL_OPENGL_21) - { - RGFW_setGLVersion(RGFW_GL_CORE, 2, 1); - } - else if (rlGetVersion() == RL_OPENGL_33) - { - RGFW_setGLVersion(RGFW_GL_CORE, 3, 3); - } - else if (rlGetVersion() == RL_OPENGL_43) - { - RGFW_setGLVersion(RGFW_GL_CORE, 4, 1); - } + if (rlGetVersion() == RL_OPENGL_21) RGFW_setGLVersion(RGFW_GL_CORE, 2, 1); + else if (rlGetVersion() == RL_OPENGL_33) RGFW_setGLVersion(RGFW_GL_CORE, 3, 3); + else if (rlGetVersion() == RL_OPENGL_43) RGFW_setGLVersion(RGFW_GL_CORE, 4, 1); - if (CORE.Window.flags & FLAG_MSAA_4X_HINT) - { - RGFW_setGLSamples(4); - } + if (CORE.Window.flags & FLAG_MSAA_4X_HINT) RGFW_setGLSamples(4); platform.window = RGFW_createWindow(CORE.Window.title, RGFW_RECT(0, 0, CORE.Window.screen.width, CORE.Window.screen.height), flags); - #ifndef PLATFORM_WEB_RGFW RGFW_area screenSize = RGFW_getScreenSize(); CORE.Window.display.width = screenSize.w; @@ -1261,10 +1238,8 @@ int InitPlatform(void) CORE.Window.display.width = CORE.Window.screen.width; CORE.Window.display.height = CORE.Window.screen.height; #endif - /* - I think this is needed by Raylib now ? - If so, rcore_destkop_sdl should be updated too - */ + // TODO: Is this needed by raylib now? + // If so, rcore_desktop_sdl should be updated too //SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height); if (CORE.Window.flags & FLAG_VSYNC_HINT) RGFW_window_swapInterval(platform.window, 1); From ab83e6dd41f7d0cb85cd7dc37555bbd384650109 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 19 Dec 2024 13:24:30 +0100 Subject: [PATCH 134/194] Image manipulation functions depend on a flag --- src/rtextures.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rtextures.c b/src/rtextures.c index 06f81e577..e0ae5f4af 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4204,8 +4204,10 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) ImageFormat(&faces, image.format); Image mipmapped = ImageCopy(image); + #if defined(SUPPORT_IMAGE_MANIPULATION) ImageMipmaps(&mipmapped); ImageMipmaps(&faces); + #endif // NOTE: Image formatting does not work with compressed textures From 26e12d6b352406a3cda8839beaeb6b704847ee69 Mon Sep 17 00:00:00 2001 From: Fancy2209 <64917206+Fancy2209@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:53:51 -0100 Subject: [PATCH 135/194] Fix Typo in rcore_desktop_sdl.c (#4621) --- src/platforms/rcore_desktop_sdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index b7f00bc76..3d1ac0bf3 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -23,7 +23,7 @@ * Custom flag for rcore on target platform -not used- * * DEPENDENCIES: -* - SDL 2 or SLD 3 (main library): Windowing and inputs management +* - SDL 2 or SDL 3 (main library): Windowing and inputs management * - gestures: Gestures system for touch-ready devices (or simulated from mouse inputs) * * From 0212ed0a4b8466477af479018f3d601f5cb9521d Mon Sep 17 00:00:00 2001 From: Jett <30197659+JettMonstersGoBoom@users.noreply.github.com> Date: Fri, 20 Dec 2024 08:14:13 -0500 Subject: [PATCH 136/194] setting MAX_LEVEL based on actual mipcount input (#4622) --- src/rlgl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rlgl.h b/src/rlgl.h index 857e97511..5fd523b3c 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3301,6 +3301,7 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format, // Activate Trilinear filtering if mipmaps are available glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, mipmapCount); // user defined mip count would break without this. } #endif From 6f0d8611feb46f76b106a2e26c7a29844f2d85cd Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 23 Dec 2024 19:24:07 +0100 Subject: [PATCH 137/194] Formating tweaks --- src/rcore.c | 2 +- src/rmodels.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 40167718c..5ba24a5b8 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -3582,7 +3582,7 @@ void SetupViewport(int width, int height) // NOTE: Global variables CORE.Window.render.width/CORE.Window.render.height and CORE.Window.renderOffset.x/CORE.Window.renderOffset.y can be modified void SetupFramebuffer(int width, int height) { - // Calculate CORE.Window.render.width and CORE.Window.render.height, we have the display size (input params) and the desired screen size (global var) + // Calculate CORE.Window.render.width and CORE.Window.render.height, we have the display size (input params) and the desired screen size (global var) if ((CORE.Window.screen.width > CORE.Window.display.width) || (CORE.Window.screen.height > CORE.Window.display.height)) { TRACELOG(LOG_WARNING, "DISPLAY: Downscaling required: Screen size (%ix%i) is bigger than display size (%ix%i)", CORE.Window.screen.width, CORE.Window.screen.height, CORE.Window.display.width, CORE.Window.display.height); diff --git a/src/rmodels.c b/src/rmodels.c index 43997c318..44988133f 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2325,7 +2325,7 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) { memcpy(model.meshes[i].boneMatrices, model.meshes[firstMeshWithBones].boneMatrices, - model.meshes[i].boneCount * sizeof(model.meshes[i].boneMatrices[0])); + model.meshes[i].boneCount*sizeof(model.meshes[i].boneMatrices[0])); } } } @@ -2338,7 +2338,7 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) { UpdateModelAnimationBones(model,anim,frame); - + for (int m = 0; m < model.meshCount; m++) { Mesh mesh = model.meshes[m]; @@ -2349,7 +2349,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) float boneWeight = 0.0; bool updated = false; // Flag to check when anim vertex information is updated const int vValues = mesh.vertexCount*3; - + for (int vCounter = 0; vCounter < vValues; vCounter += 3) { mesh.animVertices[vCounter] = 0; From a3a25da59426ddcefc0c01675ba3c9bdaa0ccce8 Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:25:41 +0100 Subject: [PATCH 138/194] Update BINDINGS.md (#4628) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 56c7e79c1..1faf6ba3d 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -10,7 +10,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT | | [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT | | [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib55.c3l) | **5.5** | [C3](https://c3-lang.org) | MIT | -| [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | +| [Raylib-cs](https://github.com/ChrisDill/Raylib-cs) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | | [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | | [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.1-dev** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT | From e5d8de7c6396783cf28bef77e1d4920af57a133d Mon Sep 17 00:00:00 2001 From: veins1 <19636663+veins1@users.noreply.github.com> Date: Mon, 23 Dec 2024 23:26:50 +0500 Subject: [PATCH 139/194] Fix: Setting flags disables fullscreen #4618 (#4619) --- src/platforms/rcore_desktop_glfw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 0d95cdd75..cb61f7d81 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -322,7 +322,7 @@ void SetWindowState(unsigned int flags) } // State change: FLAG_FULLSCREEN_MODE - if ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) != (flags & FLAG_FULLSCREEN_MODE)) + if ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) != (flags & FLAG_FULLSCREEN_MODE) && ((flags & FLAG_FULLSCREEN_MODE) > 0)) { ToggleFullscreen(); // NOTE: Window state flag updated inside function } From 4fc908b38f0379a7c2aad2797b7e5e67a127c6dc Mon Sep 17 00:00:00 2001 From: James Doyle Date: Mon, 23 Dec 2024 11:51:11 -0800 Subject: [PATCH 140/194] Update BINDINGS.md (#4633) Add some missing bindings for 5.5 --- BINDINGS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BINDINGS.md b/BINDINGS.md index 1faf6ba3d..5e93a076a 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -44,6 +44,9 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC | | [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC | | [ReiLua](https://github.com/nullstare/ReiLua) | 5.5 | [Lua](http://www.lua.org) | MIT | +| [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib | +| [raylib-luajit](https://github.com/homma/raylib-luajit) | 5.5 | [Lua](http://www.lua.org) | MIT | +| [raylib-luajit-generated](https://github.com/james2doyle/raylib-luajit-generated) | 5.5 | [Lua](http://www.lua.org) | MIT | | [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | **???** | | [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib | | [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 5.6-dev | [Ruby](https://www.ruby-lang.org/en) | Zlib | @@ -72,6 +75,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-scopes](https://github.com/salotz/raylib-scopes) | auto | [Scopes](http://scopes.rocks) | MIT | | [raylib-SmallBASIC](https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib) | **5.5** | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | | [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib | +| [raylib-for-v](https://github.com/EmmaTheMartian/raylib-for-v) | 5.5 | [V](https://vlang.io) | MIT/Unlicense | | [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib | | [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib | | [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC | From 7868d600f40b80177add61e9b865f66405fd77f3 Mon Sep 17 00:00:00 2001 From: Fancy2209 <64917206+Fancy2209@users.noreply.github.com> Date: Mon, 23 Dec 2024 20:25:22 -0100 Subject: [PATCH 141/194] [rtext] Fix default font alpha on Big Endian systems (#4624) * Fix rtext default font alpha on Big Endian * Endian Indepence --- src/rtext.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 005568dbf..b60c8cb1d 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -247,7 +247,11 @@ extern void LoadFontDefault(void) // we must consider data as little-endian order (alpha + gray) ((unsigned short *)imFont.data)[i + j] = 0xffff; } - else ((unsigned short *)imFont.data)[i + j] = 0x00ff; + else + { + ((unsigned char *)imFont.data)[(i + j)*sizeof(short)] = 0xFF; + ((unsigned char *)imFont.data)[(i + j)*sizeof(short) + 1] = 0x00; + } } counter++; From a7686c47b35fb62e8c9041240060622e5b89b9f6 Mon Sep 17 00:00:00 2001 From: Jett <30197659+JettMonstersGoBoom@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:11:17 -0500 Subject: [PATCH 142/194] resolved a few segfaults with animation system (#4635) * Update rmodels.c resolves segfault with missing bone weights or bone IDs * Update rmodels.c segfault with animation and missing normals/animnormals * correct place. --- src/rmodels.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 44988133f..3fcd5cea7 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2286,6 +2286,7 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) } } + // Update all bones and boneMatrices of first mesh with bones. for (int boneId = 0; boneId < anim.boneCount; boneId++) { @@ -2350,6 +2351,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) bool updated = false; // Flag to check when anim vertex information is updated const int vValues = mesh.vertexCount*3; + if ((mesh.boneWeights==NULL) || (mesh.boneIds==NULL)) continue; // skip if missing bone data, causes segfault without on some models + for (int vCounter = 0; vCounter < vValues; vCounter += 3) { mesh.animVertices[vCounter] = 0; @@ -2378,7 +2381,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) // Normals processing // NOTE: We use meshes.baseNormals (default normal) to calculate meshes.normals (animated normals) - if (mesh.normals != NULL) + if ((mesh.normals != NULL) && (mesh.animNormals != NULL )) { animNormal = (Vector3){ mesh.normals[vCounter], mesh.normals[vCounter + 1], mesh.normals[vCounter + 2] }; animNormal = Vector3Transform(animNormal,model.meshes[m].boneMatrices[boneId]); @@ -2392,7 +2395,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) if (updated) { rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position - rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals + if (mesh.normals != NULL) + rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals } } } From ae3c0df2060ac0df13e4e95ece5b3fc9be464d6f Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 24 Dec 2024 20:14:54 +0100 Subject: [PATCH 143/194] Reviewed formating, removed assert() #4635 --- src/rmodels.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 3fcd5cea7..0455ced27 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2277,7 +2277,6 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) { if (model.meshes[i].boneMatrices) { - assert(model.meshes[i].boneCount == anim.boneCount); if (firstMeshWithBones == -1) { firstMeshWithBones = i; @@ -2286,7 +2285,6 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) } } - // Update all bones and boneMatrices of first mesh with bones. for (int boneId = 0; boneId < anim.boneCount; boneId++) { @@ -2351,7 +2349,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) bool updated = false; // Flag to check when anim vertex information is updated const int vValues = mesh.vertexCount*3; - if ((mesh.boneWeights==NULL) || (mesh.boneIds==NULL)) continue; // skip if missing bone data, causes segfault without on some models + // Skip if missing bone data, causes segfault without on some models + if ((mesh.boneWeights == NULL) || (mesh.boneIds == NULL)) continue; for (int vCounter = 0; vCounter < vValues; vCounter += 3) { @@ -2364,7 +2363,8 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) mesh.animNormals[vCounter + 1] = 0; mesh.animNormals[vCounter + 2] = 0; } - // Iterates over 4 bones per vertex + + // Iterates over 4 bones per vertex for (int j = 0; j < 4; j++, boneCounter++) { boneWeight = mesh.boneWeights[boneCounter]; @@ -2395,8 +2395,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) if (updated) { rlUpdateVertexBuffer(mesh.vboId[0], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0); // Update vertex position - if (mesh.normals != NULL) - rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals + if (mesh.normals != NULL) rlUpdateVertexBuffer(mesh.vboId[2], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0); // Update vertex normals } } } From 873bf31be3145d5695f9f13b7cb3eb688b6256e4 Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Tue, 24 Dec 2024 20:17:37 +0100 Subject: [PATCH 144/194] [rmodels] Fix normal transform in `UpdateModelAnimationBones` (#4634) * remove duplicate calculation of `invRotation` in `UpdateModelAnimationBones` * fix normal transform in `UpdateModelAnimation` --- src/rmodels.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 0455ced27..c62267de4 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2296,13 +2296,12 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) Quaternion outRotation = anim.framePoses[frame][boneId].rotation; Vector3 outScale = anim.framePoses[frame][boneId].scale; - Vector3 invTranslation = Vector3RotateByQuaternion(Vector3Negate(inTranslation), QuaternionInvert(inRotation)); Quaternion invRotation = QuaternionInvert(inRotation); + Vector3 invTranslation = Vector3RotateByQuaternion(Vector3Negate(inTranslation), invRotation); Vector3 invScale = Vector3Divide((Vector3){ 1.0f, 1.0f, 1.0f }, inScale); - Vector3 boneTranslation = Vector3Add( - Vector3RotateByQuaternion(Vector3Multiply(outScale, invTranslation), - outRotation), outTranslation); + Vector3 boneTranslation = Vector3Add(Vector3RotateByQuaternion( + Vector3Multiply(outScale, invTranslation), outRotation), outTranslation); Quaternion boneRotation = QuaternionMultiply(outRotation, invRotation); Vector3 boneScale = Vector3Multiply(outScale, invScale); @@ -2384,7 +2383,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) if ((mesh.normals != NULL) && (mesh.animNormals != NULL )) { animNormal = (Vector3){ mesh.normals[vCounter], mesh.normals[vCounter + 1], mesh.normals[vCounter + 2] }; - animNormal = Vector3Transform(animNormal,model.meshes[m].boneMatrices[boneId]); + animNormal = Vector3Transform(animNormal, MatrixTranspose(MatrixInvert(model.meshes[m].boneMatrices[boneId]))); mesh.animNormals[vCounter] += animNormal.x*boneWeight; mesh.animNormals[vCounter + 1] += animNormal.y*boneWeight; mesh.animNormals[vCounter + 2] += animNormal.z*boneWeight; From c333e8049778de79c6f4e0c2698b49c16af19577 Mon Sep 17 00:00:00 2001 From: Colleague Riley Date: Wed, 25 Dec 2024 12:19:51 -0800 Subject: [PATCH 145/194] Update RGFW (#4637) * add PLATFORM_WEB_RGFW * fix some bugs * fix web_rgfw gamepad * send fake screensize * fix gamepad bugs (linux) | add L3 + R3 (gamepad) * fix? * update RGFW (again) * update raylib (merge) * fix xinput stuff * delete makefile added by mistake * update RGFW * update RGFW (rename joystick to gamepad to avoid misunderstandings * update RGFW (fix X11 bug) * update RGFW * use RL_MALLOC for RGFW * update RGFW (fixes xdnd bug) * fix some formating * Update RGFW * update RGFW * undo change * undo change * undo change * undo change * have .scroll be 0 by default --- src/external/RGFW.h | 922 ++++++++++++++++++----------- src/platforms/rcore_desktop_rgfw.c | 68 +-- 2 files changed, 585 insertions(+), 405 deletions(-) diff --git a/src/external/RGFW.h b/src/external/RGFW.h index 2a10eda2c..317d00c7a 100644 --- a/src/external/RGFW.h +++ b/src/external/RGFW.h @@ -30,6 +30,7 @@ /* #define RGFW_IMPLEMENTATION - (required) makes it so the source code is included #define RGFW_PRINT_ERRORS - (optional) makes it so RGFW prints errors when they're found + #define RGFW_DEBUG - (optional) makes it so RGFW prints debug messages #define RGFW_OSMESA - (optional) use OSmesa as backend (instead of system's opengl api + regular opengl) #define RGFW_BUFFER - (optional) just draw directly to (RGFW) window pixel buffer that is drawn to screen (the buffer is in the RGBA format) #define RGFW_EGL - (optional) use EGL for loading an OpenGL context (instead of the system's opengl api) @@ -65,7 +66,7 @@ /* Example to get you started : -linux : gcc main.c -lX11 -lXrandr -lGL +linux : gcc main.c -lX11 -lXrandr -lGL -lm windows : gcc main.c -lopengl32 -lwinmm -lshell32 -lgdi32 macos : gcc main.c -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo @@ -207,11 +208,7 @@ int main() { #endif #ifndef RGFWDEF - #ifdef __clang__ - #define RGFWDEF static inline - #else - #define RGFWDEF inline - #endif + #define RGFWDEF inline #endif #ifndef RGFW_ENUM @@ -391,7 +388,7 @@ typedef RGFW_ENUM(u8, RGFW_event_types) { RGFW_keyReleased, /*!< a key has been released*/ /*! key event note the code of the key pressed is stored in - RGFW_Event.keyCode + RGFW_Event.key !!Keycodes defined at the bottom of the RGFW_HEADER part of this file!! while a string version is stored in @@ -546,8 +543,9 @@ typedef struct RGFW_Event { u32 type; /*!< which event has been sent?*/ RGFW_point point; /*!< mouse x, y of event (or drop point) */ - u8 keyCode; /*!< keycode of event !!Keycodes defined at the bottom of the RGFW_HEADER part of this file!! */ - + u8 key; /*!< the physical key of the event, refers to where key is physically !!Keycodes defined at the bottom of the RGFW_HEADER part of this file!! */ + u8 keyChar; /*!< mapped key char of the event*/ + b8 repeat; /*!< key press event repeated (the key is being held) */ b8 inFocus; /*!< if the window is in focus or not (this is always true for MacOS windows due to the api being weird) */ @@ -871,14 +869,6 @@ RGFWDEF RGFW_monitor RGFW_window_getMonitor(RGFW_window* win); /*error handling*/ RGFWDEF b8 RGFW_Error(void); /*!< returns true if an error has occurred (doesn't print errors itself) */ -/*! returns true if the key should be shifted */ -RGFWDEF b8 RGFW_shouldShift(u32 keycode, u8 lockState); - -/*! get char from RGFW keycode (using a LUT), uses shift'd version if shift = true */ -RGFWDEF char RGFW_keyCodeToChar(u32 keycode, b8 shift); -/*! get char from RGFW keycode (using a LUT), uses lockState for shouldShift) */ -RGFWDEF char RGFW_keyCodeToCharAuto(u32 keycode, u8 lockState); - /*! if window == NULL, it checks if the key is pressed globally. Otherwise, it checks only if the key is pressed while the window in focus.*/ RGFWDEF b8 RGFW_isPressed(RGFW_window* win, u8 key); /*!< if key is pressed (key code)*/ @@ -935,8 +925,8 @@ typedef void (* RGFW_mouseposfunc)(RGFW_window* win, RGFW_point point); typedef void (* RGFW_dndInitfunc)(RGFW_window* win, RGFW_point point); /*! RGFW_windowRefresh, the window that needs to be refreshed */ typedef void (* RGFW_windowrefreshfunc)(RGFW_window* win); -/*! RGFW_keyPressed / RGFW_keyReleased, the window that got the event, the keycode, the string version, the state of mod keys, if it was a press (else it's a release) */ -typedef void (* RGFW_keyfunc)(RGFW_window* win, u32 keycode, char keyName[16], u8 lockState, b8 pressed); +/*! RGFW_keyPressed / RGFW_keyReleased, the window that got the event, the mapped key, the physical key, the string version, the state of mod keys, if it was a press (else it's a release) */ +typedef void (* RGFW_keyfunc)(RGFW_window* win, u32 key, u32 mappedKey, char keyName[16], u8 lockState, b8 pressed); /*! RGFW_mouseButtonPressed / RGFW_mouseButtonReleased, the window that got the event, the button that was pressed, the scroll value, if it was a press (else it's a release) */ typedef void (* RGFW_mousebuttonfunc)(RGFW_window* win, u8 button, double scroll, b8 pressed); /*!gp /gp, the window that got the event, the button that was pressed, the scroll value, if it was a press (else it's a release) */ @@ -1085,7 +1075,64 @@ RGFWDEF void RGFW_sleep(u64 milisecond); /*!< sleep for a set time */ typedef RGFW_ENUM(u8, RGFW_Key) { RGFW_KEY_NULL = 0, - RGFW_Escape, + RGFW_Escape = '\033', + RGFW_Backtick = '`', + RGFW_0 = '0', + RGFW_1 = '1', + RGFW_2 = '2', + RGFW_3 = '3', + RGFW_4 = '4', + RGFW_5 = '5', + RGFW_6 = '6', + RGFW_7 = '7', + RGFW_8 = '8', + RGFW_9 = '9', + + RGFW_Minus = '-', + RGFW_Equals = '=', + RGFW_BackSpace = '\b', + RGFW_Tab = '\t', + RGFW_Space = ' ', + + RGFW_a = 'a', + RGFW_b = 'b', + RGFW_c = 'c', + RGFW_d = 'd', + RGFW_e = 'e', + RGFW_f = 'f', + RGFW_g = 'g', + RGFW_h = 'h', + RGFW_i = 'i', + RGFW_j = 'j', + RGFW_k = 'k', + RGFW_l = 'l', + RGFW_m = 'm', + RGFW_n = 'n', + RGFW_o = 'o', + RGFW_p = 'p', + RGFW_q = 'q', + RGFW_r = 'r', + RGFW_s = 's', + RGFW_t = 't', + RGFW_u = 'u', + RGFW_v = 'v', + RGFW_w = 'w', + RGFW_x = 'x', + RGFW_y = 'y', + RGFW_z = 'z', + + RGFW_Period = '.', + RGFW_Comma = ',', + RGFW_Slash = '/', + RGFW_Bracket = '{', + RGFW_CloseBracket = '}', + RGFW_Semicolon = ';', + RGFW_Apostrophe = '\'', + RGFW_BackSlash = '\\', + RGFW_Return = '\n', + + RGFW_Delete = '\177', /* 127 */ + RGFW_F1, RGFW_F2, RGFW_F3, @@ -1099,23 +1146,6 @@ typedef RGFW_ENUM(u8, RGFW_Key) { RGFW_F11, RGFW_F12, - RGFW_Backtick, - - RGFW_0, - RGFW_1, - RGFW_2, - RGFW_3, - RGFW_4, - RGFW_5, - RGFW_6, - RGFW_7, - RGFW_8, - RGFW_9, - - RGFW_Minus, - RGFW_Equals, - RGFW_BackSpace, - RGFW_Tab, RGFW_CapsLock, RGFW_ShiftL, RGFW_ControlL, @@ -1125,51 +1155,11 @@ typedef RGFW_ENUM(u8, RGFW_Key) { RGFW_ControlR, RGFW_AltR, RGFW_SuperR, - RGFW_Space, - - RGFW_a, - RGFW_b, - RGFW_c, - RGFW_d, - RGFW_e, - RGFW_f, - RGFW_g, - RGFW_h, - RGFW_i, - RGFW_j, - RGFW_k, - RGFW_l, - RGFW_m, - RGFW_n, - RGFW_o, - RGFW_p, - RGFW_q, - RGFW_r, - RGFW_s, - RGFW_t, - RGFW_u, - RGFW_v, - RGFW_w, - RGFW_x, - RGFW_y, - RGFW_z, - - RGFW_Period, - RGFW_Comma, - RGFW_Slash, - RGFW_Bracket, - RGFW_CloseBracket, - RGFW_Semicolon, - RGFW_Return, - RGFW_Quote, - RGFW_BackSlash, - RGFW_Up, RGFW_Down, RGFW_Left, RGFW_Right, - RGFW_Delete, RGFW_Insert, RGFW_End, RGFW_Home, @@ -1180,10 +1170,10 @@ typedef RGFW_ENUM(u8, RGFW_Key) { RGFW_KP_Slash, RGFW_Multiply, RGFW_KP_Minus, - RGFW_KP_1, - RGFW_KP_2, - RGFW_KP_3, - RGFW_KP_4, + RGFW_KP_1, + RGFW_KP_2, + RGFW_KP_3, + RGFW_KP_4, RGFW_KP_5, RGFW_KP_6, RGFW_KP_7, @@ -1193,7 +1183,7 @@ typedef RGFW_ENUM(u8, RGFW_Key) { RGFW_KP_Period, RGFW_KP_Return, - final_key, + final_key }; @@ -1263,121 +1253,121 @@ This is the start of keycode data #include #endif -u8 RGFW_keycodes [RGFW_OS_BASED_VALUE(136, 337, 128, DOM_VK_WIN_OEM_CLEAR + 1, 130)] = { +u8 RGFW_keycodes [RGFW_OS_BASED_VALUE(136, 0x15C + 1, 128, DOM_VK_WIN_OEM_CLEAR + 1, 130)] = { #ifdef __cplusplus 0 }; void RGFW_init_keys(void) { #endif - RGFW_MAP [RGFW_OS_BASED_VALUE(49, 192, 50, DOM_VK_BACK_QUOTE, KEY_GRAVE)] = RGFW_Backtick RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(49, 0x029, 50, DOM_VK_BACK_QUOTE, KEY_GRAVE)] = RGFW_Backtick RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(19, 0x30, 29, DOM_VK_0, KEY_0)] = RGFW_0 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(10, 0x31, 18, DOM_VK_1, KEY_1)] = RGFW_1 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(11, 0x32, 19, DOM_VK_2, KEY_2)] = RGFW_2 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(12, 0x33, 20, DOM_VK_3, KEY_3)] = RGFW_3 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(13, 0x34, 21, DOM_VK_4, KEY_4)] = RGFW_4 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(14, 0x35, 23, DOM_VK_5, KEY_5)] = RGFW_5 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(15, 0x36, 22, DOM_VK_6, KEY_6)] = RGFW_6 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(16, 0x37, 26, DOM_VK_7, KEY_7)] = RGFW_7 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(17, 0x38, 28, DOM_VK_8, KEY_8)] = RGFW_8 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(18, 0x39, 25, DOM_VK_9, KEY_9)] = RGFW_9, + RGFW_MAP [RGFW_OS_BASED_VALUE(19, 0x00B, 29, DOM_VK_0, KEY_0)] = RGFW_0 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(10, 0x002, 18, DOM_VK_1, KEY_1)] = RGFW_1 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(11, 0x003, 19, DOM_VK_2, KEY_2)] = RGFW_2 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(12, 0x004, 20, DOM_VK_3, KEY_3)] = RGFW_3 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(13, 0x005, 21, DOM_VK_4, KEY_4)] = RGFW_4 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(14, 0x006, 23, DOM_VK_5, KEY_5)] = RGFW_5 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(15, 0x007, 22, DOM_VK_6, KEY_6)] = RGFW_6 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(16, 0x008, 26, DOM_VK_7, KEY_7)] = RGFW_7 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(17, 0x009, 28, DOM_VK_8, KEY_8)] = RGFW_8 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(18, 0x00A, 25, DOM_VK_9, KEY_9)] = RGFW_9, - RGFW_MAP [RGFW_OS_BASED_VALUE(65, 0x20, 49, DOM_VK_SPACE, KEY_SPACE)] = RGFW_Space, + RGFW_MAP [RGFW_OS_BASED_VALUE(65, 0x039, 49, DOM_VK_SPACE, KEY_SPACE)] = RGFW_Space, - RGFW_MAP [RGFW_OS_BASED_VALUE(38, 0x41, 0, DOM_VK_A, KEY_A)] = RGFW_a RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(56, 0x42, 11, DOM_VK_B, KEY_B)] = RGFW_b RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(54, 0x43, 8, DOM_VK_C, KEY_C)] = RGFW_c RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(40, 0x44, 2, DOM_VK_D, KEY_D)] = RGFW_d RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(26, 0x45, 14, DOM_VK_E, KEY_E)] = RGFW_e RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(41, 0x46, 3, DOM_VK_F, KEY_F)] = RGFW_f RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(42, 0x47, 5, DOM_VK_G, KEY_G)] = RGFW_g RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(43, 0x48, 4, DOM_VK_H, KEY_H)] = RGFW_h RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(31, 0x49, 34, DOM_VK_I, KEY_I)] = RGFW_i RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(44, 0x4A, 38, DOM_VK_J, KEY_J)] = RGFW_j RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(45, 0x4B, 40, DOM_VK_K, KEY_K)] = RGFW_k RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(46, 0x4C, 37, DOM_VK_L, KEY_L)] = RGFW_l RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(58, 0x4D, 46, DOM_VK_M, KEY_M)] = RGFW_m RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(57, 0x4E, 45, DOM_VK_N, KEY_N)] = RGFW_n RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(32, 0x4F, 31, DOM_VK_O, KEY_O)] = RGFW_o RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(33, 0x50, 35, DOM_VK_P, KEY_P)] = RGFW_p RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(24, 0x51, 12, DOM_VK_Q, KEY_Q)] = RGFW_q RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(27, 0x52, 15, DOM_VK_R, KEY_R)] = RGFW_r RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(39, 0x53, 1, DOM_VK_S, KEY_S)] = RGFW_s RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(28, 0x54, 17, DOM_VK_T, KEY_T)] = RGFW_t RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(30, 0x55, 32, DOM_VK_U, KEY_U)] = RGFW_u RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(55, 0x56, 9, DOM_VK_V, KEY_V)] = RGFW_v RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(25, 0x57, 13, DOM_VK_W, KEY_W)] = RGFW_w RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(53, 0x58, 7, DOM_VK_X, KEY_X)] = RGFW_x RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(29, 0x59, 16, DOM_VK_Y, KEY_Y)] = RGFW_y RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(52, 0x5A, 6, DOM_VK_Z, KEY_Z)] = RGFW_z, + RGFW_MAP [RGFW_OS_BASED_VALUE(38, 0x01E, 0, DOM_VK_A, KEY_A)] = RGFW_a RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(56, 0x030, 11, DOM_VK_B, KEY_B)] = RGFW_b RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(54, 0x02E, 8, DOM_VK_C, KEY_C)] = RGFW_c RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(40, 0x020, 2, DOM_VK_D, KEY_D)] = RGFW_d RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(26, 0x012, 14, DOM_VK_E, KEY_E)] = RGFW_e RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(41, 0x021, 3, DOM_VK_F, KEY_F)] = RGFW_f RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(42, 0x022, 5, DOM_VK_G, KEY_G)] = RGFW_g RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(43, 0x023, 4, DOM_VK_H, KEY_H)] = RGFW_h RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(31, 0x017, 34, DOM_VK_I, KEY_I)] = RGFW_i RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(44, 0x024, 38, DOM_VK_J, KEY_J)] = RGFW_j RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(45, 0x025, 40, DOM_VK_K, KEY_K)] = RGFW_k RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(46, 0x026, 37, DOM_VK_L, KEY_L)] = RGFW_l RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(58, 0x032, 46, DOM_VK_M, KEY_M)] = RGFW_m RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(57, 0x031, 45, DOM_VK_N, KEY_N)] = RGFW_n RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(32, 0x018, 31, DOM_VK_O, KEY_O)] = RGFW_o RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(33, 0x019, 35, DOM_VK_P, KEY_P)] = RGFW_p RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(24, 0x010, 12, DOM_VK_Q, KEY_Q)] = RGFW_q RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(27, 0x013, 15, DOM_VK_R, KEY_R)] = RGFW_r RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(39, 0x01F, 1, DOM_VK_S, KEY_S)] = RGFW_s RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(28, 0x014, 17, DOM_VK_T, KEY_T)] = RGFW_t RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(30, 0x016, 32, DOM_VK_U, KEY_U)] = RGFW_u RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(55, 0x02F, 9, DOM_VK_V, KEY_V)] = RGFW_v RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(25, 0x011, 13, DOM_VK_W, KEY_W)] = RGFW_w RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(53, 0x02D, 7, DOM_VK_X, KEY_X)] = RGFW_x RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(29, 0x015, 16, DOM_VK_Y, KEY_Y)] = RGFW_y RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(52, 0x02C, 6, DOM_VK_Z, KEY_Z)] = RGFW_z, - RGFW_MAP [RGFW_OS_BASED_VALUE(60, 190, 47, DOM_VK_PERIOD, KEY_DOT)] = RGFW_Period RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(59, 188, 43, DOM_VK_COMMA, KEY_COMMA)] = RGFW_Comma RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(61, 191, 44, DOM_VK_SLASH, KEY_SLASH)] = RGFW_Slash RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(34, 219, 33, DOM_VK_OPEN_BRACKET, KEY_LEFTBRACE)] = RGFW_Bracket RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(35, 221, 30, DOM_VK_CLOSE_BRACKET, KEY_RIGHTBRACE)] = RGFW_CloseBracket RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(47, 186, 41, DOM_VK_SEMICOLON, KEY_SEMICOLON)] = RGFW_Semicolon RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(48, 222, 39, DOM_VK_QUOTE, KEY_APOSTROPHE)] = RGFW_Quote RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(51, 322, 42, DOM_VK_BACK_SLASH, KEY_BACKSLASH)] = RGFW_BackSlash, + RGFW_MAP [RGFW_OS_BASED_VALUE(60, 0x034, 47, DOM_VK_PERIOD, KEY_DOT)] = RGFW_Period RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(59, 0x033, 43, DOM_VK_COMMA, KEY_COMMA)] = RGFW_Comma RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(61, 0x035, 44, DOM_VK_SLASH, KEY_SLASH)] = RGFW_Slash RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(34, 0x01A, 33, DOM_VK_OPEN_BRACKET, KEY_LEFTBRACE)] = RGFW_Bracket RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(35, 0x01B, 30, DOM_VK_CLOSE_BRACKET, KEY_RIGHTBRACE)] = RGFW_CloseBracket RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(47, 0x027, 41, DOM_VK_SEMICOLON, KEY_SEMICOLON)] = RGFW_Semicolon RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(48, 0x028, 39, DOM_VK_QUOTE, KEY_APOSTROPHE)] = RGFW_Apostrophe RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(51, 0x02B, 42, DOM_VK_BACK_SLASH, KEY_BACKSLASH)] = RGFW_BackSlash, - RGFW_MAP [RGFW_OS_BASED_VALUE(36, 0x0D, 36, DOM_VK_RETURN, KEY_ENTER)] = RGFW_Return RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(119, 0x2E, 118, DOM_VK_DELETE, KEY_DELETE)] = RGFW_Delete RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(77, 0x90, 72, DOM_VK_NUM_LOCK, KEY_NUMLOCK)] = RGFW_Numlock RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(106, 0x6F, 82, DOM_VK_DIVIDE, KEY_KPSLASH)] = RGFW_KP_Slash RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(63, 0x6A, 76, DOM_VK_MULTIPLY, KEY_KPASTERISK)] = RGFW_Multiply RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(82, 0x6D, 67, DOM_VK_SUBTRACT, KEY_KPMINUS)] = RGFW_KP_Minus RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(87, 0x61, 84, DOM_VK_NUMPAD1, KEY_KP1)] = RGFW_KP_1 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(88, 0x62, 85, DOM_VK_NUMPAD2, KEY_KP2)] = RGFW_KP_2 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(89, 0x63, 86, DOM_VK_NUMPAD3, KEY_KP3)] = RGFW_KP_3 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(83, 0x64, 87, DOM_VK_NUMPAD4, KEY_KP4)] = RGFW_KP_4 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(84, 0x65, 88, DOM_VK_NUMPAD5, KEY_KP5)] = RGFW_KP_5 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(85, 0x66, 89, DOM_VK_NUMPAD6, KEY_KP6)] = RGFW_KP_6 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(79, 0x67, 90, DOM_VK_NUMPAD7, KEY_KP7)] = RGFW_KP_7 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(80, 0x68, 92, DOM_VK_NUMPAD8, KEY_KP8)] = RGFW_KP_8 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(81, 0x69, 93, DOM_VK_NUMPAD9, KEY_KP9)] = RGFW_KP_9 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(90, 0x60, 83, DOM_VK_NUMPAD0, KEY_KP0)] = RGFW_KP_0 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(91, 0x6E, 65, DOM_VK_DECIMAL, KEY_KPDOT)] = RGFW_KP_Period RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(104, 0x92, 77, 0, KEY_KPENTER)] = RGFW_KP_Return, + RGFW_MAP [RGFW_OS_BASED_VALUE(36, 0x01C, 36, DOM_VK_RETURN, KEY_ENTER)] = RGFW_Return RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(119, 0x153, 118, DOM_VK_DELETE, KEY_DELETE)] = RGFW_Delete RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(77, 0x145, 72, DOM_VK_NUM_LOCK, KEY_NUMLOCK)] = RGFW_Numlock RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(106, 0x135, 82, DOM_VK_DIVIDE, KEY_KPSLASH)] = RGFW_KP_Slash RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(63, 0x037, 76, DOM_VK_MULTIPLY, KEY_KPASTERISK)] = RGFW_Multiply RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(82, 0x04A, 67, DOM_VK_SUBTRACT, KEY_KPMINUS)] = RGFW_KP_Minus RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(87, 0x04F, 84, DOM_VK_NUMPAD1, KEY_KP1)] = RGFW_KP_1 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(88, 0x050, 85, DOM_VK_NUMPAD2, KEY_KP2)] = RGFW_KP_2 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(89, 0x051, 86, DOM_VK_NUMPAD3, KEY_KP3)] = RGFW_KP_3 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(83, 0x04B, 87, DOM_VK_NUMPAD4, KEY_KP4)] = RGFW_KP_4 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(84, 0x04C, 88, DOM_VK_NUMPAD5, KEY_KP5)] = RGFW_KP_5 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(85, 0x04D, 89, DOM_VK_NUMPAD6, KEY_KP6)] = RGFW_KP_6 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(79, 0x047, 90, DOM_VK_NUMPAD7, KEY_KP7)] = RGFW_KP_7 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(80, 0x048, 92, DOM_VK_NUMPAD8, KEY_KP8)] = RGFW_KP_8 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(81, 0x049, 93, DOM_VK_NUMPAD9, KEY_KP9)] = RGFW_KP_9 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(90, 0x052, 83, DOM_VK_NUMPAD0, KEY_KP0)] = RGFW_KP_0 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(91, 0x053, 65, DOM_VK_DECIMAL, KEY_KPDOT)] = RGFW_KP_Period RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(104, 0x11C, 77, 0, KEY_KPENTER)] = RGFW_KP_Return, - RGFW_MAP [RGFW_OS_BASED_VALUE(20, 189, 27, DOM_VK_HYPHEN_MINUS, KEY_MINUS)] = RGFW_Minus RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(21, 187, 24, DOM_VK_EQUALS, KEY_EQUAL)] = RGFW_Equals RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(22, 8, 51, DOM_VK_BACK_SPACE, KEY_BACKSPACE)] = RGFW_BackSpace RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(23, 0x09, 48, DOM_VK_TAB, KEY_TAB)] = RGFW_Tab RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(66, 20, 57, DOM_VK_CAPS_LOCK, KEY_CAPSLOCK)] = RGFW_CapsLock RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(50, 0x10, 56, DOM_VK_SHIFT, KEY_LEFTSHIFT)] = RGFW_ShiftL RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(37, 0x11, 59, DOM_VK_CONTROL, KEY_LEFTCTRL)] = RGFW_ControlL RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(64,0x12, 58, DOM_VK_ALT, KEY_LEFTALT)] = RGFW_AltL RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(133, 0x5B, 55, DOM_VK_WIN, KEY_LEFTMETA)] = RGFW_SuperL, + RGFW_MAP [RGFW_OS_BASED_VALUE(20, 0x00C, 27, DOM_VK_HYPHEN_MINUS, KEY_MINUS)] = RGFW_Minus RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(21, 0x00D, 24, DOM_VK_EQUALS, KEY_EQUAL)] = RGFW_Equals RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(22, 0x00E, 51, DOM_VK_BACK_SPACE, KEY_BACKSPACE)] = RGFW_BackSpace RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(23, 0x00F, 48, DOM_VK_TAB, KEY_TAB)] = RGFW_Tab RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(66, 0x03A, 57, DOM_VK_CAPS_LOCK, KEY_CAPSLOCK)] = RGFW_CapsLock RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(50, 0x02A, 56, DOM_VK_SHIFT, KEY_LEFTSHIFT)] = RGFW_ShiftL RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(37, 0x01D, 59, DOM_VK_CONTROL, KEY_LEFTCTRL)] = RGFW_ControlL RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(64, 0x038, 58, DOM_VK_ALT, KEY_LEFTALT)] = RGFW_AltL RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(133, 0x15B, 55, DOM_VK_WIN, KEY_LEFTMETA)] = RGFW_SuperL, - #if !defined(RGFW_WINDOWS) && !defined(RGFW_MACOS) && !defined(RGFW_WEBASM) - RGFW_MAP [RGFW_OS_BASED_VALUE(105, 0x11, 59, 0, KEY_RIGHTCTRL)] = RGFW_ControlR RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(135, 0xA4, 55, 0, KEY_RIGHTMETA)] = RGFW_SuperR, - RGFW_MAP [RGFW_OS_BASED_VALUE(62, 0x5C, 56, 0, KEY_RIGHTSHIFT)] = RGFW_ShiftR RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(108, 165, 58, 0, KEY_RIGHTALT)] = RGFW_AltR, + #if !defined(RGFW_MACOS) && !defined(RGFW_WEBASM) + RGFW_MAP [RGFW_OS_BASED_VALUE(105, 0x11D, 59, 0, KEY_RIGHTCTRL)] = RGFW_ControlR RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(135, 0x15C, 55, 0, KEY_RIGHTMETA)] = RGFW_SuperR, + RGFW_MAP [RGFW_OS_BASED_VALUE(62, 0x036, 56, 0, KEY_RIGHTSHIFT)] = RGFW_ShiftR RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(108, 0x138, 58, 0, KEY_RIGHTALT)] = RGFW_AltR, #endif - RGFW_MAP [RGFW_OS_BASED_VALUE(67, 0x70, 127, DOM_VK_F1, KEY_F1)] = RGFW_F1 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(68, 0x71, 121, DOM_VK_F2, KEY_F2)] = RGFW_F2 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(69, 0x72, 100, DOM_VK_F3, KEY_F3)] = RGFW_F3 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(70, 0x73, 119, DOM_VK_F4, KEY_F4)] = RGFW_F4 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(71, 0x74, 97, DOM_VK_F5, KEY_F5)] = RGFW_F5 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(72, 0x75, 98, DOM_VK_F6, KEY_F6)] = RGFW_F6 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(73, 0x76, 99, DOM_VK_F7, KEY_F7)] = RGFW_F7 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(74, 0x77, 101, DOM_VK_F8, KEY_F8)] = RGFW_F8 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(75, 0x78, 102, DOM_VK_F9, KEY_F9)] = RGFW_F9 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(76, 0x79, 110, DOM_VK_F10, KEY_F10)] = RGFW_F10 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(95, 0x7A, 104, DOM_VK_F11, KEY_F11)] = RGFW_F11 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(96, 0x7B, 112, DOM_VK_F12, KEY_F12)] = RGFW_F12 RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(111, 0x26, 126, DOM_VK_UP, KEY_UP)] = RGFW_Up RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(116, 0x28, 125, DOM_VK_DOWN, KEY_DOWN)] = RGFW_Down RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(113, 0x25, 123, DOM_VK_LEFT, KEY_LEFT)] = RGFW_Left RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(114, 0x27, 124, DOM_VK_RIGHT, KEY_RIGHT)] = RGFW_Right RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(118, 0x2D, 115, DOM_VK_INSERT, KEY_INSERT)] = RGFW_Insert RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(115, 0x23, 120, DOM_VK_END, KEY_END)] = RGFW_End RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(112, 336, 117, DOM_VK_PAGE_UP, KEY_PAGEUP)] = RGFW_PageUp RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(117, 325, 122, DOM_VK_PAGE_DOWN, KEY_PAGEDOWN)] = RGFW_PageDown RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(9, 0x1B, 53, DOM_VK_ESCAPE, KEY_ESC)] = RGFW_Escape RGFW_NEXT - RGFW_MAP [RGFW_OS_BASED_VALUE(110, 0x24, 116, DOM_VK_HOME, KEY_HOME)] = RGFW_Home RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(67, 0x03B, 127, DOM_VK_F1, KEY_F1)] = RGFW_F1 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(68, 0x03C, 121, DOM_VK_F2, KEY_F2)] = RGFW_F2 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(69, 0x03D, 100, DOM_VK_F3, KEY_F3)] = RGFW_F3 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(70, 0x03E, 119, DOM_VK_F4, KEY_F4)] = RGFW_F4 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(71, 0x03F, 97, DOM_VK_F5, KEY_F5)] = RGFW_F5 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(72, 0x040, 98, DOM_VK_F6, KEY_F6)] = RGFW_F6 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(73, 0x041, 99, DOM_VK_F7, KEY_F7)] = RGFW_F7 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(74, 0x042, 101, DOM_VK_F8, KEY_F8)] = RGFW_F8 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(75, 0x043, 102, DOM_VK_F9, KEY_F9)] = RGFW_F9 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(76, 0x044, 110, DOM_VK_F10, KEY_F10)] = RGFW_F10 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(95, 0x057, 104, DOM_VK_F11, KEY_F11)] = RGFW_F11 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(96, 0x058, 112, DOM_VK_F12, KEY_F12)] = RGFW_F12 RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(111, 0x148, 126, DOM_VK_UP, KEY_UP)] = RGFW_Up RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(116, 0x150, 125, DOM_VK_DOWN, KEY_DOWN)] = RGFW_Down RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(113, 0x14B, 123, DOM_VK_LEFT, KEY_LEFT)] = RGFW_Left RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(114, 0x14D, 124, DOM_VK_RIGHT, KEY_RIGHT)] = RGFW_Right RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(118, 0x152, 115, DOM_VK_INSERT, KEY_INSERT)] = RGFW_Insert RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(115, 0x14F, 120, DOM_VK_END, KEY_END)] = RGFW_End RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(112, 0x149, 117, DOM_VK_PAGE_UP, KEY_PAGEUP)] = RGFW_PageUp RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(117, 0x151, 122, DOM_VK_PAGE_DOWN, KEY_PAGEDOWN)] = RGFW_PageDown RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(9, 0x001, 53, DOM_VK_ESCAPE, KEY_ESC)] = RGFW_Escape RGFW_NEXT + RGFW_MAP [RGFW_OS_BASED_VALUE(110, 0x147, 116, DOM_VK_HOME, KEY_HOME)] = RGFW_Home RGFW_NEXT #ifndef __cplusplus }; #else @@ -1394,9 +1384,9 @@ typedef struct { RGFW_keyState RGFW_keyboard[final_key] = { {0, 0} }; -RGFWDEF u32 RGFW_apiKeyCodeToRGFW(u32 keycode); +RGFWDEF u32 RGFW_apiKeyToRGFW(u32 keycode); -u32 RGFW_apiKeyCodeToRGFW(u32 keycode) { +u32 RGFW_apiKeyToRGFW(u32 keycode) { #ifdef __cplusplus if (RGFW_OS_BASED_VALUE(49, 192, 50, DOM_VK_BACK_QUOTE, KEY_GRAVE) != RGFW_Backtick) { RGFW_init_keys(); @@ -1419,38 +1409,6 @@ void RGFW_resetKey(void) { RGFW_keyboard[i].prev = 0; } -b8 RGFW_shouldShift(u32 keycode, u8 lockState) { - #define RGFW_xor(x, y) (( (x) && (!(y)) ) || ((y) && (!(x)) )) - b8 caps4caps = (lockState & RGFW_CAPSLOCK) && ((keycode >= RGFW_a) && (keycode <= RGFW_z)); - b8 shouldShift = RGFW_xor((RGFW_isPressed(NULL, RGFW_ShiftL) || RGFW_isPressed(NULL, RGFW_ShiftR)), caps4caps); - #undef RGFW_xor - - return shouldShift; -} - -char RGFW_keyCodeToChar(u32 keycode, b8 shift) { - static const char map[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '`', '0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', '-', '=', 0, '\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '.', ',', '/', '[', ']', ';', '\n', '\'', '\\', - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', '*', '-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\n' - }; - - static const char mapCaps[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '~', ')', '!', '@', '#', '$', '%', '^', '&', '*', - '(', '_', '+', 0, '0', 0, 0, 0, 0, 0, 0, 0, 0, 0, ' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', - 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', '>', '<', '?', '{', '}', ':', '\n', '"', '|', - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '?', '*', '-', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - - if (shift == RGFW_FALSE) - return map[keycode]; - return mapCaps[keycode]; -} - -char RGFW_keyCodeToCharAuto(u32 keycode, u8 lockState) { return RGFW_keyCodeToChar(keycode, RGFW_shouldShift(keycode, lockState)); } - /* this is the end of keycode data */ @@ -1479,7 +1437,7 @@ void RGFW_mouseNotifyfuncEMPTY(RGFW_window* win, RGFW_point point, b8 status) {R void RGFW_mouseposfuncEMPTY(RGFW_window* win, RGFW_point point) {RGFW_UNUSED(win); RGFW_UNUSED(point);} void RGFW_dndInitfuncEMPTY(RGFW_window* win, RGFW_point point) {RGFW_UNUSED(win); RGFW_UNUSED(point);} void RGFW_windowrefreshfuncEMPTY(RGFW_window* win) {RGFW_UNUSED(win); } -void RGFW_keyfuncEMPTY(RGFW_window* win, u32 keycode, char keyName[16], u8 lockState, b8 pressed) {RGFW_UNUSED(win); RGFW_UNUSED(keycode); RGFW_UNUSED(keyName); RGFW_UNUSED(lockState); RGFW_UNUSED(pressed);} +void RGFW_keyfuncEMPTY(RGFW_window* win, u32 key, u32 mappedKey, char keyName[16], u8 lockState, b8 pressed) {RGFW_UNUSED(win); RGFW_UNUSED(key); RGFW_UNUSED(mappedKey); RGFW_UNUSED(keyName); RGFW_UNUSED(lockState); RGFW_UNUSED(pressed);} void RGFW_mousebuttonfuncEMPTY(RGFW_window* win, u8 button, double scroll, b8 pressed) {RGFW_UNUSED(win); RGFW_UNUSED(button); RGFW_UNUSED(scroll); RGFW_UNUSED(pressed);} void RGFW_gpButtonfuncEMPTY(RGFW_window* win, u16 gamepad, u8 button, b8 pressed){RGFW_UNUSED(win); RGFW_UNUSED(gamepad); RGFW_UNUSED(button); RGFW_UNUSED(pressed); } void RGFW_gpAxisfuncEMPTY(RGFW_window* win, u16 gamepad, RGFW_point axis[2], u8 axisesCount){RGFW_UNUSED(win); RGFW_UNUSED(gamepad); RGFW_UNUSED(axis); RGFW_UNUSED(axisesCount); } @@ -1959,7 +1917,7 @@ void RGFW_updateLockState(RGFW_window* win, b8 capital, b8 numlock) { MacOS and Windows do this using a structure called a "pixel format" X11 calls it a "Visual" This function returns the attributes for the format we want */ - static u32* RGFW_initFormatAttribs(u32 useSoftware) { + u32* RGFW_initFormatAttribs(u32 useSoftware) { RGFW_UNUSED(useSoftware); static u32 attribs[] = { #if defined(RGFW_X11) || defined(RGFW_WINDOWS) @@ -2422,6 +2380,10 @@ Start of Linux / Unix defines win->buffer = (u8*)RGFW_MALLOC(RGFW_bufferSize.w * RGFW_bufferSize.h * 4); + #ifdef RGFW_DEBUG + printf("RGFW INFO: createing a 4 channel %i by %i buffer\n", RGFW_bufferSize.w, RGFW_bufferSize.h); + #endif + #ifdef RGFW_OSMESA win->src.ctx = OSMesaCreateContext(OSMESA_RGBA, NULL); OSMesaMakeCurrent(win->src.ctx, win->buffer, GL_UNSIGNED_BYTE, win->r.w, win->r.h); @@ -2489,7 +2451,6 @@ Start of Linux / Unix defines XISelectEvents(win->src.display, XDefaultRootWindow(win->src.display), &em, 1); XGrabPointer(win->src.display, win->src.window, True, PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime); - RGFW_window_moveMouse(win, RGFW_POINT(win->r.x + (i32)(r.w / 2), win->r.y + (i32)(r.h / 2))); } @@ -2739,6 +2700,10 @@ Start of Linux / Unix defines RGFW_windowsOpen++; + #ifdef RGFW_DEBUG + printf("RGFW INFO: a window with a rect of {%i, %i, %i, %i} \n", win->r.x, win->r.y, win->r.w, win->r.h); + #endif + return win; /*return newly created window*/ } @@ -2831,8 +2796,10 @@ Start of Linux / Unix defines } /* set event key data */ + win->event.key = RGFW_apiKeyToRGFW(E.xkey.keycode); + KeySym sym = (KeySym)XkbKeycodeToKeysym((Display*) win->src.display, E.xkey.keycode, 0, E.xkey.state & ShiftMask ? 1 : 0); - win->event.keyCode = RGFW_apiKeyCodeToRGFW(E.xkey.keycode); + win->event.keyChar = (u8)sym; char* str = (char*)XKeysymToString(sym); if (str != NULL) @@ -2840,7 +2807,7 @@ Start of Linux / Unix defines win->event.keyName[15] = '\0'; - RGFW_keyboard[win->event.keyCode].prev = RGFW_isPressed(win, win->event.keyCode); + RGFW_keyboard[win->event.key].prev = RGFW_isPressed(win, win->event.key); /* get keystate data */ win->event.type = (E.type == KeyPress) ? RGFW_keyPressed : RGFW_keyReleased; @@ -2849,14 +2816,15 @@ Start of Linux / Unix defines XGetKeyboardControl((Display*) win->src.display, &keystate); RGFW_updateLockState(win, (keystate.led_mask & 1), (keystate.led_mask & 2)); - RGFW_keyboard[win->event.keyCode].current = (E.type == KeyPress); - RGFW_keyCallback(win, win->event.keyCode, win->event.keyName, win->event.lockState, (E.type == KeyPress)); + RGFW_keyboard[win->event.key].current = (E.type == KeyPress); + RGFW_keyCallback(win, win->event.key, win->event.keyChar, win->event.keyName, win->event.lockState, (E.type == KeyPress)); break; } case ButtonPress: case ButtonRelease: win->event.type = RGFW_mouseButtonPressed + (E.type == ButtonRelease); // the events match + win->event.button = E.xbutton.button; switch(win->event.button) { case RGFW_mouseScrollUp: win->event.scroll = 1; @@ -2866,12 +2834,11 @@ Start of Linux / Unix defines break; default: break; } - - win->event.button = E.xbutton.button; + RGFW_mouseButtons[win->event.button].prev = RGFW_mouseButtons[win->event.button].current; if (win->event.repeat == RGFW_FALSE) - win->event.repeat = RGFW_isPressed(win, win->event.keyCode); + win->event.repeat = RGFW_isPressed(win, win->event.key); RGFW_mouseButtons[win->event.button].current = (E.type == ButtonPress); RGFW_mouseButtonCallback(win, win->event.button, win->event.scroll, (E.type == ButtonPress)); @@ -2884,8 +2851,8 @@ Start of Linux / Unix defines if ((win->_winArgs & RGFW_HOLD_MOUSE)) { win->event.point.y = E.xmotion.y; - win->event.point.x = win->_lastMousePoint.x - abs(win->event.point.x); - win->event.point.y = win->_lastMousePoint.y - abs(win->event.point.y); + win->event.point.x = win->event.point.x - win->_lastMousePoint.x; + win->event.point.y = win->event.point.y - win->_lastMousePoint.y; } win->_lastMousePoint = RGFW_POINT(E.xmotion.x, E.xmotion.y); @@ -3217,9 +3184,9 @@ Start of Linux / Unix defines break; } - default: { - break; - } + default: + XFlush((Display*) win->src.display); + return RGFW_window_checkEvent(win); } XFlush((Display*) win->src.display); @@ -3432,7 +3399,7 @@ Start of Linux / Unix defines #endif } - void RGFW_window_moveMouse(RGFW_window* win, RGFW_point v) { + void RGFW_window_moveMouse(RGFW_window* win, RGFW_point p) { assert(win != NULL); XEvent event; @@ -3442,10 +3409,11 @@ Start of Linux / Unix defines &event.xbutton.x, &event.xbutton.y, &event.xbutton.state); - if (event.xbutton.x == v.x && event.xbutton.y == v.y) + win->_lastMousePoint = RGFW_POINT(p.x - win->r.x, p.y - win->r.y); + if (event.xbutton.x == p.x && event.xbutton.y == p.y) return; - XWarpPointer(win->src.display, None, win->src.window, 0, 0, 0, 0, (int) v.x - win->r.x, (int) v.y - win->r.y); + XWarpPointer(win->src.display, None, win->src.window, 0, 0, 0, 0, (int) p.x - win->r.x, (int) p.y - win->r.y); } RGFWDEF void RGFW_window_disableMouse(RGFW_window* win) { @@ -3783,6 +3751,10 @@ Start of Linux / Unix defines monitor.scaleY = (float) (dpi_height) / (float) 96; XRRFreeScreenResources(sr); XCloseDisplay(display); + + #ifdef RGFW_DEBUG + printf("RGFW INFO: monitor found: scale (%s):\n rect: {%i, %i, %i, %i}\n physical size:%f %f\n scale: %f %f\n", monitor.name, monitor.rect.x, monitor.rect.y, monitor.rect.w, monitor.rect.h, monitor.physW, monitor.physH, monitor.scaleX, monitor.scaleY); + #endif return monitor; } @@ -3812,6 +3784,10 @@ Start of Linux / Unix defines XCloseDisplay(display); + #ifdef RGFW_DEBUG + printf("RGFW INFO: monitor found: scale (%s):\n rect: {%i, %i, %i, %i}\n physical size:%f %f\n scale: %f %f\n", monitor.name, monitor.rect.x, monitor.rect.y, monitor.rect.w, monitor.rect.h, monitor.physW, monitor.physH, monitor.scaleX, monitor.scaleY); + #endif + return monitor; } @@ -4421,19 +4397,20 @@ static void keyboard_key (void *data, struct wl_keyboard *keyboard, uint32_t ser char name[16]; xkb_keysym_get_name(keysym, name, 16); - u32 RGFW_key = RGFW_apiKeyCodeToRGFW(key); + u32 RGFW_key = RGFW_apiKeyToRGFW(key); RGFW_keyboard[RGFW_key].prev = RGFW_keyboard[RGFW_key].current; RGFW_keyboard[RGFW_key].current = state; RGFW_Event ev; ev.type = RGFW_keyPressed + state; - ev.keyCode = RGFW_key; + ev.key = RGFW_key; + ev.keyChar = (u8)keysym; strcpy(ev.keyName, name); ev.repeat = RGFW_isHeld(RGFW_key_win, RGFW_key); RGFW_eventPipe_push(RGFW_key_win, ev); RGFW_updateLockState(RGFW_key_win, xkb_keymap_mod_get_index(keymap, "Lock"), xkb_keymap_mod_get_index(keymap, "Mod2")); - RGFW_keyCallback(RGFW_key_win, RGFW_key, name, RGFW_key_win->event.lockState, state); + RGFW_keyCallback(RGFW_key_win, RGFW_key, (u8)keysym, name, RGFW_key_win->event.lockState, state); } static void keyboard_modifiers (void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { RGFW_UNUSED(data); RGFW_UNUSED(keyboard); RGFW_UNUSED(serial); RGFW_UNUSED(time); @@ -4563,6 +4540,8 @@ int create_shm_file(off_t size) { } static void wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) { + RGFW_UNUSED(data); RGFW_UNUSED(cb); RGFW_UNUSED(time); + #ifdef RGFW_BUFFER RGFW_window* win = (RGFW_window*)data; if ((win->_winArgs & RGFW_NO_CPU_RENDER)) @@ -4608,11 +4587,13 @@ static const struct wl_callback_listener wl_surface_frame_listener = { void RGFW_releaseCursor(RGFW_window* win) { RGFW_UNUSED(win); + + /* TODO wayland */ } void RGFW_captureCursor(RGFW_window* win, RGFW_rect r) { RGFW_UNUSED(win); RGFW_UNUSED(r); - + /* TODO wayland */ } @@ -4764,6 +4745,10 @@ static const struct wl_callback_listener wl_surface_frame_listener = { win->src.eventIndex = 0; win->src.eventLen = 0; + + #ifdef RGFW_DEBUG + printf("RGFW INFO: a window with a rect of {%i, %i, %i, %i} \n", win->r.x, win->r.y, win->r.w, win->r.h); + #endif return win; } @@ -4812,8 +4797,20 @@ static const struct wl_callback_listener wl_surface_frame_listener = { void RGFW_window_move(RGFW_window* win, RGFW_point v) { RGFW_UNUSED(win); RGFW_UNUSED(v); - + /* TODO wayland */ + assert(win != NULL); + struct wl_pointer *pointer = wl_seat_get_pointer(win->seat); + if (!pointer) { + return; + } + + // Initiate the move operation + wl_shell_surface_move(win->shell_surface, pointer, win->serial); + win->r.x = v.x; + win->r.y = v.y; + + wl_display_flush(win->display); } void RGFW_window_setIcon(RGFW_window* win, u8* src, RGFW_area a, i32 channels) { @@ -4821,9 +4818,11 @@ static const struct wl_callback_listener wl_surface_frame_listener = { /* TODO wayland */ } - void RGFW_window_moveMouse(RGFW_window* win, RGFW_point v) { - RGFW_UNUSED(win); RGFW_UNUSED(v); - + void RGFW_window_moveMouse(RGFW_window* win, RGFW_point p) { + win->_lastMousePoint = RGFW_POINT(p.x - win->r.x, p.y - win->r.y); + #ifdef RGFW_DEBUG + printf("Wayland: The platform does not support moving the mouse\n"); + #endif /* TODO wayland */ } @@ -5206,7 +5205,7 @@ static HMODULE wglinstance = NULL; return DefWindowProcA(hWnd, message, wParam, lParam); } } - + #ifndef RGFW_NO_DPI static HMODULE RGFW_Shcore_dll = NULL; typedef HRESULT (WINAPI * PFN_GetDpiForMonitor)(HMONITOR,MONITOR_DPI_TYPE,UINT*,UINT*); @@ -5363,9 +5362,9 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ Class.hCursor = LoadCursor(NULL, IDC_ARROW); Class.lpfnWndProc = WndProc; - Class.hIcon = LoadImageA(GetModuleHandleW(NULL), "RGFW_ICON", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED); + Class.hIcon = (HICON)LoadImageA(GetModuleHandleW(NULL), "RGFW_ICON", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED); if (Class.hIcon == NULL) { - Class.hIcon = LoadImageA(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED); + Class.hIcon = (HICON)LoadImageA(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED); } RegisterClassA(&Class); @@ -5606,6 +5605,10 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ wglShareLists(RGFW_root->src.ctx, win->src.ctx); #endif + #ifdef RGFW_DEBUG + printf("RGFW INFO: a window with a rect of {%i, %i, %i, %i} \n", win->r.x, win->r.y, win->r.w, win->r.h); + #endif + return win; } @@ -5848,9 +5851,19 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ return &win->event; static BYTE keyboardState[256]; + GetKeyboardState(keyboardState); - if (PeekMessageA(&msg, win->src.window, 0u, 0u, PM_REMOVE)) { - switch (msg.message) { + + if (!IsWindow(win->src.window)) { + win->event.type = RGFW_quit; + RGFW_windowQuitCallback(win); + return &win->event; + } + + if (PeekMessageA(&msg, win->src.window, 0u, 0u, PM_REMOVE) == 0) + return NULL; + + switch (msg.message) { case WM_CLOSE: case WM_QUIT: RGFW_windowQuitCallback(win); @@ -5883,15 +5896,36 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ break; case WM_KEYUP: { - win->event.keyCode = RGFW_apiKeyCodeToRGFW((u32) msg.wParam); - - RGFW_keyboard[win->event.keyCode].prev = RGFW_isPressed(win, win->event.keyCode); + i32 scancode = (HIWORD(msg.lParam) & (KF_EXTENDED | 0xff)); + if (scancode == 0) + scancode = MapVirtualKeyW((u32)msg.wParam, MAPVK_VK_TO_VSC); + + switch (scancode) { + case 0x54: scancode = 0x137; break; /* Alt+PrtS */ + case 0x146: scancode = 0x45; break; /* Ctrl+Pause */ + case 0x136: scancode = 0x36; break; /* CJK IME sets the extended bit for right Shift */ + default: break; + } + + win->event.key = RGFW_apiKeyToRGFW((u32) scancode); + + if (msg.wParam == VK_CONTROL) { + if (HIWORD(msg.lParam) & KF_EXTENDED) + win->event.key = RGFW_ControlR; + else win->event.key = RGFW_ControlL; + } + + wchar_t charBuffer; + ToUnicodeEx(msg.wParam, scancode, keyboardState, (wchar_t*)&charBuffer, 1, 0, NULL); + + win->event.keyChar = (u8)charBuffer; + + RGFW_keyboard[win->event.key].prev = RGFW_isPressed(win, win->event.key); static char keyName[16]; { GetKeyNameTextA((LONG) msg.lParam, keyName, 16); - if ((!(GetKeyState(VK_CAPITAL) & 0x0001) && !(GetKeyState(VK_SHIFT) & 0x8000)) || ((GetKeyState(VK_CAPITAL) & 0x0001) && (GetKeyState(VK_SHIFT) & 0x8000))) { CharLowerBuffA(keyName, 16); @@ -5908,14 +5942,35 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ } win->event.type = RGFW_keyReleased; - RGFW_keyboard[win->event.keyCode].current = 0; - RGFW_keyCallback(win, win->event.keyCode, win->event.keyName, win->event.lockState, 0); + RGFW_keyboard[win->event.key].current = 0; + RGFW_keyCallback(win, win->event.key, win->event.keyChar, win->event.keyName, win->event.lockState, 0); break; } case WM_KEYDOWN: { - win->event.keyCode = RGFW_apiKeyCodeToRGFW((u32) msg.wParam); + i32 scancode = (HIWORD(msg.lParam) & (KF_EXTENDED | 0xff)); + if (scancode == 0) + scancode = MapVirtualKeyW((u32)msg.wParam, MAPVK_VK_TO_VSC); - RGFW_keyboard[win->event.keyCode].prev = RGFW_isPressed(win, win->event.keyCode); + switch (scancode) { + case 0x54: scancode = 0x137; break; /* Alt+PrtS */ + case 0x146: scancode = 0x45; break; /* Ctrl+Pause */ + case 0x136: scancode = 0x36; break; /* CJK IME sets the extended bit for right Shift */ + default: break; + } + + win->event.key = RGFW_apiKeyToRGFW((u32) scancode); + + if (msg.wParam == VK_CONTROL) { + if (HIWORD(msg.lParam) & KF_EXTENDED) + win->event.key = RGFW_ControlR; + else win->event.key = RGFW_ControlL; + } + + wchar_t charBuffer; + ToUnicodeEx(msg.wParam, scancode, keyboardState, &charBuffer, 1, 0, NULL); + win->event.keyChar = (u8)charBuffer; + + RGFW_keyboard[win->event.key].prev = RGFW_isPressed(win, win->event.key); static char keyName[16]; @@ -5938,20 +5993,20 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ } win->event.type = RGFW_keyPressed; - win->event.repeat = RGFW_isPressed(win, win->event.keyCode); - RGFW_keyboard[win->event.keyCode].current = 1; - RGFW_keyCallback(win, win->event.keyCode, win->event.keyName, win->event.lockState, 1); + win->event.repeat = RGFW_isPressed(win, win->event.key); + RGFW_keyboard[win->event.key].current = 1; + RGFW_keyCallback(win, win->event.key, win->event.keyChar, win->event.keyName, win->event.lockState, 1); break; } - case WM_MOUSEMOVE: + case WM_MOUSEMOVE: { if ((win->_winArgs & RGFW_HOLD_MOUSE)) break; win->event.type = RGFW_mousePosChanged; - win->event.point.x = GET_X_LPARAM(msg.lParam); - win->event.point.y = GET_Y_LPARAM(msg.lParam); + i32 x = GET_X_LPARAM(msg.lParam); + i32 y = GET_Y_LPARAM(msg.lParam); RGFW_mousePosCallback(win, win->event.point); @@ -5961,22 +6016,64 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ RGFW_mouseNotifyCallBack(win, win->event.point, 1); } - break; + /*if ((win->_winArgs & RGFW_HOLD_MOUSE)) { + RGFW_point p = RGFW_getGlobalMousePoint(); + //p = RGFW_POINT(p.x + win->r.x, p.y + win->r.y); + win->event.point.x = x - win->_lastMousePoint.x; + win->event.point.y = y - win->_lastMousePoint.y; + + win->_lastMousePoint = RGFW_POINT(x, y); + break; + }*/ + + win->event.point.x = x; + win->event.point.y = y; + win->_lastMousePoint = RGFW_POINT(x, y); + + break; + } case WM_INPUT: { if (!(win->_winArgs & RGFW_HOLD_MOUSE)) break; unsigned size = sizeof(RAWINPUT); - static RAWINPUT raw[sizeof(RAWINPUT)]; - GetRawInputData((HRAWINPUT)msg.lParam, RID_INPUT, raw, &size, sizeof(RAWINPUTHEADER)); + static RAWINPUT raw = {}; - if (raw->header.dwType != RIM_TYPEMOUSE || (raw->data.mouse.lLastX == 0 && raw->data.mouse.lLastY == 0) ) + GetRawInputData((HRAWINPUT)msg.lParam, RID_INPUT, &raw, &size, sizeof(RAWINPUTHEADER)); + + if (raw.header.dwType != RIM_TYPEMOUSE || (raw.data.mouse.lLastX == 0 && raw.data.mouse.lLastY == 0) ) break; - + + if (raw.data.mouse.usFlags & MOUSE_MOVE_ABSOLUTE) { + POINT pos = {0}; + int width, height; + + if (raw.data.mouse.usFlags & MOUSE_VIRTUAL_DESKTOP) { + pos.x += GetSystemMetrics(SM_XVIRTUALSCREEN); + pos.y += GetSystemMetrics(SM_YVIRTUALSCREEN); + width = GetSystemMetrics(SM_CXVIRTUALSCREEN); + height = GetSystemMetrics(SM_CYVIRTUALSCREEN); + } + else { + width = GetSystemMetrics(SM_CXSCREEN); + height = GetSystemMetrics(SM_CYSCREEN); + } + + pos.x += (int) ((raw.data.mouse.lLastX / 65535.f) * width); + pos.y += (int) ((raw.data.mouse.lLastY / 65535.f) * height); + ScreenToClient(win->src.window, &pos); + + win->event.point.x = pos.x - win->_lastMousePoint.x; + win->event.point.y = pos.y - win->_lastMousePoint.y; + } else { + win->event.point.x = raw.data.mouse.lLastX; + win->event.point.y = raw.data.mouse.lLastY; + } + win->event.type = RGFW_mousePosChanged; - win->event.point.x = raw->data.mouse.lLastX; - win->event.point.y = raw->data.mouse.lLastY; + win->_lastMousePoint.x += win->event.point.x; + win->_lastMousePoint.y += win->event.point.y; break; } @@ -6074,26 +6171,18 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ return 0; } default: - win->event.type = 0; + TranslateMessage(&msg); + DispatchMessageA(&msg); + + return RGFW_window_checkEvent(win); break; } TranslateMessage(&msg); DispatchMessageA(&msg); - } - else - win->event.type = 0; - if (!IsWindow(win->src.window)) { - win->event.type = RGFW_quit; - RGFW_windowQuitCallback(win); - } - - if (win->event.type) - return &win->event; - else - return NULL; + return &win->event; } u8 RGFW_window_isFullscreen(RGFW_window* win) { @@ -6208,6 +6297,10 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ monitor.physW = GetSystemMetrics(SM_CYSCREEN) / (float) ppiX; monitor.physH = GetSystemMetrics(SM_CXSCREEN) / (float) ppiY; + #ifdef RGFW_DEBUG + printf("RGFW INFO: monitor found: scale (%s):\n rect: {%i, %i, %i, %i}\n physical size:%f %f\n scale: %f %f\n", monitor.name, monitor.rect.x, monitor.rect.y, monitor.rect.w, monitor.rect.h, monitor.physW, monitor.physH, monitor.scaleX, monitor.scaleY); + #endif + return monitor; } #endif /* RGFW_NO_MONITOR */ @@ -6576,7 +6669,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ void RGFW_window_moveMouse(RGFW_window* win, RGFW_point p) { assert(win != NULL); - + win->_lastMousePoint = RGFW_POINT(p.x - win->r.x, p.y - win->r.y); SetCursorPos(p.x, p.y); } @@ -6738,7 +6831,6 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ typedef void NSDraggingInfo; typedef void NSWindow; typedef void NSApplication; - typedef void NSScreen; typedef void NSEvent; typedef void NSString; typedef void NSOpenGLContext; @@ -7210,7 +7302,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ return false; } - static void NSMoveToResourceDir(void) { + void NSMoveToResourceDir(void) { /* sourced from glfw */ char resourcesPath[255]; @@ -7497,6 +7589,10 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ NSRetain(win->src.window); NSRetain(NSApp); + #ifdef RGFW_DEBUG + printf("RGFW INFO: a window with a rect of {%i, %i, %i, %i} \n", win->r.x, win->r.y, win->r.w, win->r.h); + #endif + return win; } @@ -7663,7 +7759,8 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ if (e) { - objc_msgSend_void_id(NSApp, sel_registerName("sendEvent:"), e); + ((void (*)(id, SEL, id, bool))objc_msgSend) + (NSApp, sel_registerName("postEvent:atStart:"), e, 1); } objc_msgSend_bool_void(eventPool, sel_registerName("drain")); @@ -7687,8 +7784,8 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ if (eventFunc == NULL) eventFunc = sel_registerName("nextEventMatchingMask:untilDate:inMode:dequeue:"); - if ((win->event.type == RGFW_windowMoved || win->event.type == RGFW_windowResized || win->event.type == RGFW_windowRefresh) && win->event.keyCode != 120) { - win->event.keyCode = 120; + if ((win->event.type == RGFW_windowMoved || win->event.type == RGFW_windowResized || win->event.type == RGFW_windowRefresh) && win->event.key != 120) { + win->event.key = 120; objc_msgSend_bool_void(eventPool, sel_registerName("drain")); return &win->event; } @@ -7723,7 +7820,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ switch (objc_msgSend_uint(e, sel_registerName("type"))) { case NSEventTypeMouseEntered: { win->event.type = RGFW_mouseEnter; - NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(e, sel_registerName("locationInWindow")); + NSPoint p = ((NSPoint(*)(id, SEL)) objc_msgSend)(e, sel_registerName("locationInWindow")); win->event.point = RGFW_POINT((i32) p.x, (i32) (win->r.h - p.y)); RGFW_mouseNotifyCallBack(win, win->event.point, 1); @@ -7737,31 +7834,40 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ case NSEventTypeKeyDown: { u32 key = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); - win->event.keyCode = RGFW_apiKeyCodeToRGFW(key); - RGFW_keyboard[win->event.keyCode].prev = RGFW_keyboard[win->event.keyCode].current; + + u32 mappedKey = *((u32*)((char*)(const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("charactersIgnoringModifiers"))))); + + win->event.keyChar = (u8)mappedKey; + + win->event.key = RGFW_apiKeyToRGFW(key); + RGFW_keyboard[win->event.key].prev = RGFW_keyboard[win->event.key].current; win->event.type = RGFW_keyPressed; char* str = (char*)(const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); strncpy(win->event.keyName, str, 16); - win->event.repeat = RGFW_isPressed(win, win->event.keyCode); - RGFW_keyboard[win->event.keyCode].current = 1; + win->event.repeat = RGFW_isPressed(win, win->event.key); + RGFW_keyboard[win->event.key].current = 1; - RGFW_keyCallback(win, win->event.keyCode, win->event.keyName, win->event.lockState, 1); + RGFW_keyCallback(win, win->event.key, win->event.keyChar, win->event.keyName, win->event.lockState, 1); break; } case NSEventTypeKeyUp: { - u32 key = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); - win->event.keyCode = RGFW_apiKeyCodeToRGFW(key);; - - RGFW_keyboard[win->event.keyCode].prev = RGFW_keyboard[win->event.keyCode].current; + u32 key = (u16) objc_msgSend_uint(e, sel_registerName("keyCode")); + + u32 mappedKey = *((u32*)((char*)(const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("charactersIgnoringModifiers"))))); + win->event.keyChar = (u8)mappedKey; + + win->event.key = RGFW_apiKeyToRGFW(key); + + RGFW_keyboard[win->event.key].prev = RGFW_keyboard[win->event.key].current; win->event.type = RGFW_keyReleased; char* str = (char*)(const char*) NSString_to_char(objc_msgSend_id(e, sel_registerName("characters"))); strncpy(win->event.keyName, str, 16); - RGFW_keyboard[win->event.keyCode].current = 0; - RGFW_keyCallback(win, win->event.keyCode, win->event.keyName, win->event.lockState, 0); + RGFW_keyboard[win->event.key].current = 0; + RGFW_keyCallback(win, win->event.key, win->event.keyChar, win->event.keyName, win->event.lockState, 0); break; } @@ -7784,7 +7890,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ RGFW_keyboard[key+ 4].current = 1; win->event.type = RGFW_keyPressed; - win->event.keyCode = key; + win->event.key = key; break; } @@ -7795,12 +7901,12 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ RGFW_keyboard[key + 4].current = 0; win->event.type = RGFW_keyReleased; - win->event.keyCode = key; + win->event.key = key; break; } } - RGFW_keyCallback(win, win->event.keyCode, win->event.keyName, win->event.lockState, win->event.type == RGFW_keyPressed); + RGFW_keyCallback(win, win->event.key, win->event.keyChar, win->event.keyName, win->event.lockState, win->event.type == RGFW_keyPressed); break; } @@ -7890,8 +7996,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ break; } - default: - break; + default: return RGFW_window_checkEvent(win); } objc_msgSend_void_id(NSApp, sel_registerName("sendEvent:"), e); @@ -8057,7 +8162,8 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ void RGFW_window_moveMouse(RGFW_window* win, RGFW_point v) { RGFW_UNUSED(win); - + + win->_lastMousePoint = RGFW_POINT(v.x - win->r.x, v.y - win->r.y); CGWarpMouseCursorPosition(CGPointMake(v.x, v.y)); } @@ -8097,7 +8203,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ return objc_msgSend_bool(win->src.window, sel_registerName("isZoomed")); } - static RGFW_monitor RGFW_NSCreateMonitor(CGDirectDisplayID display) { + RGFW_monitor RGFW_NSCreateMonitor(CGDirectDisplayID display) { RGFW_monitor monitor; CGRect bounds = CGDisplayBounds(display); @@ -8111,7 +8217,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ float dpi_height = round((double)monitor.rect.h/(double)monitor.physH); monitor.scaleX = (float) (dpi_width) / (float) 96; - monitor.scaleY = (float) (dpi_height) / (float) 96; + monitor.scaleY = (float) (dpi_height) / (float) 96; if (isinf(monitor.scaleX) || (monitor.scaleX > 1 && monitor.scaleX < 1.1)) monitor.scaleX = 1; @@ -8119,11 +8225,15 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ if (isinf(monitor.scaleY) || (monitor.scaleY > 1 && monitor.scaleY < 1.1)) monitor.scaleY = 1; + #ifdef RGFW_DEBUG + printf("RGFW INFO: monitor found: scale (%s):\n rect: {%i, %i, %i, %i}\n physical size:%f %f\n scale: %f %f\n", monitor.name, monitor.rect.x, monitor.rect.y, monitor.rect.w, monitor.rect.h, monitor.physW, monitor.physH, monitor.scaleX, monitor.scaleY); + #endif + return monitor; } - static RGFW_monitor RGFW_monitors[7]; + RGFW_monitor RGFW_monitors[7]; RGFW_monitor* RGFW_getMonitors(void) { static CGDirectDisplayID displays[7]; @@ -8334,39 +8444,6 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ RGFW_Event RGFW_events[20]; size_t RGFW_eventLen = 0; -EM_BOOL Emscripten_on_keydown(int eventType, const EmscriptenKeyboardEvent* e, void* userData) { - RGFW_UNUSED(eventType); RGFW_UNUSED(userData); - - RGFW_events[RGFW_eventLen].type = RGFW_keyPressed; - memcpy(RGFW_events[RGFW_eventLen].keyName, e->key, 16); - RGFW_events[RGFW_eventLen].keyCode = RGFW_apiKeyCodeToRGFW(e->keyCode); - RGFW_events[RGFW_eventLen].lockState = 0; - RGFW_eventLen++; - - RGFW_keyboard[RGFW_apiKeyCodeToRGFW(e->keyCode)].prev = RGFW_keyboard[RGFW_apiKeyCodeToRGFW(e->keyCode)].current; - RGFW_keyboard[RGFW_apiKeyCodeToRGFW(e->keyCode)].current = 1; - RGFW_keyCallback(RGFW_root, RGFW_apiKeyCodeToRGFW(e->keyCode), RGFW_events[RGFW_eventLen].keyName, 0, 1); - - return EM_TRUE; -} - -EM_BOOL Emscripten_on_keyup(int eventType, const EmscriptenKeyboardEvent* e, void* userData) { - RGFW_UNUSED(eventType); RGFW_UNUSED(userData); - - RGFW_events[RGFW_eventLen].type = RGFW_keyReleased; - memcpy(RGFW_events[RGFW_eventLen].keyName, e->key, 16); - RGFW_events[RGFW_eventLen].keyCode = RGFW_apiKeyCodeToRGFW(e->keyCode); - RGFW_events[RGFW_eventLen].lockState = 0; - RGFW_eventLen++; - - RGFW_keyboard[RGFW_apiKeyCodeToRGFW(e->keyCode)].prev = RGFW_keyboard[RGFW_apiKeyCodeToRGFW(e->keyCode)].current; - RGFW_keyboard[RGFW_apiKeyCodeToRGFW(e->keyCode)].current = 0; - - RGFW_keyCallback(RGFW_root, RGFW_apiKeyCodeToRGFW(e->keyCode), RGFW_events[RGFW_eventLen].keyName, 0, 0); - - return EM_TRUE; -} - EM_BOOL Emscripten_on_resize(int eventType, const EmscriptenUiEvent* e, void* userData) { RGFW_UNUSED(eventType); RGFW_UNUSED(userData); @@ -8395,7 +8472,7 @@ EM_BOOL Emscripten_on_fullscreenchange(int eventType, const EmscriptenFullscreen RGFW_root->r = RGFW_RECT(0, 0, e->screenWidth, e->screenHeight); EM_ASM("Module.canvas.focus();"); - + if (fullscreen == RGFW_FALSE) { RGFW_root->r = RGFW_RECT(0, 0, ogRect.w, ogRect.h); // emscripten_request_fullscreen("#canvas", 0); @@ -8576,6 +8653,141 @@ EM_BOOL Emscripten_on_gamepad(int eventType, const EmscriptenGamepadEvent *gamep return 1; // The event was consumed by the callback handler } + +u32 RGFW_webasmPhysicalToRGFW(u32 hash) { + switch(hash) { /* 0x0000 */ + case 0x67243A2DU /* Escape */: return RGFW_Escape; /* 0x0001 */ + case 0x67251058U /* Digit0 */: return RGFW_0; /* 0x0002 */ + case 0x67251059U /* Digit1 */: return RGFW_1; /* 0x0003 */ + case 0x6725105AU /* Digit2 */: return RGFW_2; /* 0x0004 */ + case 0x6725105BU /* Digit3 */: return RGFW_3; /* 0x0005 */ + case 0x6725105CU /* Digit4 */: return RGFW_4; /* 0x0006 */ + case 0x6725105DU /* Digit5 */: return RGFW_5; /* 0x0007 */ + case 0x6725105EU /* Digit6 */: return RGFW_6; /* 0x0008 */ + case 0x6725105FU /* Digit7 */: return RGFW_7; /* 0x0009 */ + case 0x67251050U /* Digit8 */: return RGFW_8; /* 0x000A */ + case 0x67251051U /* Digit9 */: return RGFW_9; /* 0x000B */ + case 0x92E14DD3U /* Minus */: return RGFW_Minus; /* 0x000C */ + case 0x92E1FBACU /* Equal */: return RGFW_Equals; /* 0x000D */ + case 0x36BF1CB5U /* Backspace */: return RGFW_BackSpace; /* 0x000E */ + case 0x7B8E51E2U /* Tab */: return RGFW_Tab; /* 0x000F */ + case 0x2C595B51U /* KeyQ */: return RGFW_q; /* 0x0010 */ + case 0x2C595B57U /* KeyW */: return RGFW_w; /* 0x0011 */ + case 0x2C595B45U /* KeyE */: return RGFW_e; /* 0x0012 */ + case 0x2C595B52U /* KeyR */: return RGFW_r; /* 0x0013 */ + case 0x2C595B54U /* KeyT */: return RGFW_t; /* 0x0014 */ + case 0x2C595B59U /* KeyY */: return RGFW_y; /* 0x0015 */ + case 0x2C595B55U /* KeyU */: return RGFW_u; /* 0x0016 */ + case 0x2C595B4FU /* KeyO */: return RGFW_o; /* 0x0018 */ + case 0x2C595B50U /* KeyP */: return RGFW_p; /* 0x0019 */ + case 0x45D8158CU /* BracketLeft */: return RGFW_CloseBracket; /* 0x001A */ + case 0xDEEABF7CU /* BracketRight */: return RGFW_Bracket; /* 0x001B */ + case 0x92E1C5D2U /* Enter */: return RGFW_Return; /* 0x001C */ + case 0xE058958CU /* ControlLeft */: return RGFW_ControlL; /* 0x001D */ + case 0x2C595B41U /* KeyA */: return RGFW_a; /* 0x001E */ + case 0x2C595B53U /* KeyS */: return RGFW_s; /* 0x001F */ + case 0x2C595B44U /* KeyD */: return RGFW_d; /* 0x0020 */ + case 0x2C595B46U /* KeyF */: return RGFW_f; /* 0x0021 */ + case 0x2C595B47U /* KeyG */: return RGFW_g; /* 0x0022 */ + case 0x2C595B48U /* KeyH */: return RGFW_h; /* 0x0023 */ + case 0x2C595B4AU /* KeyJ */: return RGFW_j; /* 0x0024 */ + case 0x2C595B4BU /* KeyK */: return RGFW_k; /* 0x0025 */ + case 0x2C595B4CU /* KeyL */: return RGFW_l; /* 0x0026 */ + case 0x2707219EU /* Semicolon */: return RGFW_Semicolon; /* 0x0027 */ + case 0x92E0B58DU /* Quote */: return RGFW_Apostrophe; /* 0x0028 */ + case 0x36BF358DU /* Backquote */: return RGFW_Backtick; /* 0x0029 */ + case 0x26B1958CU /* ShiftLeft */: return RGFW_ShiftL; /* 0x002A */ + case 0x36BF2438U /* Backslash */: return RGFW_BackSlash; /* 0x002B */ + case 0x2C595B5AU /* KeyZ */: return RGFW_z; /* 0x002C */ + case 0x2C595B58U /* KeyX */: return RGFW_x; /* 0x002D */ + case 0x2C595B43U /* KeyC */: return RGFW_c; /* 0x002E */ + case 0x2C595B56U /* KeyV */: return RGFW_v; /* 0x002F */ + case 0x2C595B42U /* KeyB */: return RGFW_b; /* 0x0030 */ + case 0x2C595B4EU /* KeyN */: return RGFW_n; /* 0x0031 */ + case 0x2C595B4DU /* KeyM */: return RGFW_m; /* 0x0032 */ + case 0x92E1A1C1U /* Comma */: return RGFW_Comma; /* 0x0033 */ + case 0x672FFAD4U /* Period */: return RGFW_Period; /* 0x0034 */ + case 0x92E0A438U /* Slash */: return RGFW_Slash; /* 0x0035 */ + case 0xC5A6BF7CU /* ShiftRight */: return RGFW_ShiftR; + case 0x5D64DA91U /* NumpadMultiply */: return RGFW_Multiply; + case 0xC914958CU /* AltLeft */: return RGFW_AltL; /* 0x0038 */ + case 0x92E09CB5U /* Space */: return RGFW_Space; /* 0x0039 */ + case 0xB8FAE73BU /* CapsLock */: return RGFW_CapsLock; /* 0x003A */ + case 0x7174B789U /* F1 */: return RGFW_F1; /* 0x003B */ + case 0x7174B78AU /* F2 */: return RGFW_F2; /* 0x003C */ + case 0x7174B78BU /* F3 */: return RGFW_F3; /* 0x003D */ + case 0x7174B78CU /* F4 */: return RGFW_F4; /* 0x003E */ + case 0x7174B78DU /* F5 */: return RGFW_F5; /* 0x003F */ + case 0x7174B78EU /* F6 */: return RGFW_F6; /* 0x0040 */ + case 0x7174B78FU /* F7 */: return RGFW_F7; /* 0x0041 */ + case 0x7174B780U /* F8 */: return RGFW_F8; /* 0x0042 */ + case 0x7174B781U /* F9 */: return RGFW_F9; /* 0x0043 */ + case 0x7B8E57B0U /* F10 */: return RGFW_F10; /* 0x0044 */ + case 0xC925FCDFU /* Numpad7 */: return RGFW_Multiply; /* 0x0047 */ + case 0xC925FCD0U /* Numpad8 */: return RGFW_KP_8; /* 0x0048 */ + case 0xC925FCD1U /* Numpad9 */: return RGFW_KP_9; /* 0x0049 */ + case 0x5EA3E8A4U /* NumpadSubtract */: return RGFW_Minus; /* 0x004A */ + case 0xC925FCDCU /* Numpad4 */: return RGFW_KP_4; /* 0x004B */ + case 0xC925FCDDU /* Numpad5 */: return RGFW_KP_5; /* 0x004C */ + case 0xC925FCDEU /* Numpad6 */: return RGFW_KP_6; /* 0x004D */ + case 0xC925FCD9U /* Numpad1 */: return RGFW_KP_1; /* 0x004F */ + case 0xC925FCDAU /* Numpad2 */: return RGFW_KP_2; /* 0x0050 */ + case 0xC925FCDBU /* Numpad3 */: return RGFW_KP_3; /* 0x0051 */ + case 0xC925FCD8U /* Numpad0 */: return RGFW_KP_0; /* 0x0052 */ + case 0x95852DACU /* NumpadDecimal */: return RGFW_KP_Period; /* 0x0053 */ + case 0x7B8E57B1U /* F11 */: return RGFW_F11; /* 0x0057 */ + case 0x7B8E57B2U /* F12 */: return RGFW_F12; /* 0x0058 */ + case 0x7393FBACU /* NumpadEqual */: return RGFW_KP_Return; + case 0xB88EBF7CU /* AltRight */: return RGFW_AltR; /* 0xE038 */ + case 0xC925873BU /* NumLock */: return RGFW_Numlock; /* 0xE045 */ + case 0x2C595F45U /* Home */: return RGFW_Home; /* 0xE047 */ + case 0xC91BB690U /* ArrowUp */: return RGFW_Up; /* 0xE048 */ + case 0x672F9210U /* PageUp */: return RGFW_PageUp; /* 0xE049 */ + case 0x3799258CU /* ArrowLeft */: return RGFW_Left; /* 0xE04B */ + case 0x4CE33F7CU /* ArrowRight */: return RGFW_Right; /* 0xE04D */ + case 0x7B8E55DCU /* End */: return RGFW_End; /* 0xE04F */ + case 0x3799379EU /* ArrowDown */: return RGFW_Down; /* 0xE050 */ + case 0xBA90179EU /* PageDown */: return RGFW_PageDown; /* 0xE051 */ + case 0x6723CB2CU /* Insert */: return RGFW_Insert; /* 0xE052 */ + case 0x6725C50DU /* Delete */: return RGFW_Delete; /* 0xE053 */ + case 0x6723658CU /* OSLeft */: return RGFW_SuperL; /* 0xE05B */ + case 0x39643F7CU /* MetaRight */: return RGFW_SuperR; /* 0xE05C */ + } + + return 0; +} + +void EMSCRIPTEN_KEEPALIVE RGFW_handleKeyEvent(char* key, char* code, b8 press) { + const char* iCode = code; + + u32 hash = 0; + while(*iCode) hash = ((hash ^ 0x7E057D79U) << 3) ^ (unsigned int)*iCode++; + + u32 physicalKey = RGFW_webasmPhysicalToRGFW(hash); + + u8 mappedKey = (u8)(*((u32*)key)); + + if (*((u16*)key) != mappedKey) { + mappedKey = 0; + if (*((u32*)key) == *((u32*)"Tab")) mappedKey = RGFW_Tab; + } + + RGFW_events[RGFW_eventLen].type = press ? RGFW_keyPressed : RGFW_keyReleased; + memcpy(RGFW_events[RGFW_eventLen].keyName, key, 16); + RGFW_events[RGFW_eventLen].key = physicalKey; + RGFW_events[RGFW_eventLen].keyChar = mappedKey; + RGFW_events[RGFW_eventLen].lockState = 0; + RGFW_eventLen++; + + RGFW_keyboard[physicalKey].prev = RGFW_keyboard[physicalKey].current; + RGFW_keyboard[physicalKey].current = 0; + + RGFW_keyCallback(RGFW_root, physicalKey, mappedKey, RGFW_events[RGFW_eventLen].keyName, 0, press); + + free(key); + free(code); +} + void EMSCRIPTEN_KEEPALIVE Emscripten_onDrop(size_t count) { if (!(RGFW_root->_winArgs & RGFW_ALLOW_DND)) return; @@ -8694,8 +8906,6 @@ RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, u16 args) { emscripten_set_window_title(name); /* load callbacks */ - emscripten_set_keydown_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, EM_FALSE, Emscripten_on_keydown); - emscripten_set_keyup_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, EM_FALSE, Emscripten_on_keyup); emscripten_set_resize_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, EM_FALSE, Emscripten_on_resize); emscripten_set_fullscreenchange_callback(EMSCRIPTEN_EVENT_TARGET_DOCUMENT, NULL, EM_FALSE, Emscripten_on_fullscreenchange); emscripten_set_mousemove_callback("#canvas", NULL, EM_FALSE, Emscripten_on_mousemove); @@ -8715,6 +8925,22 @@ RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, u16 args) { win->_winArgs |= RGFW_ALLOW_DND; } + EM_ASM({ + window.addEventListener("keydown", + (event) => { + Module._RGFW_handleKeyEvent(stringToNewUTF8(event.key), stringToNewUTF8(event.code), 1); + }, true, + ); + }); + + EM_ASM({ + window.addEventListener("keyup", + (event) => { + Module._RGFW_handleKeyEvent(stringToNewUTF8(event.key), stringToNewUTF8(event.code), 0); + }, true, + ); + }); + EM_ASM({ var canvas = document.getElementById('canvas'); canvas.addEventListener('drop', function(e) { @@ -8778,6 +9004,10 @@ RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, u16 args) { RGFW_window_resize(win, RGFW_getScreenSize()); } + #ifdef RGFW_DEBUG + printf("RGFW INFO: a window with a rect of {%i, %i, %i, %i} \n", win->r.x, win->r.y, win->r.w, win->r.h); + #endif + return win; } @@ -9099,6 +9329,8 @@ RGFW_monitor RGFW_window_getMonitor(RGFW_window* win) { RGFW_UNUSED(win) return void RGFW_joinThread(RGFW_thread thread) { pthread_join((pthread_t) thread, NULL); } #ifdef __linux__ void RGFW_setThreadPriority(RGFW_thread thread, u8 priority) { pthread_setschedprio((pthread_t)thread, priority); } +#else + void RGFW_setThreadPriority(RGFW_thread thread, u8 priority) { RGFW_UNUSED(thread); RGFW_UNUSED(priority); } #endif #endif diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index a74af2074..ca756361a 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -129,7 +129,8 @@ static bool RGFW_disableCursor = false; static const unsigned short keyMappingRGFW[] = { [RGFW_KEY_NULL] = KEY_NULL, [RGFW_Return] = KEY_ENTER, - [RGFW_Quote] = KEY_APOSTROPHE, + [RGFW_Return] = KEY_ENTER, + [RGFW_Apostrophe] = KEY_APOSTROPHE, [RGFW_Comma] = KEY_COMMA, [RGFW_Minus] = KEY_MINUS, [RGFW_Period] = KEY_PERIOD, @@ -817,59 +818,6 @@ const char *GetKeyName(int key) static KeyboardKey ConvertScancodeToKey(u32 keycode); -// TODO: Review function to avoid duplicate with RSGL -char RSGL_keystrToChar(const char *str) -{ - if (str[1] == 0) return str[0]; - - static const char *map[] = { - "asciitilde", "`", - "grave", "~", - "exclam", "!", - "at", "@", - "numbersign", "#", - "dollar", "$", - "percent", "%%", - "asciicircum", "^", - "ampersand", "&", - "asterisk", "*", - "parenleft", "(", - "parenright", ")", - "underscore", "_", - "minus", "-", - "plus", "+", - "equal", "=", - "braceleft", "{", - "bracketleft", "[", - "bracketright", "]", - "braceright", "}", - "colon", ":", - "semicolon", ";", - "quotedbl", "\"", - "apostrophe", "'", - "bar", "|", - "backslash", "\'", - "less", "<", - "comma", ",", - "greater", ">", - "period", ".", - "question", "?", - "slash", "/", - "space", " ", - "Return", "\n", - "Enter", "\n", - "enter", "\n", - }; - - for (unsigned char i = 0; i < (sizeof(map)/sizeof(char *)); i += 2) - { - if (strcmp(map[i], str) == 0) return *map[i + 1]; - } - - return '\0'; -} - -// Gamepad buttons conversion table int RGFW_gpConvTable[18] = { [RGFW_GP_Y] = GAMEPAD_BUTTON_RIGHT_FACE_UP, [RGFW_GP_B] = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, @@ -1025,7 +973,7 @@ void PollInputEvents(void) // Keyboard events case RGFW_keyPressed: { - KeyboardKey key = ConvertScancodeToKey(event->keyCode); + KeyboardKey key = ConvertScancodeToKey(event->key); if (key != KEY_NULL) { // If key was up, add it to the key pressed queue @@ -1049,13 +997,13 @@ void PollInputEvents(void) if (CORE.Input.Keyboard.charPressedQueueCount < MAX_CHAR_PRESSED_QUEUE) { // Add character (codepoint) to the queue - CORE.Input.Keyboard.charPressedQueue[CORE.Input.Keyboard.charPressedQueueCount] = RSGL_keystrToChar(event->keyName); + CORE.Input.Keyboard.charPressedQueue[CORE.Input.Keyboard.charPressedQueueCount] = event->keyChar; CORE.Input.Keyboard.charPressedQueueCount++; } } break; case RGFW_keyReleased: { - KeyboardKey key = ConvertScancodeToKey(event->keyCode); + KeyboardKey key = ConvertScancodeToKey(event->key); if (key != KEY_NULL) CORE.Input.Keyboard.currentKeyState[key] = 0; } break; @@ -1066,7 +1014,7 @@ void PollInputEvents(void) { CORE.Input.Mouse.currentWheelMove.y = event->scroll; break; - } + } else CORE.Input.Mouse.currentWheelMove.y = 0; int btn = event->button; if (btn == RGFW_mouseLeft) btn = 1; @@ -1084,7 +1032,7 @@ void PollInputEvents(void) { CORE.Input.Mouse.currentWheelMove.y = event->scroll; break; - } + } else CORE.Input.Mouse.currentWheelMove.y = 0; int btn = event->button; if (btn == RGFW_mouseLeft) btn = 1; @@ -1303,7 +1251,7 @@ int InitPlatform(void) #ifdef RGFW_X11 for (int i = 0; (i < 4) && (i < MAX_GAMEPADS); i++) { - RGFW_registergamepad(platform.window, i); + RGFW_registerGamepad(platform.window, i); } #endif From b07967993f6b13d5edb02c596cde652a3db139a1 Mon Sep 17 00:00:00 2001 From: Antonis Geralis <43617260+planetis-m@users.noreply.github.com> Date: Wed, 25 Dec 2024 23:08:42 +0200 Subject: [PATCH 146/194] Update version number for the nim wrapper (#4638) --- BINDINGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 5e93a076a..8f5c86f96 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -50,7 +50,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylib-matte](https://github.com/jcorks/raylib-matte) | 4.6-dev | [Matte](https://github.com/jcorks/matte) | **???** | | [Raylib.nelua](https://github.com/AuzFox/Raylib.nelua) | **5.0** | [nelua](https://nelua.io) | Zlib | | [raylib-bindings](https://github.com/vaiorabbit/raylib-bindings) | 5.6-dev | [Ruby](https://www.ruby-lang.org/en) | Zlib | -| [naylib](https://github.com/planetis-m/naylib) | **5.1-dev** | [Nim](https://nim-lang.org) | MIT | +| [naylib](https://github.com/planetis-m/naylib) | **5.6-dev** | [Nim](https://nim-lang.org) | MIT | | [node-raylib](https://github.com/RobLoach/node-raylib) | 4.5 | [Node.js](https://nodejs.org/en) | Zlib | | [raylib-odin](https://github.com/odin-lang/Odin/tree/master/vendor/raylib) | **5.5** | [Odin](https://odin-lang.org) | BSD-3Clause | | [raylib_odin_bindings](https://github.com/Deathbat2190/raylib_odin_bindings) | 4.0-dev | [Odin](https://odin-lang.org) | MIT | From 51b9a0acfc8fe16f7487ee058f1fa9ee4b99bd26 Mon Sep 17 00:00:00 2001 From: Bot Randomness <114881271+BotRandomness@users.noreply.github.com> Date: Thu, 26 Dec 2024 12:55:38 -0500 Subject: [PATCH 147/194] Updated BINDINGS.md for Ruby (#4639) Added a Ruby binding known as raylib-ruby on 4.5. (https://github.com/wilsonsilva/raylib-ruby) --- BINDINGS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BINDINGS.md b/BINDINGS.md index 8f5c86f96..3bc235b76 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -69,6 +69,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers | [raylibr](https://github.com/jeroenjanssens/raylibr) | 4.0 | [R](https://www.r-project.org) | MIT | | [raylib-ffi](https://github.com/ewpratten/raylib-ffi) | 5.5 | [Rust](https://www.rust-lang.org) | GPLv3 | | [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.5** | [Rust](https://www.rust-lang.org) | Zlib | +| [raylib-ruby](https://github.com/wilsonsilva/raylib-ruby) | 4.5 | [Ruby](https://www.ruby-lang.org) | Zlib | | [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** | | [racket-raylib](https://github.com/eutro/racket-raylib) | 4.0 | [Racket](https://racket-lang.org) | MIT/Apache-2.0 | | [raylib-swift](https://github.com/STREGAsGate/Raylib) | 4.0 | [Swift](https://swift.org) | MIT | From 47588678156e6533eed5f1ca1d2d7779666819f0 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Thu, 26 Dec 2024 15:02:57 -0300 Subject: [PATCH 148/194] [rcore] [SDL2] Add implementation for `FLAG_WINDOW_ALWAYS_RUN` (#4598) * Enable FLAG_WINDOW_ALWAYS_RUN by default on PLATFORM_DESKTOP_GLFW * Revert enabling FLAG_WINDOW_ALWAYS_RUN by default on PLATFORM_DESKTOP_GLFW * Add implementation for FLAG_WINDOW_ALWAYS_RUN on PLATFORM_DESKTOP_SDL * Add reset for GetFrameTime() --- src/platforms/rcore_desktop_glfw.c | 7 ++++++- src/platforms/rcore_desktop_sdl.c | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index cb61f7d81..ac419ea7b 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1739,7 +1739,12 @@ static void WindowContentScaleCallback(GLFWwindow *window, float scalex, float s static void WindowIconifyCallback(GLFWwindow *window, int iconified) { if (iconified) CORE.Window.flags |= FLAG_WINDOW_MINIMIZED; // The window was iconified - else CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // The window was restored + else + { + CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // The window was restored + + if ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0) CORE.Time.previous = GetTime(); + } } // GLFW3 WindowMaximize Callback, runs when window is maximized/restored diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 3d1ac0bf3..5d316df50 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -571,7 +571,7 @@ void SetWindowState(unsigned int flags) } if (flags & FLAG_WINDOW_ALWAYS_RUN) { - TRACELOG(LOG_WARNING, "SetWindowState() - FLAG_WINDOW_ALWAYS_RUN is not supported on PLATFORM_DESKTOP_SDL"); + CORE.Window.flags |= FLAG_WINDOW_ALWAYS_RUN; } if (flags & FLAG_WINDOW_TRANSPARENT) { @@ -658,7 +658,7 @@ void ClearWindowState(unsigned int flags) } if (flags & FLAG_WINDOW_ALWAYS_RUN) { - TRACELOG(LOG_WARNING, "ClearWindowState() - FLAG_WINDOW_ALWAYS_RUN is not supported on PLATFORM_DESKTOP_SDL"); + CORE.Window.flags &= ~FLAG_WINDOW_ALWAYS_RUN; } if (flags & FLAG_WINDOW_TRANSPARENT) { @@ -1378,6 +1378,8 @@ void PollInputEvents(void) CORE.Window.resizedLastFrame = false; + if (((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) && ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0)) SDL_WaitEvent(NULL); + SDL_Event event = { 0 }; while (SDL_PollEvent(&event) != 0) { @@ -1497,6 +1499,8 @@ void PollInputEvents(void) if ((CORE.Window.flags & SDL_WINDOW_MAXIMIZED) > 0) CORE.Window.flags &= ~SDL_WINDOW_MAXIMIZED; } #endif + + if ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0) CORE.Time.previous = GetTime(); } break; case SDL_WINDOWEVENT_HIDDEN: From 7ecc47d12e5f4c322af3d16615a08ba9bc47c4c2 Mon Sep 17 00:00:00 2001 From: Mario Nachbaur Date: Thu, 26 Dec 2024 20:12:53 +0100 Subject: [PATCH 149/194] Fix `IsWindowFocused()` on web. (#4640) --- src/platforms/rcore_web.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index d28ed55c2..996e7daf5 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -133,6 +133,7 @@ static void CursorEnterCallback(GLFWwindow *window, int enter); static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *event, void *userData); // static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUiEvent *event, void *userData); static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *event, void *userData); +static EM_BOOL EmscriptenFocusCallback(int eventType, const EmscriptenFocusEvent *focusEvent, void *userData); // Emscripten input callback events static EM_BOOL EmscriptenMouseMoveCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData); @@ -1369,6 +1370,10 @@ int InitPlatform(void) // Support gamepad events (not provided by GLFW3 on emscripten) emscripten_set_gamepadconnected_callback(NULL, 1, EmscriptenGamepadCallback); emscripten_set_gamepaddisconnected_callback(NULL, 1, EmscriptenGamepadCallback); + + // Support focus events + emscripten_set_blur_callback("#canvas", platform.handle, 1, EmscriptenFocusCallback); + emscripten_set_focus_callback("#canvas", platform.handle, 1, EmscriptenFocusCallback); //---------------------------------------------------------------------------- // Initialize timing system @@ -1732,6 +1737,18 @@ static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadE return 1; // The event was consumed by the callback handler } +static EM_BOOL EmscriptenFocusCallback(int eventType, const EmscriptenFocusEvent *focusEvent, void *userData) +{ + EM_BOOL consumed = 1; + switch (eventType) + { + case EMSCRIPTEN_EVENT_BLUR: WindowFocusCallback(userData, 0); break; + case EMSCRIPTEN_EVENT_FOCUS: WindowFocusCallback(userData, 1); break; + default: consumed = 0; break; + } + return consumed; +} + // Register touch input events static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) { From e062dc085c164c3e89eb928ec91278f08c2f4ccf Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Sat, 28 Dec 2024 06:56:04 -0800 Subject: [PATCH 150/194] Add filters and platform files so they show up in MSVC for ease of editing (#4644) --- projects/VS2022/raylib/raylib.vcxproj | 70 ++++++++++ projects/VS2022/raylib/raylib.vcxproj.filters | 120 ++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 projects/VS2022/raylib/raylib.vcxproj.filters diff --git a/projects/VS2022/raylib/raylib.vcxproj b/projects/VS2022/raylib/raylib.vcxproj index 0c03027a4..347ff5d11 100644 --- a/projects/VS2022/raylib/raylib.vcxproj +++ b/projects/VS2022/raylib/raylib.vcxproj @@ -302,6 +302,76 @@ + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + diff --git a/projects/VS2022/raylib/raylib.vcxproj.filters b/projects/VS2022/raylib/raylib.vcxproj.filters new file mode 100644 index 000000000..182358229 --- /dev/null +++ b/projects/VS2022/raylib/raylib.vcxproj.filters @@ -0,0 +1,120 @@ + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\Platform Files + + + Source Files\Platform Files + + + Source Files\Platform Files + + + Source Files\Platform Files + + + Source Files\Platform Files + + + Source Files\Platform Files + + + Source Files\Platform Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + + + {88e8d1f8-5c93-4f9e-a856-819a1f82a387} + + + {cba93591-3674-4384-9325-bc0ae2d72b9b} + + + {d18433d7-0e5c-40d7-a39d-e0f11f80d183} + + + \ No newline at end of file From 75b6b825dfc93488bc411c00845164b5c0f8fae6 Mon Sep 17 00:00:00 2001 From: Johannes <59510166+Joonsey@users.noreply.github.com> Date: Sat, 28 Dec 2024 15:57:10 +0100 Subject: [PATCH 151/194] using addCMacro instead of defineCMacro (#4620) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Johannes Rønning --- build.zig | 24 ++++++++++++------------ examples/build.zig | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build.zig b/build.zig index 66e8fab4f..0f6f29755 100644 --- a/build.zig +++ b/build.zig @@ -13,9 +13,9 @@ comptime { fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void { switch (platform) { - .glfw => raylib.defineCMacro("PLATFORM_DESKTOP_GLFW", null), - .rgfw => raylib.defineCMacro("PLATFORM_DESKTOP_RGFW", null), - .sdl => raylib.defineCMacro("PLATFORM_DESKTOP_SDL", null), + .glfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_GLFW", ""), + .rgfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_RGFW", ""), + .sdl => raylib.root_module.addCMacro("PLATFORM_DESKTOP_SDL", ""), else => {}, } } @@ -173,7 +173,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. } if (options.opengl_version != .auto) { - raylib.defineCMacro(options.opengl_version.toCMacroStr(), null); + raylib.root_module.addCMacro(options.opengl_version.toCMacroStr(), ""); } raylib.addIncludePath(b.path("src/platforms")); @@ -191,7 +191,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. try c_source_files.append("src/rglfw.c"); if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) { - raylib.defineCMacro("_GLFW_X11", null); + raylib.root_module.addCMacro("_GLFW_X11", ""); raylib.linkSystemLibrary("GLX"); raylib.linkSystemLibrary("X11"); raylib.linkSystemLibrary("Xcursor"); @@ -211,7 +211,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. , .{}); @panic("`wayland-scanner` not found"); }; - raylib.defineCMacro("_GLFW_WAYLAND", null); + raylib.root_module.addCMacro("_GLFW_WAYLAND", ""); raylib.linkSystemLibrary("EGL"); raylib.linkSystemLibrary("wayland-client"); raylib.linkSystemLibrary("xkbcommon"); @@ -230,16 +230,16 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. } else { if (options.opengl_version == .auto) { raylib.linkSystemLibrary("GLESv2"); - raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); + raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", ""); } raylib.linkSystemLibrary("EGL"); raylib.linkSystemLibrary("gbm"); raylib.linkSystemLibrary2("libdrm", .{ .use_pkg_config = .force }); - raylib.defineCMacro("PLATFORM_DRM", null); - raylib.defineCMacro("EGL_NO_X11", null); - raylib.defineCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "2048"); + raylib.root_module.addCMacro("PLATFORM_DRM", ""); + raylib.root_module.addCMacro("EGL_NO_X11", ""); + raylib.root_module.addCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", ""); } }, .freebsd, .openbsd, .netbsd, .dragonfly => { @@ -290,9 +290,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. raylib.addIncludePath(dep.path("upstream/emscripten/cache/sysroot/include")); } - raylib.defineCMacro("PLATFORM_WEB", null); + raylib.root_module.addCMacro("PLATFORM_WEB", ""); if (options.opengl_version == .auto) { - raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); + raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", ""); } }, else => { diff --git a/examples/build.zig b/examples/build.zig index df0cdf8c1..301381df3 100644 --- a/examples/build.zig +++ b/examples/build.zig @@ -46,7 +46,7 @@ fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.Reso exe.linkSystemLibrary("gdi32"); exe.linkSystemLibrary("opengl32"); - exe.defineCMacro("PLATFORM_DESKTOP", null); + exe.root_module.addCMacro("PLATFORM_DESKTOP", ""); }, .linux => { exe.linkSystemLibrary("GL"); @@ -55,7 +55,7 @@ fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.Reso exe.linkSystemLibrary("m"); exe.linkSystemLibrary("X11"); - exe.defineCMacro("PLATFORM_DESKTOP", null); + exe.root_module.addCMacro("PLATFORM_DESKTOP", ""); }, .macos => { exe.linkFramework("Foundation"); @@ -65,7 +65,7 @@ fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.Reso exe.linkFramework("CoreVideo"); exe.linkFramework("IOKit"); - exe.defineCMacro("PLATFORM_DESKTOP", null); + exe.root_module.addCMacro("PLATFORM_DESKTOP", ""); }, else => { @panic("Unsupported OS"); From 5b822585e5aa31baf1d11e572f9fe7ef1fafc2ba Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Sat, 28 Dec 2024 11:59:05 -0300 Subject: [PATCH 152/194] [rcore] [GLFW] [SDL2] Updates `CORE.Window.eventWaiting` and `FLAG_WINDOW_ALWAYS_RUN` handling (#4642) * Add implementation for CORE.Window.eventWaiting on PLATFORM_DESKTOP_SDL * Optimize GetFrameTime() reset * Optimize FLAG_WINDOW_ALWAYS_RUN and GetFrameTime() reset for PLATFORM_DESKTOP_GLFW --- src/platforms/rcore_desktop_glfw.c | 16 ++++++---------- src/platforms/rcore_desktop_sdl.c | 8 +++++--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index ac419ea7b..c2a43be11 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1248,12 +1248,13 @@ void PollInputEvents(void) CORE.Window.resizedLastFrame = false; - if (CORE.Window.eventWaiting) glfwWaitEvents(); // Wait for in input events before continue (drawing is paused) + if ((CORE.Window.eventWaiting) || (IsWindowState(FLAG_WINDOW_MINIMIZED) && !IsWindowState(FLAG_WINDOW_ALWAYS_RUN))) + { + glfwWaitEvents(); // Wait for in input events before continue (drawing is paused) + CORE.Time.previous = GetTime(); + } else glfwPollEvents(); // Poll input events: keyboard/mouse/window events (callbacks) -> Update keys state - // While window minimized, stop loop execution - while (IsWindowState(FLAG_WINDOW_MINIMIZED) && !IsWindowState(FLAG_WINDOW_ALWAYS_RUN)) glfwWaitEvents(); - CORE.Window.shouldClose = glfwWindowShouldClose(platform.handle); // Reset close status for next frame @@ -1739,12 +1740,7 @@ static void WindowContentScaleCallback(GLFWwindow *window, float scalex, float s static void WindowIconifyCallback(GLFWwindow *window, int iconified) { if (iconified) CORE.Window.flags |= FLAG_WINDOW_MINIMIZED; // The window was iconified - else - { - CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // The window was restored - - if ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0) CORE.Time.previous = GetTime(); - } + else CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // The window was restored } // GLFW3 WindowMaximize Callback, runs when window is maximized/restored diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 5d316df50..c5ff97cf0 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1378,7 +1378,11 @@ void PollInputEvents(void) CORE.Window.resizedLastFrame = false; - if (((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) && ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0)) SDL_WaitEvent(NULL); + if ((CORE.Window.eventWaiting) || (((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) && ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0))) + { + SDL_WaitEvent(NULL); + CORE.Time.previous = GetTime(); + } SDL_Event event = { 0 }; while (SDL_PollEvent(&event) != 0) @@ -1499,8 +1503,6 @@ void PollInputEvents(void) if ((CORE.Window.flags & SDL_WINDOW_MAXIMIZED) > 0) CORE.Window.flags &= ~SDL_WINDOW_MAXIMIZED; } #endif - - if ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0) CORE.Time.previous = GetTime(); } break; case SDL_WINDOWEVENT_HIDDEN: From c0f2067dbadecbc0130acb08f931361ebaed4d54 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 28 Dec 2024 16:35:42 +0100 Subject: [PATCH 153/194] REVIEWED: `LoadShaderFromMemory()`, use default locations for default shader #4641 --- src/rcore.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 5ba24a5b8..17634a52c 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1326,9 +1326,10 @@ Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode) shader.id = rlLoadShaderCode(vsCode, fsCode); - // After shader loading, we TRY to set default location names - if (shader.id > 0) + if (shader.id == rlGetShaderIdDefault()) shader.locs = rlGetShaderLocsDefault(); + else if (shader.id > 0) { + // After custom shader loading, we TRY to set default location names // Default shader attribute locations have been binded before linking: // vertex position location = 0 // vertex texcoord location = 1 From f355d6f1db7d39b983d3a3fa06f9d29447dcc382 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Sat, 28 Dec 2024 16:07:52 -0800 Subject: [PATCH 154/194] Transform the vertex normals by the animated matrix (#4646) --- .../models/resources/shaders/glsl330/skinning.vs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/models/resources/shaders/glsl330/skinning.vs b/examples/models/resources/shaders/glsl330/skinning.vs index 73ecca51e..43bbca76c 100644 --- a/examples/models/resources/shaders/glsl330/skinning.vs +++ b/examples/models/resources/shaders/glsl330/skinning.vs @@ -6,16 +6,19 @@ in vec3 vertexPosition; in vec2 vertexTexCoord; in vec4 vertexColor; +in vec3 vertexNormal; in vec4 vertexBoneIds; in vec4 vertexBoneWeights; // Input uniform values uniform mat4 mvp; +uniform mat4 matNormal; uniform mat4 boneMatrices[MAX_BONE_NUM]; // Output vertex attributes (to fragment shader) out vec2 fragTexCoord; out vec4 fragColor; +out vec3 fragNormal; void main() { @@ -29,9 +32,18 @@ void main() vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexPosition, 1.0)) + vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexPosition, 1.0)) + vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexPosition, 1.0)); - + + vec4 skinnedNormal = + vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexNormal, 0.0)) + + vertexBoneWeights.y*(boneMatrices[boneIndex1]*vec4(vertexNormal, 0.0)) + + vertexBoneWeights.z*(boneMatrices[boneIndex2]*vec4(vertexNormal, 0.0)) + + vertexBoneWeights.w*(boneMatrices[boneIndex3]*vec4(vertexNormal, 0.0)); + skinnedNormal.w = 0.0; + fragTexCoord = vertexTexCoord; fragColor = vertexColor; + fragNormal = normalize(vec3(matNormal*skinnedNormal)); + gl_Position = mvp*skinnedPosition; } \ No newline at end of file From d1315e8a0429e9b43b80b705199d5fec4ee5a83b Mon Sep 17 00:00:00 2001 From: Peter Zmanovsky <48548636+peter15914@users.noreply.github.com> Date: Mon, 30 Dec 2024 01:06:40 +0500 Subject: [PATCH 155/194] [rmodels] Fix leaks in LoadIQM() and LoadModelAnimationsIQM() (#4649) Add calls to UnloadFileData() before return in cases of invalid IQM file. --- src/rmodels.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index c62267de4..70e461ea5 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4570,12 +4570,14 @@ static Model LoadIQM(const char *fileName) if (memcmp(iqmHeader->magic, IQM_MAGIC, sizeof(IQM_MAGIC)) != 0) { TRACELOG(LOG_WARNING, "MODEL: [%s] IQM file is not a valid model", fileName); + UnloadFileData(fileData); return model; } if (iqmHeader->version != IQM_VERSION) { TRACELOG(LOG_WARNING, "MODEL: [%s] IQM file version not supported (%i)", fileName, iqmHeader->version); + UnloadFileData(fileData); return model; } @@ -4891,12 +4893,14 @@ static ModelAnimation *LoadModelAnimationsIQM(const char *fileName, int *animCou if (memcmp(iqmHeader->magic, IQM_MAGIC, sizeof(IQM_MAGIC)) != 0) { TRACELOG(LOG_WARNING, "MODEL: [%s] IQM file is not a valid model", fileName); + UnloadFileData(fileData); return NULL; } if (iqmHeader->version != IQM_VERSION) { TRACELOG(LOG_WARNING, "MODEL: [%s] IQM file version not supported (%i)", fileName, iqmHeader->version); + UnloadFileData(fileData); return NULL; } From fa0eada61a1131a7413df9139ead6d018b169f22 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 1 Jan 2025 00:02:52 +0100 Subject: [PATCH 156/194] Update year to 2025 --- LICENSE | 2 +- examples/Makefile | 2 +- examples/Makefile.Android | 2 +- examples/Makefile.Web | 2 +- examples/examples.rc | 2 +- parser/LICENSE | 2 +- parser/README.md | 2 +- parser/raylib_parser.c | 4 ++-- projects/VSCode/main.c | 2 +- src/Makefile | 2 +- src/config.h | 2 +- src/platforms/rcore_android.c | 2 +- src/platforms/rcore_desktop_glfw.c | 2 +- src/platforms/rcore_desktop_rgfw.c | 2 +- src/platforms/rcore_desktop_sdl.c | 2 +- src/platforms/rcore_drm.c | 2 +- src/platforms/rcore_template.c | 2 +- src/platforms/rcore_web.c | 2 +- src/raudio.c | 4 ++-- src/raylib.dll.rc | 2 +- src/raylib.dll.rc.data | Bin 11318 -> 7742 bytes src/raylib.h | 2 +- src/raylib.rc | 2 +- src/raylib.rc.data | Bin 11302 -> 7726 bytes src/raymath.h | 2 +- src/rcamera.h | 2 +- src/rcore.c | 4 ++-- src/rgestures.h | 2 +- src/rglfw.c | 2 +- src/rlgl.h | 2 +- src/rmodels.c | 4 ++-- src/rshapes.c | 2 +- src/rtext.c | 4 ++-- src/rtextures.c | 4 ++-- src/utils.c | 4 ++-- src/utils.h | 2 +- 36 files changed, 41 insertions(+), 41 deletions(-) diff --git a/LICENSE b/LICENSE index d1bfe3b1a..e96f876a2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) This software is provided "as-is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. diff --git a/examples/Makefile b/examples/Makefile index c02cad434..12d798b50 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -30,7 +30,7 @@ # > PLATFORM_ANDROID: # - Android (ARM, ARM64) # -# Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +# Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) # # This software is provided "as-is", without any express or implied warranty. In no event # will the authors be held liable for any damages arising from the use of this software. diff --git a/examples/Makefile.Android b/examples/Makefile.Android index 01d88fa49..c00da171e 100644 --- a/examples/Makefile.Android +++ b/examples/Makefile.Android @@ -2,7 +2,7 @@ # # raylib makefile for Android project (APK building) # -# Copyright (c) 2017-2024 Ramon Santamaria (@raysan5) +# Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) # # This software is provided "as-is", without any express or implied warranty. In no event # will the authors be held liable for any damages arising from the use of this software. diff --git a/examples/Makefile.Web b/examples/Makefile.Web index a4470e09f..90345f97d 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -2,7 +2,7 @@ # # raylib makefile for Web platform # -# Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +# Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) # # This software is provided "as-is", without any express or implied warranty. In no event # will the authors be held liable for any damages arising from the use of this software. diff --git a/examples/examples.rc b/examples/examples.rc index 4767ad480..e5024b731 100644 --- a/examples/examples.rc +++ b/examples/examples.rc @@ -13,7 +13,7 @@ BEGIN VALUE "FileDescription", "raylib example" VALUE "FileVersion", "1.0" VALUE "InternalName", "raylib-example" - VALUE "LegalCopyright", "(c) 2024 raylib technologies (@raylibtech)" + VALUE "LegalCopyright", "(c) 2025 raylib technologies (@raylibtech)" //VALUE "OriginalFilename", "raylib_app.exe" VALUE "ProductName", "raylib-example" VALUE "ProductVersion", "1.0" diff --git a/parser/LICENSE b/parser/LICENSE index 7fc2d13b0..7ed4b8722 100644 --- a/parser/LICENSE +++ b/parser/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2021-2024 Ramon Santamaria (@raysan5) +Copyright (c) 2021-2025 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. diff --git a/parser/README.md b/parser/README.md index 6616cdc51..86cdfdd5b 100644 --- a/parser/README.md +++ b/parser/README.md @@ -19,7 +19,7 @@ Check `raylib_parser.c` for details about those structs. // // // more info and bugs-report: github.com/raysan5/raylib/parser // // // -// Copyright (c) 2021-2024 Ramon Santamaria (@raysan5) // +// Copyright (c) 2021-2025 Ramon Santamaria (@raysan5) // // // ////////////////////////////////////////////////////////////////////////////////// diff --git a/parser/raylib_parser.c b/parser/raylib_parser.c index 94a715562..82e22f195 100644 --- a/parser/raylib_parser.c +++ b/parser/raylib_parser.c @@ -54,7 +54,7 @@ raylib-parser 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) 2021-2024 Ramon Santamaria (@raysan5) + Copyright (c) 2021-2025 Ramon Santamaria (@raysan5) **********************************************************************************************/ @@ -1084,7 +1084,7 @@ static void ShowCommandLineInfo(void) printf("// //\n"); printf("// more info and bugs-report: github.com/raysan5/raylib/parser //\n"); printf("// //\n"); - printf("// Copyright (c) 2021-2024 Ramon Santamaria (@raysan5) //\n"); + printf("// Copyright (c) 2021-2025 Ramon Santamaria (@raysan5) //\n"); printf("// //\n"); printf("//////////////////////////////////////////////////////////////////////////////////\n\n"); diff --git a/projects/VSCode/main.c b/projects/VSCode/main.c index 5a2e342bd..cad32c2ef 100644 --- a/projects/VSCode/main.c +++ b/projects/VSCode/main.c @@ -15,7 +15,7 @@ * This example has been created using raylib 1.0 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/src/Makefile b/src/Makefile index b5fa2ecff..37554b2a0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -33,7 +33,7 @@ # Many thanks to Milan Nikolic (@gen2brain) for implementing Android platform pipeline. # Many thanks to Emanuele Petriglia for his contribution on GNU/Linux pipeline. # -# Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +# Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) # # This software is provided "as-is", without any express or implied warranty. In no event # will the authors be held liable for any damages arising from the use of this software. diff --git a/src/config.h b/src/config.h index 74e0a1353..f7b015305 100644 --- a/src/config.h +++ b/src/config.h @@ -6,7 +6,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2018-2024 Ahmad Fatoum & Ramon Santamaria (@raysan5) +* Copyright (c) 2018-2025 Ahmad Fatoum & 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. diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index faa00c98b..96ea367dc 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -27,7 +27,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) and contributors +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) and contributors * * 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. diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index c2a43be11..bd2600c87 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -30,7 +30,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) and contributors +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) and contributors * * 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. diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index ca756361a..800f54658 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -29,7 +29,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5), Colleague Riley and contributors +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5), Colleague Riley and contributors * * 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. diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index c5ff97cf0..4b3327ee1 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -29,7 +29,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) and contributors +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) and contributors * * 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. diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index 09cb80556..36d255bc0 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -29,7 +29,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) and contributors +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) and contributors * * 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. diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index d7605950e..c532bf24f 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -27,7 +27,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) and contributors +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) and contributors * * 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. diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 996e7daf5..9fd2afb5a 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -26,7 +26,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) and contributors +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) and contributors * * 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. diff --git a/src/raudio.c b/src/raudio.c index cc596ec11..a143c5ff5 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -50,7 +50,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -1125,7 +1125,7 @@ bool ExportWaveAsCode(Wave wave, const char *fileName) byteCount += sprintf(txtData + byteCount, "// more info and bugs-report: github.com/raysan5/raylib //\n"); byteCount += sprintf(txtData + byteCount, "// feedback and support: ray[at]raylib.com //\n"); byteCount += sprintf(txtData + byteCount, "// //\n"); - byteCount += sprintf(txtData + byteCount, "// Copyright (c) 2018-2024 Ramon Santamaria (@raysan5) //\n"); + byteCount += sprintf(txtData + byteCount, "// Copyright (c) 2018-2025 Ramon Santamaria (@raysan5) //\n"); byteCount += sprintf(txtData + byteCount, "// //\n"); byteCount += sprintf(txtData + byteCount, "//////////////////////////////////////////////////////////////////////////////////\n\n"); diff --git a/src/raylib.dll.rc b/src/raylib.dll.rc index 2f02b495c..7ad39c76f 100644 --- a/src/raylib.dll.rc +++ b/src/raylib.dll.rc @@ -13,7 +13,7 @@ BEGIN VALUE "FileDescription", "raylib dynamic library (www.raylib.com)" VALUE "FileVersion", "5.5.0" VALUE "InternalName", "raylib.dll" - VALUE "LegalCopyright", "(c) 2024 Ramon Santamaria (@raysan5)" + VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria (@raysan5)" VALUE "OriginalFilename", "raylib.dll" VALUE "ProductName", "raylib" VALUE "ProductVersion", "5.5.0" diff --git a/src/raylib.dll.rc.data b/src/raylib.dll.rc.data index 64d2a1cd5708166afa50efa2611b82ee528088e0..db6b924a70a57a674f6ece692b44bac7e11eac6d 100644 GIT binary patch delta 6124 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 literal 11318 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 diff --git a/src/raylib.h b/src/raylib.h index 7e1a1f838..451091269 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -63,7 +63,7 @@ * 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-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. diff --git a/src/raylib.rc b/src/raylib.rc index 327b2c4de..7de8382bd 100644 --- a/src/raylib.rc +++ b/src/raylib.rc @@ -13,7 +13,7 @@ BEGIN VALUE "FileDescription", "raylib application (www.raylib.com)" VALUE "FileVersion", "5.5.0" VALUE "InternalName", "raylib" - VALUE "LegalCopyright", "(c) 2024 Ramon Santamaria (@raysan5)" + VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria (@raysan5)" VALUE "OriginalFilename", "raylib" VALUE "ProductName", "raylib app" VALUE "ProductVersion", "5.5.0" diff --git a/src/raylib.rc.data b/src/raylib.rc.data index ceeafa6822baa8ea52830c5c46ba6883212cc2f6..8727d21308057ce88f30f52cc39578fe8f733620 100644 GIT binary patch delta 6138 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 literal 11302 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 diff --git a/src/raymath.h b/src/raymath.h index 9d712027c..bee21b4f6 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -32,7 +32,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2015-2025 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. diff --git a/src/rcamera.h b/src/rcamera.h index ab998ae03..a598e1107 100644 --- a/src/rcamera.h +++ b/src/rcamera.h @@ -20,7 +20,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2022-2024 Christoph Wagner (@Crydsch) & Ramon Santamaria (@raysan5) +* Copyright (c) 2022-2025 Christoph Wagner (@Crydsch) & 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. diff --git a/src/rcore.c b/src/rcore.c index 17634a52c..2806235cc 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -70,7 +70,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) and contributors +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) and contributors * * 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. @@ -3000,7 +3000,7 @@ bool ExportAutomationEventList(AutomationEventList list, const char *fileName) byteCount += sprintf(txtData + byteCount, "# more info and bugs-report: github.com/raysan5/raylib\n"); byteCount += sprintf(txtData + byteCount, "# feedback and support: ray[at]raylib.com\n"); byteCount += sprintf(txtData + byteCount, "#\n"); - byteCount += sprintf(txtData + byteCount, "# Copyright (c) 2023-2024 Ramon Santamaria (@raysan5)\n"); + byteCount += sprintf(txtData + byteCount, "# Copyright (c) 2023-2025 Ramon Santamaria (@raysan5)\n"); byteCount += sprintf(txtData + byteCount, "#\n\n"); // Add events data diff --git a/src/rgestures.h b/src/rgestures.h index b5624be56..1bf4e0555 100644 --- a/src/rgestures.h +++ b/src/rgestures.h @@ -21,7 +21,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 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. diff --git a/src/rglfw.c b/src/rglfw.c index 2282955a1..b167955bc 100644 --- a/src/rglfw.c +++ b/src/rglfw.c @@ -7,7 +7,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2017-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2017-2025 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. diff --git a/src/rlgl.h b/src/rlgl.h index 5fd523b3c..0f3a203e7 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -88,7 +88,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 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. diff --git a/src/rmodels.c b/src/rmodels.c index 70e461ea5..ed0ce9136 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -21,7 +21,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -1960,7 +1960,7 @@ bool ExportMesh(Mesh mesh, const char *fileName) byteCount += sprintf(txtData + byteCount, "# // more info and bugs-report: github.com/raysan5/raylib //\n"); byteCount += sprintf(txtData + byteCount, "# // feedback and support: ray[at]raylib.com //\n"); byteCount += sprintf(txtData + byteCount, "# // //\n"); - byteCount += sprintf(txtData + byteCount, "# // Copyright (c) 2018-2024 Ramon Santamaria (@raysan5) //\n"); + byteCount += sprintf(txtData + byteCount, "# // Copyright (c) 2018-2025 Ramon Santamaria (@raysan5) //\n"); byteCount += sprintf(txtData + byteCount, "# // //\n"); byteCount += sprintf(txtData + byteCount, "# //////////////////////////////////////////////////////////////////////////////////\n\n"); byteCount += sprintf(txtData + byteCount, "# Vertex Count: %i\n", mesh.vertexCount); diff --git a/src/rshapes.c b/src/rshapes.c index ece5513b3..f0da73575 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -25,7 +25,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. diff --git a/src/rtext.c b/src/rtext.c index b60c8cb1d..12c25e4e6 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -34,7 +34,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -989,7 +989,7 @@ bool ExportFontAsCode(Font font, const char *fileName) byteCount += sprintf(txtData + byteCount, "// more info and bugs-report: github.com/raysan5/raylib //\n"); byteCount += sprintf(txtData + byteCount, "// feedback and support: ray[at]raylib.com //\n"); byteCount += sprintf(txtData + byteCount, "// //\n"); - byteCount += sprintf(txtData + byteCount, "// Copyright (c) 2018-2024 Ramon Santamaria (@raysan5) //\n"); + byteCount += sprintf(txtData + byteCount, "// Copyright (c) 2018-2025 Ramon Santamaria (@raysan5) //\n"); byteCount += sprintf(txtData + byteCount, "// //\n"); byteCount += sprintf(txtData + byteCount, "// ---------------------------------------------------------------------------------- //\n"); byteCount += sprintf(txtData + byteCount, "// //\n"); diff --git a/src/rtextures.c b/src/rtextures.c index e0ae5f4af..5248f1f4c 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -42,7 +42,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -761,7 +761,7 @@ bool ExportImageAsCode(Image image, const char *fileName) byteCount += sprintf(txtData + byteCount, "// more info and bugs-report: github.com/raysan5/raylib //\n"); byteCount += sprintf(txtData + byteCount, "// feedback and support: ray[at]raylib.com //\n"); byteCount += sprintf(txtData + byteCount, "// //\n"); - byteCount += sprintf(txtData + byteCount, "// Copyright (c) 2018-2024 Ramon Santamaria (@raysan5) //\n"); + byteCount += sprintf(txtData + byteCount, "// Copyright (c) 2018-2025 Ramon Santamaria (@raysan5) //\n"); byteCount += sprintf(txtData + byteCount, "// //\n"); byteCount += sprintf(txtData + byteCount, "////////////////////////////////////////////////////////////////////////////////////////\n\n"); diff --git a/src/utils.c b/src/utils.c index c5d9748d4..5c189845b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -10,7 +10,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 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. @@ -308,7 +308,7 @@ bool ExportDataAsCode(const unsigned char *data, int dataSize, const char *fileN byteCount += sprintf(txtData + byteCount, "// more info and bugs-report: github.com/raysan5/raylib //\n"); byteCount += sprintf(txtData + byteCount, "// feedback and support: ray[at]raylib.com //\n"); byteCount += sprintf(txtData + byteCount, "// //\n"); - byteCount += sprintf(txtData + byteCount, "// Copyright (c) 2022-2024 Ramon Santamaria (@raysan5) //\n"); + byteCount += sprintf(txtData + byteCount, "// Copyright (c) 2022-2025 Ramon Santamaria (@raysan5) //\n"); byteCount += sprintf(txtData + byteCount, "// //\n"); byteCount += sprintf(txtData + byteCount, "////////////////////////////////////////////////////////////////////////////////////////\n\n"); diff --git a/src/utils.h b/src/utils.h index 23eca8ee9..271d0d2c7 100644 --- a/src/utils.h +++ b/src/utils.h @@ -5,7 +5,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2014-2024 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2025 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. From 0f6e85a975f637e14b1fed3ff6022a0e0008e620 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Wed, 1 Jan 2025 11:18:11 +0000 Subject: [PATCH 157/194] [build] CMake: Don't build examples using audio if audio is disabled (#4652) --- examples/CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 64b6d7604..f77ece4c0 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -124,7 +124,21 @@ endif () # The rlgl_standalone example only targets desktop, without shared libraries. if (BUILD_SHARED_LIBS OR NOT ${PLATFORM} MATCHES "Desktop") list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c) +endif() +# The audio examples fail to link if raylib is built without raudio +if (NOT SUPPORT_MODULE_RAUDIO) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_mixed_processor.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_module_playing.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_music_stream.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_raw_stream.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_sound_loading.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_sound_multi.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio/audio_stream_effects.c) + + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/embedded_files_loading.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_sprite_button.c) + list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/textures/textures_sprite_explosion.c) endif() include_directories(BEFORE SYSTEM others/external/include) From 97fa3a73e82416fa7542dd50e8e96dd20a71d980 Mon Sep 17 00:00:00 2001 From: veins1 <19636663+veins1@users.noreply.github.com> Date: Fri, 3 Jan 2025 21:36:48 +0500 Subject: [PATCH 158/194] Fix: Alt-Tab not working in borderless fullscreen (#3865) (#4655) --- src/platforms/rcore_desktop_glfw.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index bd2600c87..0076ccb0d 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -223,11 +223,9 @@ void ToggleBorderlessWindowed(void) if (!wasOnFullscreen) CORE.Window.previousPosition = CORE.Window.position; CORE.Window.previousScreen = CORE.Window.screen; - // Set undecorated and topmost modes and flags + // Set undecorated flag glfwSetWindowAttrib(platform.handle, GLFW_DECORATED, GLFW_FALSE); CORE.Window.flags |= FLAG_WINDOW_UNDECORATED; - glfwSetWindowAttrib(platform.handle, GLFW_FLOATING, GLFW_TRUE); - CORE.Window.flags |= FLAG_WINDOW_TOPMOST; // Get monitor position and size int monitorPosX = 0; @@ -247,9 +245,7 @@ void ToggleBorderlessWindowed(void) } else { - // Remove topmost and undecorated modes and flags - glfwSetWindowAttrib(platform.handle, GLFW_FLOATING, GLFW_FALSE); - CORE.Window.flags &= ~FLAG_WINDOW_TOPMOST; + // Remove undecorated flag glfwSetWindowAttrib(platform.handle, GLFW_DECORATED, GLFW_TRUE); CORE.Window.flags &= ~FLAG_WINDOW_UNDECORATED; From 05c4d8a652e8b56932ffb87dbf8914bd82c19d22 Mon Sep 17 00:00:00 2001 From: Brian E <72316548+Brian-ED@users.noreply.github.com> Date: Sun, 5 Jan 2025 12:29:31 +0100 Subject: [PATCH 159/194] [rlgl.h] Fixed typo in top comment (#4658) "renderer" to "rendered" --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index 0f3a203e7..cb10fd7ab 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -10,7 +10,7 @@ * When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are * initialized on rlglInit() to accumulate vertex data * -* When an internal state change is required all the stored vertex data is renderer in batch, +* When an internal state change is required all the stored vertex data is rendered in batch, * additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch * * Some resources are also loaded for convenience, here the complete list: From 2f95e8382b7b5e93fa2c018510b917c166cb5db2 Mon Sep 17 00:00:00 2001 From: rexept <103546774+rexept@users.noreply.github.com> Date: Sun, 5 Jan 2025 04:30:06 -0700 Subject: [PATCH 160/194] typo fix (#4656) --- examples/core/core_3d_camera_split_screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/core/core_3d_camera_split_screen.c b/examples/core/core_3d_camera_split_screen.c index 5294e8949..313b64f65 100644 --- a/examples/core/core_3d_camera_split_screen.c +++ b/examples/core/core_3d_camera_split_screen.c @@ -63,7 +63,7 @@ int main(void) // 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 + // this moves things at 10 world units per second, regardless of the actual FPS float offsetThisFrame = 10.0f*GetFrameTime(); // Move Player1 forward and backwards (no turning) @@ -171,4 +171,4 @@ int main(void) //-------------------------------------------------------------------------------------- return 0; -} \ No newline at end of file +} From ad035edfacf18214b46a4739244e21b63db41ed1 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Sun, 5 Jan 2025 08:30:43 -0300 Subject: [PATCH 161/194] Fix camera initial position (#4657) --- src/platforms/rcore_desktop_glfw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 0076ccb0d..dba821ddd 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1017,6 +1017,9 @@ void EnableCursor(void) // Disables cursor (lock cursor) void DisableCursor(void) { + // Reset mouse position within the window area before disabling cursor + SetMousePosition(CORE.Window.screen.width, CORE.Window.screen.height); + glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_DISABLED); // Set cursor position in the middle From fc29bc27fd1c6904143fc24fbcf5ca629ec491c6 Mon Sep 17 00:00:00 2001 From: Maicon Santana Date: Mon, 6 Jan 2025 10:29:24 +0000 Subject: [PATCH 162/194] Fix Touch pointCount reduction (#4661) --- src/platforms/rcore_web.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 9fd2afb5a..78fd46f50 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -1812,7 +1812,23 @@ static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) { - CORE.Input.Touch.pointCount--; + // Identify the EMSCRIPTEN_EVENT_TOUCHEND and remove it from the list + for (int i = 0; i < CORE.Input.Touch.pointCount; i++) + { + if (touchEvent->touches[i].isChanged) + { + // Move all touch points one position up + for (int j = i; j < CORE.Input.Touch.pointCount - 1; j++) + { + CORE.Input.Touch.pointId[j] = CORE.Input.Touch.pointId[j + 1]; + CORE.Input.Touch.position[j] = CORE.Input.Touch.position[j + 1]; + } + // Decrease touch points count to remove the last one + CORE.Input.Touch.pointCount--; + break; + } + } + // Clamp pointCount to avoid negative values if (CORE.Input.Touch.pointCount < 0) CORE.Input.Touch.pointCount = 0; } From 5d9aed5d4063158bbc3634e6889ba2dd979412b0 Mon Sep 17 00:00:00 2001 From: "K. Adam Christensen" Date: Wed, 8 Jan 2025 09:53:27 -0800 Subject: [PATCH 163/194] [rlgl] Optimize rlReadScreenPixels (#4667) This optimization works in the following ways: 1. Reduces calls to malloc to 1. Instead of needing an extra array, we can just swap the top half with the bottom half of the one array. 2. Unroll the inner for loop and remove a condition. Unrolling loops buys some performance wins, but the real goal was to remove the if check and just set the alpha channel to 255. On my hidpi arm64 laptop, I saw ~60% improvement in performance in my debug build (29 FPS vs 47 FPS). When optimized, the gains were roughly 10% (75 FPS vs 83%). Signed-off-by: K. Adam Christensen --- src/rlgl.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index cb10fd7ab..574b860b0 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3666,29 +3666,37 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format) // Read screen pixel data (color buffer) unsigned char *rlReadScreenPixels(int width, int height) { - unsigned char *screenData = (unsigned char *)RL_CALLOC(width*height*4, sizeof(unsigned char)); + unsigned char *imgData = (unsigned char *)RL_CALLOC(width*height*4, sizeof(unsigned char)); // NOTE 1: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer // NOTE 2: We are getting alpha channel! Be careful, it can be transparent if not cleared properly! - glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData); + glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, imgData); // Flip image vertically! - unsigned char *imgData = (unsigned char *)RL_MALLOC(width*height*4*sizeof(unsigned char)); - - for (int y = height - 1; y >= 0; y--) + // NOTE: Alpha value has already been applied to RGB in framebuffer, we don't need it! + for (int y = height - 1; y >= height / 2; y--) { - for (int x = 0; x < (width*4); x++) + for (int x = 0; x < (width*4); x += 4) { - imgData[((height - 1) - y)*width*4 + x] = screenData[(y*width*4) + x]; // Flip line + size_t s = ((height - 1) - y)*width*4 + x; + size_t e = y*width*4 + x; - // Set alpha component value to 255 (no trasparent image retrieval) - // NOTE: Alpha value has already been applied to RGB in framebuffer, we don't need it! - if (((x + 1)%4) == 0) imgData[((height - 1) - y)*width*4 + x] = 255; + unsigned char r = imgData[s]; + unsigned char g = imgData[s+1]; + unsigned char b = imgData[s+2]; + + imgData[s] = imgData[e]; + imgData[s+1] = imgData[e+1]; + imgData[s+2] = imgData[e+2]; + imgData[s+3] = 255; // Set alpha component value to 255 (no trasparent image retrieval) + + imgData[e] = r; + imgData[e+1] = g; + imgData[e+2] = b; + imgData[e+3] = 255; // Ditto } } - RL_FREE(screenData); - return imgData; // NOTE: image data should be freed } From ddd86a33874b407f9f0cbb7a095c9e72c9ed3b47 Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Thu, 9 Jan 2025 00:07:59 +0100 Subject: [PATCH 164/194] [rshapes] Fix pixel offset issue with line drawing (#4666) * fix pixel offset issue with `DrawRectangleRoundedLinesEx` * improve fix - (pixel offset issue with `DrawRectangleRoundedLinesEx`) * revert radius tweak (`DrawRectangleRoundedLines`) --- src/rshapes.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index f0da73575..07c685b6e 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1160,18 +1160,29 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f P5 ================== P4 */ const Vector2 point[16] = { - {(float)rec.x + innerRadius, rec.y - lineThick}, {(float)(rec.x + rec.width) - innerRadius, rec.y - lineThick}, { rec.x + rec.width + lineThick, (float)rec.y + innerRadius }, // PO, P1, P2 - {rec.x + rec.width + lineThick, (float)(rec.y + rec.height) - innerRadius}, {(float)(rec.x + rec.width) - innerRadius, rec.y + rec.height + lineThick}, // P3, P4 - {(float)rec.x + innerRadius, rec.y + rec.height + lineThick}, { rec.x - lineThick, (float)(rec.y + rec.height) - innerRadius}, {rec.x - lineThick, (float)rec.y + innerRadius}, // P5, P6, P7 - {(float)rec.x + innerRadius, rec.y}, {(float)(rec.x + rec.width) - innerRadius, rec.y}, // P8, P9 - { rec.x + rec.width, (float)rec.y + innerRadius }, {rec.x + rec.width, (float)(rec.y + rec.height) - innerRadius}, // P10, P11 - {(float)(rec.x + rec.width) - innerRadius, rec.y + rec.height}, {(float)rec.x + innerRadius, rec.y + rec.height}, // P12, P13 - { rec.x, (float)(rec.y + rec.height) - innerRadius}, {rec.x, (float)rec.y + innerRadius} // P14, P15 + {(float)rec.x + innerRadius + 0.5f, rec.y - lineThick + 0.5f}, + {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y - lineThick + 0.5f}, + {rec.x + rec.width + lineThick - 0.5f, (float)rec.y + innerRadius + 0.5f}, // PO, P1, P2 + {rec.x + rec.width + lineThick - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + rec.height + lineThick - 0.5f}, // P3, P4 + {(float)rec.x + innerRadius + 0.5f, rec.y + rec.height + lineThick - 0.5f}, + {rec.x - lineThick + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {rec.x - lineThick + 0.5f, (float)rec.y + innerRadius + 0.5f}, // P5, P6, P7 + {(float)rec.x + innerRadius + 0.5f, rec.y + 0.5f}, + {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + 0.5f}, // P8, P9 + {rec.x + rec.width - 0.5f, (float)rec.y + innerRadius + 0.5f}, + {rec.x + rec.width - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, // P10, P11 + {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + rec.height - 0.5f}, + {(float)rec.x + innerRadius + 0.5f, rec.y + rec.height - 0.5f}, // P12, P13 + {rec.x + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {rec.x + 0.5f, (float)rec.y + innerRadius + 0.5f} // P14, P15 }; const Vector2 centers[4] = { - {(float)rec.x + innerRadius, (float)rec.y + innerRadius}, {(float)(rec.x + rec.width) - innerRadius, (float)rec.y + innerRadius}, // P16, P17 - {(float)(rec.x + rec.width) - innerRadius, (float)(rec.y + rec.height) - innerRadius}, {(float)rec.x + innerRadius, (float)(rec.y + rec.height) - innerRadius} // P18, P19 + {(float)rec.x + innerRadius + 0.5f, (float)rec.y + innerRadius + 0.5f}, + {(float)(rec.x + rec.width) - innerRadius - 0.5f, (float)rec.y + innerRadius + 0.5f}, // P16, P17 + {(float)(rec.x + rec.width) - innerRadius - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {(float)rec.x + innerRadius + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f} // P18, P19 }; const float angles[4] = { 180.0f, 270.0f, 0.0f, 90.0f }; From bf8962dbc7233d9814b45d83d7a7b91b8335fb52 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 10 Jan 2025 13:06:28 +0100 Subject: [PATCH 165/194] REVIEWED: Remove some `const` from text buffer return values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lately got some compilation `errors` related, it seems GCC 14 interprets some `const`-missmatch as errors instead of warnings (as previous versions). But in any case, I don't see why an user won't be able to operate directly over of those returned buffers; `const` adds a restriction (for security reasons?) that in my opinion is useless. From an expert on compilers (w64devkit creator), here there are some notes I agree with: ``` No const. It serves no practical role in optimization, and I cannot recall an instance where it caught, or would have caught, a mistake. I held out for awhile as prototype documentation, but on reflection I found that good parameter names were sufficient. Dropping const has made me noticeably more productive by reducing cognitive load and eliminating visual clutter. I now believe its inclusion in C was a costly mistake. (One small exception: I still like it as a hint to place static tables in read-only memory closer to the code. I’ll cast away the const if needed. This is only of minor importance.) ``` Ref: https://nullprogram.com/blog/2023/10/08/ --- src/raylib.h | 14 +++++++------- src/rtext.c | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 451091269..f59e1c041 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1510,15 +1510,15 @@ RLAPI const char *TextFormat(const char *text, ...); RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string RLAPI char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) -RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter -RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings +RLAPI char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter +RLAPI char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string -RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string -RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string -RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string -RLAPI const char *TextToSnake(const char *text); // Get Snake case notation version of provided string -RLAPI const char *TextToCamel(const char *text); // Get Camel case notation version of provided string +RLAPI char *TextToUpper(const char *text); // Get upper case version of provided string +RLAPI char *TextToLower(const char *text); // Get lower case version of provided string +RLAPI char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI char *TextToSnake(const char *text); // Get Snake case notation version of provided string +RLAPI char *TextToCamel(const char *text); // Get Camel case notation version of provided string RLAPI int TextToInteger(const char *text); // Get integer value from text RLAPI float TextToFloat(const char *text); // Get float value from text diff --git a/src/rtext.c b/src/rtext.c index 12c25e4e6..e22e14778 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1629,7 +1629,7 @@ char *TextInsert(const char *text, const char *insert, int position) // Join text strings with delimiter // REQUIRES: memset(), memcpy() -const char *TextJoin(const char **textList, int count, const char *delimiter) +char *TextJoin(const char **textList, int count, const char *delimiter) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); @@ -1663,7 +1663,7 @@ const char *TextJoin(const char **textList, int count, const char *delimiter) // Split string into multiple strings // REQUIRES: memset() -const char **TextSplit(const char *text, char delimiter, int *count) +char **TextSplit(const char *text, char delimiter, int *count) { // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter) // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated, @@ -1671,7 +1671,7 @@ const char **TextSplit(const char *text, char delimiter, int *count) // 1. Maximum number of possible split strings is set by MAX_TEXTSPLIT_COUNT // 2. Maximum size of text to split is MAX_TEXT_BUFFER_LENGTH - static const char *result[MAX_TEXTSPLIT_COUNT] = { NULL }; + static char *result[MAX_TEXTSPLIT_COUNT] = { NULL }; static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); @@ -1727,7 +1727,7 @@ int TextFindIndex(const char *text, const char *find) // Get upper case version of provided string // WARNING: Limited functionality, only basic characters set // TODO: Support UTF-8 diacritics to upper-case, check codepoints -const char *TextToUpper(const char *text) +char *TextToUpper(const char *text) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); @@ -1746,7 +1746,7 @@ const char *TextToUpper(const char *text) // Get lower case version of provided string // WARNING: Limited functionality, only basic characters set -const char *TextToLower(const char *text) +char *TextToLower(const char *text) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); @@ -1765,7 +1765,7 @@ const char *TextToLower(const char *text) // Get Pascal case notation version of provided string // WARNING: Limited functionality, only basic characters set -const char *TextToPascal(const char *text) +char *TextToPascal(const char *text) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); @@ -1793,7 +1793,7 @@ const char *TextToPascal(const char *text) // Get snake case notation version of provided string // WARNING: Limited functionality, only basic characters set -const char *TextToSnake(const char *text) +char *TextToSnake(const char *text) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = {0}; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); @@ -1821,7 +1821,7 @@ const char *TextToSnake(const char *text) // Get Camel case notation version of provided string // WARNING: Limited functionality, only basic characters set -const char *TextToCamel(const char *text) +char *TextToCamel(const char *text) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = {0}; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); From 433cc23ea4511fbeddc0fccc597cde91f5756d59 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 10 Jan 2025 12:06:46 +0000 Subject: [PATCH 166/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 14 +++++++------- parser/output/raylib_api.lua | 14 +++++++------- parser/output/raylib_api.txt | 14 +++++++------- parser/output/raylib_api.xml | 14 +++++++------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 853f591d4..c7ebeaf38 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -9675,7 +9675,7 @@ { "name": "TextJoin", "description": "Join text strings with delimiter", - "returnType": "const char *", + "returnType": "char *", "params": [ { "type": "const char **", @@ -9694,7 +9694,7 @@ { "name": "TextSplit", "description": "Split text into multiple strings", - "returnType": "const char **", + "returnType": "char **", "params": [ { "type": "const char *", @@ -9747,7 +9747,7 @@ { "name": "TextToUpper", "description": "Get upper case version of provided string", - "returnType": "const char *", + "returnType": "char *", "params": [ { "type": "const char *", @@ -9758,7 +9758,7 @@ { "name": "TextToLower", "description": "Get lower case version of provided string", - "returnType": "const char *", + "returnType": "char *", "params": [ { "type": "const char *", @@ -9769,7 +9769,7 @@ { "name": "TextToPascal", "description": "Get Pascal case notation version of provided string", - "returnType": "const char *", + "returnType": "char *", "params": [ { "type": "const char *", @@ -9780,7 +9780,7 @@ { "name": "TextToSnake", "description": "Get Snake case notation version of provided string", - "returnType": "const char *", + "returnType": "char *", "params": [ { "type": "const char *", @@ -9791,7 +9791,7 @@ { "name": "TextToCamel", "description": "Get Camel case notation version of provided string", - "returnType": "const char *", + "returnType": "char *", "params": [ { "type": "const char *", diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index 2983456f3..d3130a7d9 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -6891,7 +6891,7 @@ return { { name = "TextJoin", description = "Join text strings with delimiter", - returnType = "const char *", + returnType = "char *", params = { {type = "const char **", name = "textList"}, {type = "int", name = "count"}, @@ -6901,7 +6901,7 @@ return { { name = "TextSplit", description = "Split text into multiple strings", - returnType = "const char **", + returnType = "char **", params = { {type = "const char *", name = "text"}, {type = "char", name = "delimiter"}, @@ -6930,7 +6930,7 @@ return { { name = "TextToUpper", description = "Get upper case version of provided string", - returnType = "const char *", + returnType = "char *", params = { {type = "const char *", name = "text"} } @@ -6938,7 +6938,7 @@ return { { name = "TextToLower", description = "Get lower case version of provided string", - returnType = "const char *", + returnType = "char *", params = { {type = "const char *", name = "text"} } @@ -6946,7 +6946,7 @@ return { { name = "TextToPascal", description = "Get Pascal case notation version of provided string", - returnType = "const char *", + returnType = "char *", params = { {type = "const char *", name = "text"} } @@ -6954,7 +6954,7 @@ return { { name = "TextToSnake", description = "Get Snake case notation version of provided string", - returnType = "const char *", + returnType = "char *", params = { {type = "const char *", name = "text"} } @@ -6962,7 +6962,7 @@ return { { name = "TextToCamel", description = "Get Camel case notation version of provided string", - returnType = "const char *", + returnType = "char *", params = { {type = "const char *", name = "text"} } diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 038b43e17..4d2ed2c93 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -3704,14 +3704,14 @@ Function 429: TextInsert() (3 input parameters) Param[3]: position (type: int) Function 430: TextJoin() (3 input parameters) Name: TextJoin - Return type: const char * + Return type: char * Description: Join text strings with delimiter Param[1]: textList (type: const char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) Function 431: TextSplit() (3 input parameters) Name: TextSplit - Return type: const char ** + Return type: char ** Description: Split text into multiple strings Param[1]: text (type: const char *) Param[2]: delimiter (type: char) @@ -3731,27 +3731,27 @@ Function 433: TextFindIndex() (2 input parameters) Param[2]: find (type: const char *) Function 434: TextToUpper() (1 input parameters) Name: TextToUpper - Return type: const char * + Return type: char * Description: Get upper case version of provided string Param[1]: text (type: const char *) Function 435: TextToLower() (1 input parameters) Name: TextToLower - Return type: const char * + Return type: char * Description: Get lower case version of provided string Param[1]: text (type: const char *) Function 436: TextToPascal() (1 input parameters) Name: TextToPascal - Return type: const char * + Return type: char * Description: Get Pascal case notation version of provided string Param[1]: text (type: const char *) Function 437: TextToSnake() (1 input parameters) Name: TextToSnake - Return type: const char * + Return type: char * Description: Get Snake case notation version of provided string Param[1]: text (type: const char *) Function 438: TextToCamel() (1 input parameters) Name: TextToCamel - Return type: const char * + Return type: char * Description: Get Camel case notation version of provided string Param[1]: text (type: const char *) Function 439: TextToInteger() (1 input parameters) diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 734f96465..c2c645977 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -2453,12 +2453,12 @@ - + - + @@ -2472,19 +2472,19 @@ - + - + - + - + - + From b554b53ede67a934e3c0b9bf971fc57629be640f Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:36:52 +0100 Subject: [PATCH 167/194] fix pixel offset issue with `DrawRectangleLines` (#4669) --- src/rshapes.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 07c685b6e..f482079c8 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -807,22 +807,25 @@ void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Col // but it solves another issue: https://github.com/raysan5/raylib/issues/3884 void DrawRectangleLines(int posX, int posY, int width, int height, Color color) { - Matrix mat = rlGetMatrixModelview(); - float zoomFactor = 0.5f/mat.m0; + Matrix mat = rlGetMatrixTransform(); + float xOffset = 0.5f/mat.m0; + float yOffset = 0.5f/mat.m5; + rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f((float)posX - zoomFactor, (float)posY); - rlVertex2f((float)posX + (float)width + zoomFactor, (float)posY); + rlVertex2f((float)posX + xOffset, (float)posY + yOffset); + rlVertex2f((float)posX + (float)width - xOffset, (float)posY + yOffset); - rlVertex2f((float)posX + (float)width, (float)posY - zoomFactor); - rlVertex2f((float)posX + (float)width, (float)posY + (float)height + zoomFactor); + rlVertex2f((float)posX + (float)width - xOffset, (float)posY + yOffset); + rlVertex2f((float)posX + (float)width - xOffset, (float)posY + (float)height - yOffset); - rlVertex2f((float)posX + (float)width + zoomFactor, (float)posY + (float)height); - rlVertex2f((float)posX - zoomFactor, (float)posY + (float)height); + rlVertex2f((float)posX + (float)width - xOffset, (float)posY + (float)height - yOffset); + rlVertex2f((float)posX + xOffset, (float)posY + (float)height - yOffset); - rlVertex2f((float)posX, (float)posY + (float)height + zoomFactor); - rlVertex2f((float)posX, (float)posY - zoomFactor); + rlVertex2f((float)posX + xOffset, (float)posY + (float)height - yOffset); + rlVertex2f((float)posX + xOffset, (float)posY + yOffset); rlEnd(); + /* // Previous implementation, it has issues... but it does not require view matrix... #if defined(SUPPORT_QUADS_DRAW_MODE) @@ -845,7 +848,7 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) rlVertex2f((float)posX + 1, (float)posY + (float)height); rlVertex2f((float)posX + 1, (float)posY + 1); rlEnd(); -//#endif +#endif */ } From eee86dd7c9b7b71aad131f56ebeb9ad6dd05ca69 Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:37:57 +0100 Subject: [PATCH 168/194] [build][CMake] Fix cmake configuration issue for Android (#4671) * fix cmake configuration issue for Android * review comment --- cmake/LibraryConfigurations.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index fb7898306..00dda033a 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -69,6 +69,14 @@ elseif (${PLATFORM} MATCHES "Android") 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) + + # NOTE: We remove '-Wl,--no-undefined' (set by default) as it conflicts with '-Wl,-undefined,dynamic_lookup' needed + # for compiling with the missing 'void main(void)' declaration in `android_main()`. + # We also remove other unnecessary or problematic flags. + + string(REPLACE "-Wl,--no-undefined -Qunused-arguments" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + string(REPLACE "-static-libstdc++" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -u ANativeActivity_onCreate -Wl,-undefined,dynamic_lookup") find_library(OPENGL_LIBRARY OpenGL) From 43dbaf21e7aff7f97148fe3f860d16ef571a2d04 Mon Sep 17 00:00:00 2001 From: Hakunamawatta <48947000+Hakunamawatta@users.noreply.github.com> Date: Sat, 11 Jan 2025 03:40:13 +1100 Subject: [PATCH 169/194] [examples] Fix broken link (#4674) --- examples/text/text_draw_3d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/text/text_draw_3d.c b/examples/text/text_draw_3d.c index ed4e6ce67..8d23b0450 100644 --- a/examples/text/text_draw_3d.c +++ b/examples/text/text_draw_3d.c @@ -286,7 +286,7 @@ int main(void) DrawGrid(10, 2.0f); // Use a shader to handle the depth buffer issue with transparent textures - // NOTE: more info at https://bedroomcoders.co.uk/raylib-billboards-advanced-use/ + // NOTE: more info at https://bedroomcoders.co.uk/posts/198 BeginShaderMode(alphaDiscard); // Draw the 3D text above the red cube From 34f431b422d8d9850c4bec85d33449e60c27610f Mon Sep 17 00:00:00 2001 From: Michael Kearns <1312115+mobiuscog@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:40:48 +0000 Subject: [PATCH 170/194] Update xcode-frameworks dependency for latest zig (#4675) * Update build.zig.zon for latest framework commit * Update build.zig.zon with correct hash * Update build.zig.zon with the 'really' correct hash --- build.zig.zon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 557028e45..077865978 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -5,8 +5,8 @@ .dependencies = .{ .xcode_frameworks = .{ - .url = "git+https://github.com/hexops/xcode-frameworks#a6bf82e032d4d9923ad5c222d466710fcc05f249", - .hash = "12208da4dfcd9b53fb367375fb612ec73f38e53015f1ce6ae6d6e8437a637078e170", + .url = "git+https://github.com/hexops/xcode-frameworks#9a45f3ac977fd25dff77e58c6de1870b6808c4a7", + .hash = "122098b9174895f9708bc824b0f9e550c401892c40a900006459acf2cbf78acd99bb", .lazy = true, }, .emsdk = .{ From 08b089f620c361e68f82782463c9e9a318d15d1f Mon Sep 17 00:00:00 2001 From: veins1 <19636663+veins1@users.noreply.github.com> Date: Fri, 10 Jan 2025 21:41:40 +0500 Subject: [PATCH 171/194] Reviewed shaders_deferred_render (#4676) Fixed: g-buffer textures binding Fixed: Clearing screen with white would leak onto g-buffer textures Reviewed comments --- examples/shaders/shaders_deferred_render.c | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/shaders/shaders_deferred_render.c b/examples/shaders/shaders_deferred_render.c index 52c713aa7..e5c549e5a 100644 --- a/examples/shaders/shaders_deferred_render.c +++ b/examples/shaders/shaders_deferred_render.c @@ -134,14 +134,15 @@ int main(void) } // Now we initialize the sampler2D uniform's in the deferred shader. - // We do this by setting the uniform's value to the color channel slot we earlier - // bound our textures to. + // We do this by setting the uniform's values to the texture units that + // we later bind our g-buffer textures to. rlEnableShader(deferredShader.id); - - rlSetUniformSampler(rlGetLocationUniform(deferredShader.id, "gPosition"), 0); - rlSetUniformSampler(rlGetLocationUniform(deferredShader.id, "gNormal"), 1); - rlSetUniformSampler(rlGetLocationUniform(deferredShader.id, "gAlbedoSpec"), 2); - + int texUnitPosition = 0; + int texUnitNormal = 1; + int texUnitAlbedoSpec = 2; + SetShaderValue(deferredShader, rlGetLocationUniform(deferredShader.id, "gPosition"), &texUnitPosition, RL_SHADER_UNIFORM_SAMPLER2D); + SetShaderValue(deferredShader, rlGetLocationUniform(deferredShader.id, "gNormal"), &texUnitNormal, RL_SHADER_UNIFORM_SAMPLER2D); + SetShaderValue(deferredShader, rlGetLocationUniform(deferredShader.id, "gAlbedoSpec"), &texUnitAlbedoSpec, RL_SHADER_UNIFORM_SAMPLER2D); rlDisableShader(); // Assign out lighting shader to model @@ -208,11 +209,10 @@ int main(void) // Draw // --------------------------------------------------------------------------------- BeginDrawing(); - - ClearBackground(RAYWHITE); - + // Draw to the geometry buffer by first activating it rlEnableFramebuffer(gBuffer.framebuffer); + rlClearColor(0, 0, 0, 0); rlClearScreenBuffers(); // Clear color and depth buffer rlDisableColorBlend(); @@ -246,14 +246,14 @@ int main(void) BeginMode3D(camera); rlDisableColorBlend(); rlEnableShader(deferredShader.id); - // Activate our g-buffer textures - // These will now be bound to the sampler2D uniforms `gPosition`, `gNormal`, + // Bind our g-buffer textures + // We are binding them to locations that we earlier set in sampler2D uniforms `gPosition`, `gNormal`, // and `gAlbedoSpec` - rlActiveTextureSlot(0); + rlActiveTextureSlot(texUnitPosition); rlEnableTexture(gBuffer.positionTexture); - rlActiveTextureSlot(1); + rlActiveTextureSlot(texUnitNormal); rlEnableTexture(gBuffer.normalTexture); - rlActiveTextureSlot(2); + rlActiveTextureSlot(texUnitAlbedoSpec); rlEnableTexture(gBuffer.albedoSpecTexture); // Finally, we draw a fullscreen quad to our default framebuffer @@ -269,8 +269,8 @@ int main(void) rlBlitFramebuffer(0, 0, screenWidth, screenHeight, 0, 0, screenWidth, screenHeight, 0x00000100); // GL_DEPTH_BUFFER_BIT rlDisableFramebuffer(); - // Since our shader is now done and disabled, we can draw our lights in default - // forward rendering + // Since our shader is now done and disabled, we can draw spheres + // that represent light positions in default forward rendering BeginMode3D(camera); rlEnableShader(rlGetShaderIdDefault()); for(int i = 0; i < MAX_LIGHTS; i++) From 2b2694a89fdfa85a90ce6e311d2477f2bca7be5d Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 10 Jan 2025 22:36:11 +0100 Subject: [PATCH 172/194] Fix #4680 --- src/rcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rcore.c b/src/rcore.c index 2806235cc..a90a60387 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1931,7 +1931,7 @@ bool IsFileExtension(const char *fileName, const char *ext) { #if defined(SUPPORT_MODULE_RTEXT) && defined(SUPPORT_TEXT_MANIPULATION) int extCount = 0; - const char **checkExts = TextSplit(ext, ';', &extCount); // WARNING: Module required: rtext + char **checkExts = TextSplit(ext, ';', &extCount); // WARNING: Module required: rtext char fileExtLower[MAX_FILE_EXTENSION_LENGTH + 1] = { 0 }; strncpy(fileExtLower, TextToLower(fileExt), MAX_FILE_EXTENSION_LENGTH); // WARNING: Module required: rtext From 62d8969a56909a4721114860cbe1350b5dcb20eb Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 10 Jan 2025 22:56:25 +0100 Subject: [PATCH 173/194] Reviewed shader formating --- .../shaders/resources/shaders/glsl100/pbr.fs | 157 +++++++++--------- .../shaders/resources/shaders/glsl100/pbr.vs | 19 +-- 2 files changed, 91 insertions(+), 85 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/pbr.fs b/examples/shaders/resources/shaders/glsl100/pbr.fs index 70e3b4885..a9cf1a3e0 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.fs +++ b/examples/shaders/resources/shaders/glsl100/pbr.fs @@ -59,97 +59,104 @@ uniform float ambient; // incrase reflectivity when surface view at larger angle vec3 schlickFresnel(float hDotV,vec3 refl) { - return refl + (1.0 - refl) * pow(1.0 - hDotV,5.0); + return refl + (1.0 - refl)*pow(1.0 - hDotV,5.0); } -float ggxDistribution(float nDotH,float roughness) +float ggxDistribution(float nDotH, float roughness) { - float a = roughness * roughness * roughness * roughness; - float d = nDotH * nDotH * (a - 1.0) + 1.0; - d = PI * d * d; - return a / max(d,0.0000001); + float a = roughness*roughness*roughness*roughness; + float d = nDotH*nDotH*(a - 1.0) + 1.0; + d = PI*d*d; + return a/max(d,0.0000001); } -float geomSmith(float nDotV,float nDotL,float roughness) +float geomSmith(float nDotV, float nDotL, float roughness) { - float r = roughness + 1.0; - float k = r * r / 8.0; - float ik = 1.0 - k; - float ggx1 = nDotV / (nDotV * ik + k); - float ggx2 = nDotL / (nDotL * ik + k); - return ggx1 * ggx2; + float r = roughness + 1.0; + float k = r*r/8.0; + float ik = 1.0 - k; + float ggx1 = nDotV/(nDotV*ik + k); + float ggx2 = nDotL/(nDotL*ik + k); + return ggx1*ggx2; } -vec3 pbr(){ - vec3 albedo = texture2D(albedoMap,vec2(fragTexCoord.x*tiling.x+offset.x,fragTexCoord.y*tiling.y+offset.y)).rgb; - albedo = vec3(albedoColor.x*albedo.x,albedoColor.y*albedo.y,albedoColor.z*albedo.z); - float metallic = clamp(metallicValue,0.0,1.0); - float roughness = clamp(roughnessValue,0.0,1.0); - float ao = clamp(aoValue,0.0,1.0); - if(useTexMRA == 1) { - vec4 mra = texture2D(mraMap, vec2(fragTexCoord.x * tiling.x + offset.x, fragTexCoord.y * tiling.y + offset.y)); - metallic = clamp(mra.r+metallicValue,0.04,1.0); - roughness = clamp(mra.g+roughnessValue,0.04,1.0); - ao = (mra.b+aoValue)*0.5; - } +vec3 pbr() +{ + vec3 albedo = texture2D(albedoMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb; + albedo = vec3(albedoColor.x*albedo.x, albedoColor.y*albedo.y, albedoColor.z*albedo.z); + + float metallic = clamp(metallicValue, 0.0, 1.0); + float roughness = clamp(roughnessValue, 0.0, 1.0); + float ao = clamp(aoValue, 0.0, 1.0); + + if (useTexMRA == 1) + { + vec4 mra = texture2D(mraMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)); + metallic = clamp(mra.r + metallicValue, 0.04, 1.0); + roughness = clamp(mra.g + roughnessValue, 0.04, 1.0); + ao = (mra.b + aoValue)*0.5; + } + vec3 N = normalize(fragNormal); + if (useTexNormal == 1) + { + N = texture2D(normalMap, vec2(fragTexCoord.x*tiling.x + offset.y, fragTexCoord.y*tiling.y + offset.y)).rgb; + N = normalize(N*2.0 - 1.0); + N = normalize(N*TBN); + } + + vec3 V = normalize(viewPos - fragPosition); + + vec3 e = vec3(0); + e = (texture2D(emissiveMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb).g*emissiveColor.rgb*emissivePower*float(useTexEmissive); + + // return N;//vec3(metallic,metallic,metallic); + // If dia-electric use base reflectivity of 0.04 otherwise ut is a metal use albedo as base reflectivity + vec3 baseRefl = mix(vec3(0.04), albedo.rgb, metallic); + vec3 Lo = vec3(0.0); // Acumulate lighting lum + for (int i = 0; i < 4; i++) + { + vec3 L = normalize(lights[i].position - fragPosition); // Compute light vector + vec3 H = normalize(V + L); // Compute halfway bisecting vector + float dist = length(lights[i].position - fragPosition); // Compute distance to light + float attenuation = 1.0/(dist*dist*0.23); // Compute attenuation + vec3 radiance = lights[i].color.rgb*lights[i].intensity*attenuation; // Compute input radiance, light energy comming in - vec3 N = normalize(fragNormal); - if(useTexNormal == 1) { - N = texture2D(normalMap, vec2(fragTexCoord.x * tiling.x + offset.y, fragTexCoord.y * tiling.y + offset.y)).rgb; - N = normalize(N * 2.0 - 1.0); - N = normalize(N * TBN); - } + // Cook-Torrance BRDF distribution function + float nDotV = max(dot(N,V), 0.0000001); + float nDotL = max(dot(N,L), 0.0000001); + float hDotV = max(dot(H,V), 0.0); + float nDotH = max(dot(N,H), 0.0); + float D = ggxDistribution(nDotH, roughness); // Larger the more micro-facets aligned to H + float G = geomSmith(nDotV, nDotL, roughness); // Smaller the more micro-facets shadow + vec3 F = schlickFresnel(hDotV, baseRefl); // Fresnel proportion of specular reflectance + + vec3 spec = (D*G*F)/(4.0*nDotV*nDotL); - vec3 V = normalize(viewPos - fragPosition); + // Difuse and spec light can't be above 1.0 + // kD = 1.0 - kS diffuse component is equal 1.0 - spec comonent + vec3 kD = vec3(1.0) - F; - vec3 e = vec3(0); - e = (texture2D(emissiveMap, vec2(fragTexCoord.x*tiling.x+offset.x, fragTexCoord.y*tiling.y+offset.y)).rgb).g * emissiveColor.rgb*emissivePower * float(useTexEmissive); - - //return N;//vec3(metallic,metallic,metallic); - //if dia-electric use base reflectivity of 0.04 otherwise ut is a metal use albedo as base reflectivity - vec3 baseRefl = mix(vec3(0.04),albedo.rgb,metallic); - vec3 Lo = vec3(0.0); // acumulate lighting lum - - for(int i=0;i<4;++i){ - - vec3 L = normalize(lights[i].position - fragPosition); // calc light vector - vec3 H = normalize(V + L); // calc halfway bisecting vector - float dist = length(lights[i].position - fragPosition); // calc distance to light - float attenuation = 1.0 / (dist * dist * 0.23); // calc attenuation - vec3 radiance = lights[i].color.rgb * lights[i].intensity * attenuation; // calc input radiance,light energy comming in - - //Cook-Torrance BRDF distribution function - float nDotV = max(dot(N,V),0.0000001); - float nDotL = max(dot(N,L),0.0000001); - float hDotV = max(dot(H,V),0.0); - float nDotH = max(dot(N,H),0.0); - float D = ggxDistribution(nDotH,roughness); // larger the more micro-facets aligned to H - float G = geomSmith(nDotV,nDotL,roughness); // smaller the more micro-facets shadow - vec3 F = schlickFresnel(hDotV, baseRefl); // fresnel proportion of specular reflectance - - vec3 spec = (D * G * F) / (4.0 * nDotV * nDotL); - // difuse and spec light can't be above 1.0 - // kD = 1.0 - kS diffuse component is equal 1.0 - spec comonent - vec3 kD = vec3(1.0) - F; - //mult kD by the inverse of metallnes , only non-metals should have diffuse light - kD *= 1.0 - metallic; - Lo += ((kD * albedo.rgb / PI + spec) * radiance * nDotL)*float(lights[i].enabled); // angle of light has impact on result - } - vec3 ambient_final = (ambientColor + albedo)* ambient * 0.5; - return ambient_final+Lo*ao+e; + // Mult kD by the inverse of metallnes , only non-metals should have diffuse light + kD *= 1.0 - metallic; + Lo += ((kD*albedo.rgb/PI + spec)*radiance*nDotL)*float(lights[i].enabled); // Angle of light has impact on result + } + + vec3 ambientFinal = (ambientColor + albedo)*ambient*0.5; + + return (ambientFinal + Lo*ao + e); } void main() { - vec3 color = pbr(); - - //HDR tonemapping - color = pow(color,color + vec3(1.0)); - //gamma correction - color = pow(color,vec3(1.0/2.2)); + vec3 color = pbr(); + + // HDR tonemapping + color = pow(color,color + vec3(1.0)); + + // Gamma correction + color = pow(color,vec3(1.0/2.2)); - gl_FragColor = vec4(color,1.0); - + gl_FragColor = vec4(color,1.0); } diff --git a/examples/shaders/resources/shaders/glsl100/pbr.vs b/examples/shaders/resources/shaders/glsl100/pbr.vs index 87e142e07..5a93f784f 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.vs +++ b/examples/shaders/resources/shaders/glsl100/pbr.vs @@ -26,17 +26,17 @@ const float normalOffset = 0.1; // https://github.com/glslify/glsl-inverse mat3 inverse(mat3 m) { - float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2]; - float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2]; - float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2]; + float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2]; + float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2]; + float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2]; - float b01 = a22*a11 - a12*a21; - float b11 = -a22*a10 + a12*a20; - float b21 = a21*a10 - a11*a20; + float b01 = a22*a11 - a12*a21; + float b11 = -a22*a10 + a12*a20; + float b21 = a21*a10 - a11*a20; - float det = a00*b01 + a01*b11 + a02*b21; + float det = a00*b01 + a01*b11 + a02*b21; - return mat3(b01, (-a22*a01 + a02*a21), (a12*a01 - a02*a11), + return mat3(b01, (-a22*a01 + a02*a21), (a12*a01 - a02*a11), b11, (a22*a00 - a02*a20), (-a12*a00 + a02*a10), b21, (-a21*a00 + a01*a20), (a11*a00 - a01*a10))/det; } @@ -44,14 +44,13 @@ mat3 inverse(mat3 m) // https://github.com/glslify/glsl-transpose mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], + return mat3(m[0][0], m[1][0], m[2][0], m[0][1], m[1][1], m[2][1], m[0][2], m[1][2], m[2][2]); } void main() { - // calc binormal from vertex normal and tangent vec3 vertexBinormal = cross(vertexNormal, vertexTangent); // calc fragment normal based on normal transformations From 49b905077d3e2eb3c39efb466a7a7f8ff7c3034b Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 11 Jan 2025 19:36:26 +0100 Subject: [PATCH 174/194] remove trailing spaces --- src/rshapes.c | 22 +++++++++++----------- src/rtext.c | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index f482079c8..7b967fbdb 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1163,28 +1163,28 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f P5 ================== P4 */ const Vector2 point[16] = { - {(float)rec.x + innerRadius + 0.5f, rec.y - lineThick + 0.5f}, - {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y - lineThick + 0.5f}, + {(float)rec.x + innerRadius + 0.5f, rec.y - lineThick + 0.5f}, + {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y - lineThick + 0.5f}, {rec.x + rec.width + lineThick - 0.5f, (float)rec.y + innerRadius + 0.5f}, // PO, P1, P2 - {rec.x + rec.width + lineThick - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {rec.x + rec.width + lineThick - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + rec.height + lineThick - 0.5f}, // P3, P4 - {(float)rec.x + innerRadius + 0.5f, rec.y + rec.height + lineThick - 0.5f}, - {rec.x - lineThick + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {(float)rec.x + innerRadius + 0.5f, rec.y + rec.height + lineThick - 0.5f}, + {rec.x - lineThick + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, {rec.x - lineThick + 0.5f, (float)rec.y + innerRadius + 0.5f}, // P5, P6, P7 - {(float)rec.x + innerRadius + 0.5f, rec.y + 0.5f}, + {(float)rec.x + innerRadius + 0.5f, rec.y + 0.5f}, {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + 0.5f}, // P8, P9 - {rec.x + rec.width - 0.5f, (float)rec.y + innerRadius + 0.5f}, + {rec.x + rec.width - 0.5f, (float)rec.y + innerRadius + 0.5f}, {rec.x + rec.width - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, // P10, P11 - {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + rec.height - 0.5f}, + {(float)(rec.x + rec.width) - innerRadius - 0.5f, rec.y + rec.height - 0.5f}, {(float)rec.x + innerRadius + 0.5f, rec.y + rec.height - 0.5f}, // P12, P13 - {rec.x + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {rec.x + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, {rec.x + 0.5f, (float)rec.y + innerRadius + 0.5f} // P14, P15 }; const Vector2 centers[4] = { - {(float)rec.x + innerRadius + 0.5f, (float)rec.y + innerRadius + 0.5f}, + {(float)rec.x + innerRadius + 0.5f, (float)rec.y + innerRadius + 0.5f}, {(float)(rec.x + rec.width) - innerRadius - 0.5f, (float)rec.y + innerRadius + 0.5f}, // P16, P17 - {(float)(rec.x + rec.width) - innerRadius - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, + {(float)(rec.x + rec.width) - innerRadius - 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f}, {(float)rec.x + innerRadius + 0.5f, (float)(rec.y + rec.height) - innerRadius - 0.5f} // P18, P19 }; diff --git a/src/rtext.c b/src/rtext.c index e22e14778..b93fa1c32 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -247,8 +247,8 @@ extern void LoadFontDefault(void) // we must consider data as little-endian order (alpha + gray) ((unsigned short *)imFont.data)[i + j] = 0xffff; } - else - { + else + { ((unsigned char *)imFont.data)[(i + j)*sizeof(short)] = 0xFF; ((unsigned char *)imFont.data)[(i + j)*sizeof(short) + 1] = 0x00; } From 8e450e4446b10999cdd6464abc39ad5986d6f6af Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 11 Jan 2025 19:36:46 +0100 Subject: [PATCH 175/194] Reviewed shaders formating to follow raylib coding conventions --- .../shaders/resources/shaders/glsl100/pbr.fs | 57 +++--- .../shaders/resources/shaders/glsl100/pbr.vs | 12 +- .../shaders/resources/shaders/glsl120/pbr.fs | 165 +++++++++--------- .../shaders/resources/shaders/glsl120/pbr.vs | 41 +++-- .../shaders/resources/shaders/glsl330/pbr.fs | 18 +- .../shaders/resources/shaders/glsl330/pbr.vs | 6 +- 6 files changed, 151 insertions(+), 148 deletions(-) diff --git a/examples/shaders/resources/shaders/glsl100/pbr.fs b/examples/shaders/resources/shaders/glsl100/pbr.fs index a9cf1a3e0..48688ebe9 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.fs +++ b/examples/shaders/resources/shaders/glsl100/pbr.fs @@ -54,23 +54,22 @@ uniform vec3 viewPos; uniform vec3 ambientColor; uniform float ambient; -// refl in range 0 to 1 -// returns base reflectivity to 1 -// incrase reflectivity when surface view at larger angle -vec3 schlickFresnel(float hDotV,vec3 refl) +// Reflectivity in range 0.0 to 1.0 +// NOTE: Reflectivity is increased when surface view at larger angle +vec3 SchlickFresnel(float hDotV,vec3 refl) { - return refl + (1.0 - refl)*pow(1.0 - hDotV,5.0); + return refl + (1.0 - refl)*pow(1.0 - hDotV, 5.0); } -float ggxDistribution(float nDotH, float roughness) +float GgxDistribution(float nDotH,float roughness) { float a = roughness*roughness*roughness*roughness; float d = nDotH*nDotH*(a - 1.0) + 1.0; d = PI*d*d; - return a/max(d,0.0000001); + return (a/max(d,0.0000001)); } -float geomSmith(float nDotV, float nDotL, float roughness) +float GeomSmith(float nDotV,float nDotL,float roughness) { float r = roughness + 1.0; float k = r*r/8.0; @@ -80,7 +79,7 @@ float geomSmith(float nDotV, float nDotL, float roughness) return ggx1*ggx2; } -vec3 pbr() +vec3 ComputePBR() { vec3 albedo = texture2D(albedoMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb; albedo = vec3(albedoColor.x*albedo.x, albedoColor.y*albedo.y, albedoColor.z*albedo.z); @@ -104,23 +103,23 @@ vec3 pbr() N = normalize(N*2.0 - 1.0); N = normalize(N*TBN); } - + vec3 V = normalize(viewPos - fragPosition); - - vec3 e = vec3(0); - e = (texture2D(emissiveMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb).g*emissiveColor.rgb*emissivePower*float(useTexEmissive); - + + vec3 emissive = vec3(0); + emissive = (texture2D(emissiveMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb).g*emissiveColor.rgb*emissivePower*float(useTexEmissive); + // return N;//vec3(metallic,metallic,metallic); // If dia-electric use base reflectivity of 0.04 otherwise ut is a metal use albedo as base reflectivity vec3 baseRefl = mix(vec3(0.04), albedo.rgb, metallic); - vec3 Lo = vec3(0.0); // Acumulate lighting lum + vec3 lightAccum = vec3(0.0); // Acumulate lighting lum for (int i = 0; i < 4; i++) { - vec3 L = normalize(lights[i].position - fragPosition); // Compute light vector - vec3 H = normalize(V + L); // Compute halfway bisecting vector - float dist = length(lights[i].position - fragPosition); // Compute distance to light - float attenuation = 1.0/(dist*dist*0.23); // Compute attenuation + vec3 L = normalize(lights[i].position - fragPosition); // Compute light vector + vec3 H = normalize(V + L); // Compute halfway bisecting vector + float dist = length(lights[i].position - fragPosition); // Compute distance to light + float attenuation = 1.0/(dist*dist*0.23); // Compute attenuation vec3 radiance = lights[i].color.rgb*lights[i].intensity*attenuation; // Compute input radiance, light energy comming in // Cook-Torrance BRDF distribution function @@ -128,9 +127,9 @@ vec3 pbr() float nDotL = max(dot(N,L), 0.0000001); float hDotV = max(dot(H,V), 0.0); float nDotH = max(dot(N,H), 0.0); - float D = ggxDistribution(nDotH, roughness); // Larger the more micro-facets aligned to H - float G = geomSmith(nDotV, nDotL, roughness); // Smaller the more micro-facets shadow - vec3 F = schlickFresnel(hDotV, baseRefl); // Fresnel proportion of specular reflectance + float D = GgxDistribution(nDotH, roughness); // Larger the more micro-facets aligned to H + float G = GeomSmith(nDotV, nDotL, roughness); // Smaller the more micro-facets shadow + vec3 F = SchlickFresnel(hDotV, baseRefl); // Fresnel proportion of specular reflectance vec3 spec = (D*G*F)/(4.0*nDotV*nDotL); @@ -138,25 +137,25 @@ vec3 pbr() // kD = 1.0 - kS diffuse component is equal 1.0 - spec comonent vec3 kD = vec3(1.0) - F; - // Mult kD by the inverse of metallnes , only non-metals should have diffuse light + // Mult kD by the inverse of metallnes, only non-metals should have diffuse light kD *= 1.0 - metallic; - Lo += ((kD*albedo.rgb/PI + spec)*radiance*nDotL)*float(lights[i].enabled); // Angle of light has impact on result + lightAccum += ((kD*albedo.rgb/PI + spec)*radiance*nDotL)*float(lights[i].enabled); // Angle of light has impact on result } vec3 ambientFinal = (ambientColor + albedo)*ambient*0.5; - return (ambientFinal + Lo*ao + e); + return (ambientFinal + lightAccum*ao + emissive); } void main() { - vec3 color = pbr(); - + vec3 color = ComputePBR(); + // HDR tonemapping - color = pow(color,color + vec3(1.0)); + color = pow(color, color + vec3(1.0)); // Gamma correction - color = pow(color,vec3(1.0/2.2)); + color = pow(color, vec3(1.0/2.2)); gl_FragColor = vec4(color,1.0); } diff --git a/examples/shaders/resources/shaders/glsl100/pbr.vs b/examples/shaders/resources/shaders/glsl100/pbr.vs index 5a93f784f..a55c0ea4b 100644 --- a/examples/shaders/resources/shaders/glsl100/pbr.vs +++ b/examples/shaders/resources/shaders/glsl100/pbr.vs @@ -51,16 +51,16 @@ mat3 transpose(mat3 m) void main() { - // calc binormal from vertex normal and tangent + // Compute binormal from vertex normal and tangent vec3 vertexBinormal = cross(vertexNormal, vertexTangent); - // calc fragment normal based on normal transformations - mat3 normalMatrix = transpose(inverse(mat3(matModel))); - // calc fragment position based on model transformations + // Compute fragment normal based on normal transformations + mat3 normalMatrix = transpose(inverse(mat3(matModel))); + + // Compute fragment position based on model transformations fragPosition = vec3(matModel*vec4(vertexPosition, 1.0)); fragTexCoord = vertexTexCoord*2.0; - fragNormal = normalize(normalMatrix*vertexNormal); vec3 fragTangent = normalize(normalMatrix*vertexTangent); fragTangent = normalize(fragTangent - dot(fragTangent, fragNormal)*fragNormal); @@ -70,5 +70,5 @@ void main() TBN = transpose(mat3(fragTangent, fragBinormal, fragNormal)); // Calculate final vertex position - gl_Position = mvp * vec4(vertexPosition, 1.0); + gl_Position = mvp*vec4(vertexPosition, 1.0); } diff --git a/examples/shaders/resources/shaders/glsl120/pbr.fs b/examples/shaders/resources/shaders/glsl120/pbr.fs index 1c5eee00b..63241709b 100644 --- a/examples/shaders/resources/shaders/glsl120/pbr.fs +++ b/examples/shaders/resources/shaders/glsl120/pbr.fs @@ -22,7 +22,6 @@ varying vec3 fragNormal; varying vec4 shadowPos; varying mat3 TBN; - // Input uniform values uniform int numOfLights; uniform sampler2D albedoMap; @@ -53,102 +52,108 @@ uniform vec3 viewPos; uniform vec3 ambientColor; uniform float ambient; -// refl in range 0 to 1 -// returns base reflectivity to 1 -// incrase reflectivity when surface view at larger angle -vec3 schlickFresnel(float hDotV,vec3 refl) +// Reflectivity in range 0.0 to 1.0 +// NOTE: Reflectivity is increased when surface view at larger angle +vec3 SchlickFresnel(float hDotV,vec3 refl) { - return refl + (1.0 - refl) * pow(1.0 - hDotV,5.0); + return refl + (1.0 - refl)*pow(1.0 - hDotV, 5.0); } -float ggxDistribution(float nDotH,float roughness) +float GgxDistribution(float nDotH,float roughness) { - float a = roughness * roughness * roughness * roughness; - float d = nDotH * nDotH * (a - 1.0) + 1.0; - d = PI * d * d; - return a / max(d,0.0000001); + float a = roughness*roughness*roughness*roughness; + float d = nDotH*nDotH*(a - 1.0) + 1.0; + d = PI*d*d; + return (a/max(d,0.0000001)); } -float geomSmith(float nDotV,float nDotL,float roughness) +float GeomSmith(float nDotV,float nDotL,float roughness) { - float r = roughness + 1.0; - float k = r * r / 8.0; - float ik = 1.0 - k; - float ggx1 = nDotV / (nDotV * ik + k); - float ggx2 = nDotL / (nDotL * ik + k); - return ggx1 * ggx2; + float r = roughness + 1.0; + float k = r*r/8.0; + float ik = 1.0 - k; + float ggx1 = nDotV/(nDotV*ik + k); + float ggx2 = nDotL/(nDotL*ik + k); + return ggx1*ggx2; } -vec3 pbr(){ - vec3 albedo = texture2D(albedoMap,vec2(fragTexCoord.x*tiling.x+offset.x,fragTexCoord.y*tiling.y+offset.y)).rgb; - albedo = vec3(albedoColor.x*albedo.x,albedoColor.y*albedo.y,albedoColor.z*albedo.z); - float metallic = clamp(metallicValue,0.0,1.0); - float roughness = clamp(roughnessValue,0.0,1.0); - float ao = clamp(aoValue,0.0,1.0); - if(useTexMRA == 1) { - vec4 mra = texture2D(mraMap, vec2(fragTexCoord.x * tiling.x + offset.x, fragTexCoord.y * tiling.y + offset.y)); - metallic = clamp(mra.r+metallicValue,0.04,1.0); - roughness = clamp(mra.g+roughnessValue,0.04,1.0); - ao = (mra.b+aoValue)*0.5; - } +vec3 ComputePBR() +{ + vec3 albedo = texture2D(albedoMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb; + albedo = vec3(albedoColor.x*albedo.x, albedoColor.y*albedo.y, albedoColor.z*albedo.z); + + float metallic = clamp(metallicValue, 0.0, 1.0); + float roughness = clamp(roughnessValue, 0.0, 1.0); + float ao = clamp(aoValue, 0.0, 1.0); + + if (useTexMRA == 1) + { + vec4 mra = texture2D(mraMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)); + metallic = clamp(mra.r + metallicValue, 0.04, 1.0); + roughness = clamp(mra.g + roughnessValue, 0.04, 1.0); + ao = (mra.b + aoValue)*0.5; + } + vec3 N = normalize(fragNormal); + if (useTexNormal == 1) + { + N = texture2D(normalMap, vec2(fragTexCoord.x*tiling.x + offset.y, fragTexCoord.y*tiling.y + offset.y)).rgb; + N = normalize(N*2.0 - 1.0); + N = normalize(N*TBN); + } + vec3 V = normalize(viewPos - fragPosition); - vec3 N = normalize(fragNormal); - if(useTexNormal == 1) { - N = texture2D(normalMap, vec2(fragTexCoord.x * tiling.x + offset.y, fragTexCoord.y * tiling.y + offset.y)).rgb; - N = normalize(N * 2.0 - 1.0); - N = normalize(N * TBN); - } + vec3 emissive = vec3(0); + emissive = (texture2D(emissiveMap, vec2(fragTexCoord.x*tiling.x + offset.x, fragTexCoord.y*tiling.y + offset.y)).rgb).g*emissiveColor.rgb*emissivePower*float(useTexEmissive); + + // return N;//vec3(metallic,metallic,metallic); + // If dia-electric use base reflectivity of 0.04 otherwise ut is a metal use albedo as base reflectivity + vec3 baseRefl = mix(vec3(0.04), albedo.rgb, metallic); + vec3 lightAccum = vec3(0.0); // Acumulate lighting lum + + for (int i = 0; i < 4; i++) + { + vec3 L = normalize(lights[i].position - fragPosition); // Compute light vector + vec3 H = normalize(V + L); // Compute halfway bisecting vector + float dist = length(lights[i].position - fragPosition); // Compute distance to light + float attenuation = 1.0/(dist*dist*0.23); // Compute attenuation + vec3 radiance = lights[i].color.rgb*lights[i].intensity*attenuation; // Compute input radiance, light energy comming in + + // Cook-Torrance BRDF distribution function + float nDotV = max(dot(N,V), 0.0000001); + float nDotL = max(dot(N,L), 0.0000001); + float hDotV = max(dot(H,V), 0.0); + float nDotH = max(dot(N,H), 0.0); + float D = GgxDistribution(nDotH, roughness); // Larger the more micro-facets aligned to H + float G = GeomSmith(nDotV, nDotL, roughness); // Smaller the more micro-facets shadow + vec3 F = SchlickFresnel(hDotV, baseRefl); // Fresnel proportion of specular reflectance + + vec3 spec = (D*G*F)/(4.0*nDotV*nDotL); - vec3 V = normalize(viewPos - fragPosition); + // Difuse and spec light can't be above 1.0 + // kD = 1.0 - kS diffuse component is equal 1.0 - spec comonent + vec3 kD = vec3(1.0) - F; - vec3 e = vec3(0); - e = (texture2D(emissiveMap, vec2(fragTexCoord.x*tiling.x+offset.x, fragTexCoord.y*tiling.y+offset.y)).rgb).g * emissiveColor.rgb*emissivePower * float(useTexEmissive); - - //return N;//vec3(metallic,metallic,metallic); - //if dia-electric use base reflectivity of 0.04 otherwise ut is a metal use albedo as base reflectivity - vec3 baseRefl = mix(vec3(0.04),albedo.rgb,metallic); - vec3 Lo = vec3(0.0); // acumulate lighting lum - - for(int i=0;i Date: Sat, 11 Jan 2025 23:38:21 +0100 Subject: [PATCH 176/194] REVIEWED: `TextJoin()`, convert `const char **` to `char**` It generates multiple issues: https://c-faq.com/ansi/constmismatch.html --- src/raylib.h | 2 +- src/rtext.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index f59e1c041..27a8ab049 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1510,7 +1510,7 @@ RLAPI const char *TextFormat(const char *text, ...); RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string RLAPI char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) -RLAPI char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter +RLAPI char *TextJoin(char **textList, int count, const char *delimiter); // Join text strings with delimiter RLAPI char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string diff --git a/src/rtext.c b/src/rtext.c index b93fa1c32..d8d290053 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1629,7 +1629,7 @@ char *TextInsert(const char *text, const char *insert, int position) // Join text strings with delimiter // REQUIRES: memset(), memcpy() -char *TextJoin(const char **textList, int count, const char *delimiter) +char *TextJoin(char **textList, int count, const char *delimiter) { static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); From 43db59d1aa65ce9a8359fd76675402271547f9da Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 11 Jan 2025 22:38:42 +0000 Subject: [PATCH 177/194] Update raylib_api.* by CI --- parser/output/raylib_api.json | 2 +- parser/output/raylib_api.lua | 2 +- parser/output/raylib_api.txt | 2 +- parser/output/raylib_api.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index c7ebeaf38..0044de007 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -9678,7 +9678,7 @@ "returnType": "char *", "params": [ { - "type": "const char **", + "type": "char **", "name": "textList" }, { diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index d3130a7d9..ccf61cb0b 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -6893,7 +6893,7 @@ return { description = "Join text strings with delimiter", returnType = "char *", params = { - {type = "const char **", name = "textList"}, + {type = "char **", name = "textList"}, {type = "int", name = "count"}, {type = "const char *", name = "delimiter"} } diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index 4d2ed2c93..896efbaff 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -3706,7 +3706,7 @@ Function 430: TextJoin() (3 input parameters) Name: TextJoin Return type: char * Description: Join text strings with delimiter - Param[1]: textList (type: const char **) + Param[1]: textList (type: char **) Param[2]: count (type: int) Param[3]: delimiter (type: const char *) Function 431: TextSplit() (3 input parameters) diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index c2c645977..241b28ae8 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -2454,7 +2454,7 @@ - + From a1896c7a90f241336a216e6fb1bc26dee4603912 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 12 Jan 2025 16:19:10 +0100 Subject: [PATCH 178/194] REVIEWED: Code/Web-Makefile formatting --- examples/Makefile | 30 +-- examples/Makefile.Web | 38 +-- examples/core/core_random_sequence.c | 264 ++++++++++---------- examples/shapes/shapes_rectangle_advanced.c | 156 +++++++----- projects/4coder/Makefile | 24 +- projects/VSCode/Makefile | 24 +- src/Makefile | 19 +- src/minshell.html | 8 +- src/shell.html | 8 +- 9 files changed, 302 insertions(+), 269 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 12d798b50..f8c26f340 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -330,20 +330,20 @@ endif ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # -Os # size optimization # -O2 # optimization level 2, if used, also set --memory-init-file 0 - # -sUSE_GLFW=3 # Use glfw3 library (context/input management) - # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! - # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) - # -sUSE_PTHREADS=1 # multithreading support - # -sWASM=0 # disable Web Assembly, emitted by default - # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS - # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data - # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) - # -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading + # -sUSE_GLFW=3 # Use glfw3 library (context/input management) + # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! + # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) + # -sUSE_PTHREADS=1 # multithreading support + # -sWASM=0 # disable Web Assembly, emitted by default + # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS + # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data + # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) + # -sMINIFY_HTML=0 # minify generated html from shell.html # --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 # --source-map-base # allow debugging in browser with source map - + # --shell-file shell.html # define a custom shell .html and output extension ifeq ($(TARGET_PLATFORM),PLATFORM_WEB) LDFLAGS += -sUSE_GLFW=3 endif @@ -547,10 +547,11 @@ SHAPES = \ shapes/shapes_lines_bezier \ shapes/shapes_logo_raylib \ shapes/shapes_logo_raylib_anim \ + shapes/shapes_rectangle_advanced \ shapes/shapes_rectangle_scaling \ shapes/shapes_splines_drawing \ - shapes/shapes_top_down_lights \ - shapes/shapes_rectangle_advanced + shapes/shapes_top_down_lights + TEXTURES = \ textures/textures_background_scrolling \ @@ -603,6 +604,7 @@ MODELS = \ models/models_draw_cube_texture \ models/models_first_person_maze \ models/models_geometric_shapes \ + models/models_gpu_skinning \ models/models_heightmap \ models/models_loading \ models/models_loading_gltf \ @@ -614,9 +616,9 @@ MODELS = \ models/models_point_rendering \ models/models_rlgl_solar_system \ models/models_skybox \ + models/models_tesseract_view \ models/models_waving_cubes \ - models/models_yaw_pitch_roll \ - models/models_gpu_skinning + models/models_yaw_pitch_roll SHADERS = \ shaders/shaders_basic_lighting \ diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 90345f97d..d44b99dde 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -266,25 +266,25 @@ endif ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # -Os # size optimization # -O2 # optimization level 2, if used, also set --memory-init-file 0 - # -sUSE_GLFW=3 # Use glfw3 library (context/input management) - # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! - # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) - # -sUSE_PTHREADS=1 # multithreading support - # -sWASM=0 # disable Web Assembly, emitted by default - # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS - # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data - # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) - # -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading + # -sUSE_GLFW=3 # Use glfw3 library (context/input management) + # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! + # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) + # -sUSE_PTHREADS=1 # multithreading support + # -sWASM=0 # disable Web Assembly, emitted by default + # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS + # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data + # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) + # -sMINIFY_HTML=0 # minify generated html from shell.html # --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 # --source-map-base # allow debugging in browser with source map - + # --shell-file shell.html # define a custom shell .html and output extension ifeq ($(PLATFORM),PLATFORM_WEB) LDFLAGS += -sUSE_GLFW=3 endif - LDFLAGS += -sEXPORTED_RUNTIME_METHODS=ccall + LDFLAGS += -sEXPORTED_RUNTIME_METHODS=ccall -s # Build using asyncify ifeq ($(BUILD_WEB_ASYNCIFY),TRUE) @@ -428,10 +428,10 @@ SHAPES = \ shapes/shapes_lines_bezier \ shapes/shapes_logo_raylib \ shapes/shapes_logo_raylib_anim \ + shapes/shapes_rectangle_advanced \ shapes/shapes_rectangle_scaling \ shapes/shapes_splines_drawing \ - shapes/shapes_top_down_lights \ - shapes/shapes_rectangle_advanced + shapes/shapes_top_down_lights TEXTURES = \ textures/textures_background_scrolling \ @@ -477,7 +477,6 @@ TEXT = \ MODELS = \ models/models_animation \ - models/models_gpu_skinning \ models/models_billboard \ models/models_bone_socket \ models/models_box_collisions \ @@ -485,6 +484,7 @@ MODELS = \ models/models_draw_cube_texture \ models/models_first_person_maze \ models/models_geometric_shapes \ + models/models_gpu_skinning \ models/models_heightmap \ models/models_loading \ models/models_loading_gltf \ @@ -496,6 +496,7 @@ MODELS = \ models/models_point_rendering \ models/models_rlgl_solar_system \ models/models_skybox \ + models/models_tesseract_view \ models/models_waving_cubes \ models/models_yaw_pitch_roll @@ -524,8 +525,8 @@ SHADERS = \ shaders/shaders_texture_outline \ shaders/shaders_texture_tiling \ shaders/shaders_texture_waves \ - shaders/shaders_write_depth \ - shaders/shaders_vertex_displacement + shaders/shaders_vertex_displacement \ + shaders/shaders_write_depth AUDIO = \ audio/audio_mixed_processor \ @@ -637,7 +638,7 @@ core/core_input_multitouch: core/core_input_multitouch.c core/core_input_virtual_controls: core/core_input_virtual_controls.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) -# NOTE: To use multi-threading raylib must be compiled with multi-theading support (-s USE_PTHREADS=1) +# NOTE: To use multi-threading raylib must be compiled with multi-theading support (-sUSE_PTHREADS=1) # WARNING: For security reasons multi-threading is not supported on browsers, it requires cross-origin isolation (Oct.2021) # WARNING: It requires raylib to be compiled using -pthread, so atomic operations and thread-local data (if any) # in its source were transformed to non-atomic operations and non-thread-local data @@ -998,6 +999,9 @@ models/models_skybox: models/models_skybox.c --preload-file models/resources/shaders/glsl100/cubemap.vs@resources/shaders/glsl100/cubemap.vs \ --preload-file models/resources/shaders/glsl100/cubemap.fs@resources/shaders/glsl100/cubemap.fs +models/models_tesseract_view: models/models_tesseract_view.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + models/models_waving_cubes: models/models_waving_cubes.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) diff --git a/examples/core/core_random_sequence.c b/examples/core/core_random_sequence.c index 2f7c3be95..417440449 100644 --- a/examples/core/core_random_sequence.c +++ b/examples/core/core_random_sequence.c @@ -18,159 +18,169 @@ #include // Required for: malloc() and free() -typedef struct ColorRect{ - Color c; - Rectangle r; +typedef struct ColorRect { + Color c; + Rectangle r; } ColorRect; +//------------------------------------------------------------------------------------ +// Module functions declaration +//------------------------------------------------------------------------------------ static Color GenerateRandomColor(); -static ColorRect* GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight); -static void ShuffleColorRectSequence(ColorRect* rectangles, int rectCount); -static void DrawTextCenterKeyHelp(const char* key, const char* text, int posX, int posY, int fontSize, Color color); +static ColorRect *GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight); +static void ShuffleColorRectSequence(ColorRect *rectangles, int rectCount); +static void DrawTextCenterKeyHelp(const char *key, const char *text, int posX, int posY, int fontSize, Color color); //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ -int main(void) { - // Initialization - //-------------------------------------------------------------------------------------- - const int screenWidth = 800; - const int screenHeight = 450; +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; - InitWindow(screenWidth, screenHeight, "raylib [core] example - Generates a random sequence"); + InitWindow(screenWidth, screenHeight, "raylib [core] example - Generates a random sequence"); - int rectCount = 20; - float rectSize = (float)screenWidth/rectCount; - ColorRect* rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight); + int rectCount = 20; + float rectSize = (float)screenWidth/rectCount; + ColorRect *rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight); - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- + SetTargetFPS(60); + //-------------------------------------------------------------------------------------- - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update - //---------------------------------------------------------------------------------- - - if(IsKeyPressed(KEY_SPACE)) + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key { - ShuffleColorRectSequence(rectangles, rectCount); + // Update + //---------------------------------------------------------------------------------- + if (IsKeyPressed(KEY_SPACE)) ShuffleColorRectSequence(rectangles, rectCount); + + if (IsKeyPressed(KEY_UP)) + { + rectCount++; + rectSize = (float)screenWidth/rectCount; + free(rectangles); + rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight); + } + + if (IsKeyPressed(KEY_DOWN)) + { + if (rectCount >= 4) + { + rectCount--; + rectSize = (float)screenWidth/rectCount; + free(rectangles); + rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight); + } + } + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + int fontSize = 20; + for (int i = 0; i < rectCount; i++) + { + DrawRectangleRec(rectangles[i].r, rectangles[i].c); + DrawTextCenterKeyHelp("SPACE", "to shuffle the sequence.", 10, screenHeight - 96, fontSize, BLACK); + DrawTextCenterKeyHelp("UP", "to add a rectangle and generate a new sequence.", 10, screenHeight - 64, fontSize, BLACK); + DrawTextCenterKeyHelp("DOWN", "to remove a rectangle and generate a new sequence.", 10, screenHeight - 32, fontSize, BLACK); + } + + const char *rectCountText = TextFormat("%d rectangles", rectCount); + int rectCountTextSize = MeasureText(rectCountText, fontSize); + DrawText(rectCountText, screenWidth - rectCountTextSize - 10, 10, fontSize, BLACK); + + DrawFPS(10, 10); + + EndDrawing(); + //---------------------------------------------------------------------------------- } - if(IsKeyPressed(KEY_UP)) - { - rectCount++; - rectSize = (float)screenWidth/rectCount; - free(rectangles); - rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight); - } + // De-Initialization + //-------------------------------------------------------------------------------------- + free(rectangles); + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- - if(IsKeyPressed(KEY_DOWN)) - { - if(rectCount >= 4){ - rectCount--; - rectSize = (float)screenWidth/rectCount; - free(rectangles); - rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight); - } - } - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - - ClearBackground(RAYWHITE); - - int fontSize = 20; - for(int x=0;xc = r2->c; - r1->r.height = r2->r.height; - r1->r.y = r2->r.y; - r2->c = tmp.c; - r2->r.height = tmp.r.height; - r2->r.y = tmp.r.y; - - } - UnloadRandomSequence(seq); + for (int i = 0; i < rectCount; i++) + { + int rectHeight = (int)Remap((float)seq[i], 0, rectCount - 1, 0, screenHeight); + + rectangles[i].c = GenerateRandomColor(); + rectangles[i].r = CLITERAL(Rectangle){ startX + i*rectWidth, screenHeight - rectHeight, rectWidth, (float)rectHeight }; + } + + UnloadRandomSequence(seq); + + return rectangles; } -static void DrawTextCenterKeyHelp(const char* key, const char* text, int posX, int posY, int fontSize, Color color) +static void ShuffleColorRectSequence(ColorRect *rectangles, int rectCount) { - int spaceSize = MeasureText(" ", fontSize); - int pressSize = MeasureText("Press", fontSize); - int keySize = MeasureText(key, fontSize); - int textSize = MeasureText(text, fontSize); - int totalSize = pressSize + 2 * spaceSize + keySize + 2 * spaceSize + textSize; - int textSizeCurrent = 0; + int *seq = LoadRandomSequence(rectCount, 0, rectCount - 1); + + for (int i1 = 0; i1 < rectCount; i1++) + { + ColorRect *r1 = &rectangles[i1]; + ColorRect *r2 = &rectangles[seq[i1]]; - DrawText("Press", posX, posY, fontSize, color); - textSizeCurrent += pressSize + 2 * spaceSize; - DrawText(key, posX + textSizeCurrent, posY, fontSize, RED); - DrawRectangle(posX + textSizeCurrent, posY + fontSize, keySize, 3, RED); - textSizeCurrent += keySize + 2 * spaceSize; - DrawText(text, posX + textSizeCurrent, posY, fontSize, color); + // Swap only the color and height + ColorRect tmp = *r1; + r1->c = r2->c; + r1->r.height = r2->r.height; + r1->r.y = r2->r.y; + r2->c = tmp.c; + r2->r.height = tmp.r.height; + r2->r.y = tmp.r.y; + } + + UnloadRandomSequence(seq); +} + +static void DrawTextCenterKeyHelp(const char *key, const char *text, int posX, int posY, int fontSize, Color color) +{ + int spaceSize = MeasureText(" ", fontSize); + int pressSize = MeasureText("Press", fontSize); + int keySize = MeasureText(key, fontSize); + int textSize = MeasureText(text, fontSize); + int totalSize = pressSize + 2*spaceSize + keySize + 2*spaceSize + textSize; + int textSizeCurrent = 0; + + DrawText("Press", posX, posY, fontSize, color); + textSizeCurrent += pressSize + 2*spaceSize; + DrawText(key, posX + textSizeCurrent, posY, fontSize, RED); + DrawRectangle(posX + textSizeCurrent, posY + fontSize, keySize, 3, RED); + textSizeCurrent += keySize + 2*spaceSize; + DrawText(text, posX + textSizeCurrent, posY, fontSize, color); } \ No newline at end of file diff --git a/examples/shapes/shapes_rectangle_advanced.c b/examples/shapes/shapes_rectangle_advanced.c index e885a10ee..6dd7d2e7e 100644 --- a/examples/shapes/shapes_rectangle_advanced.c +++ b/examples/shapes/shapes_rectangle_advanced.c @@ -1,10 +1,87 @@ +/******************************************************************************************* +* +* raylib [shapes] example - Rectangle advanced +* +* Example originally created with raylib 5.5, last time updated with raylib 5.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) 2024-2025 raylib contributors and Ramon Santamaria (@raysan5) +* +********************************************************************************************/ + #include "raylib.h" + #include "rlgl.h" + #include // Draw rectangle with rounded edges and horizontal gradient, with options to choose side of roundness -// Adapted from both `DrawRectangleRounded` and `DrawRectangleGradientH` -void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float roundnessRight, int segments, Color left, Color right) +static void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float roundnessRight, int segments, Color left, Color right); + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [shapes] example - rectangle avanced"); + + 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 rectangle bounds + //---------------------------------------------------------------------------------- + float width = GetScreenWidth()/2.0f, height = GetScreenHeight()/6.0f; + Rectangle rec = { + GetScreenWidth() / 2.0f - width/2, + GetScreenHeight() / 2.0f - 5*(height/2), + width, height + }; + //-------------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + ClearBackground(RAYWHITE); + + // Draw All Rectangles with different roundess for each side and different gradients + DrawRectangleRoundedGradientH(rec, 0.8f, 0.8f, 36, BLUE, RED); + + rec.y += rec.height + 1; + DrawRectangleRoundedGradientH(rec, 0.5f, 1.0f, 36, RED, PINK); + + rec.y += rec.height + 1; + DrawRectangleRoundedGradientH(rec, 1.0f, 0.5f, 36, RED, BLUE); + + rec.y += rec.height + 1; + DrawRectangleRoundedGradientH(rec, 0.0f, 1.0f, 36, BLUE, BLACK); + + rec.y += rec.height + 1; + DrawRectangleRoundedGradientH(rec, 1.0f, 0.0f, 36, BLUE, PINK); + EndDrawing(); + //-------------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} + +// Draw rectangle with rounded edges and horizontal gradient, with options to choose side of roundness +// NOTE: Adapted from both 'DrawRectangleRounded()' and 'DrawRectangleGradientH()' raylib [rshapes] implementations +static void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float roundnessRight, int segments, Color left, Color right) { // Neither side is rounded if ((roundnessLeft <= 0.0f && roundnessRight <= 0.0f) || (rec.width < 1) || (rec.height < 1 )) @@ -29,7 +106,7 @@ void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float rou float stepLength = 90.0f/(float)segments; /* - Diagram Copied here for reference, original at `DrawRectangleRounded` source code + Diagram Copied here for reference, original at 'DrawRectangleRounded()' source code P0____________________P1 /| |\ @@ -113,12 +190,9 @@ void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float rou } } - // - // Here we use the `Diagram` to guide ourselves to which point receives what color. - // + // Here we use the 'Diagram' to guide ourselves to which point receives what color // By choosing the color correctly associated with a pointe the gradient effect - // will naturally come from OpenGL interpolation. - // + // will naturally come from OpenGL interpolation // [2] Upper Rectangle rlColor4ub(left.r, left.g, left.b, left.a); @@ -187,27 +261,25 @@ void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float rou rlSetTexture(0); #else - // - // Here we use the `Diagram` to guide ourselves to which point receives what color. - // + // Here we use the 'Diagram' to guide ourselves to which point receives what color. // By choosing the color correctly associated with a pointe the gradient effect // will naturally come from OpenGL interpolation. // But this time instead of Quad, we think in triangles. - // rlBegin(RL_TRIANGLES); - // Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner for (int k = 0; k < 4; ++k) { - Color color; - float radius; + Color color = { 0 }; + float radius = 0.0f; if (k == 0) color = left, radius = radiusLeft; // [1] Upper Left Corner if (k == 1) color = right, radius = radiusRight; // [3] Upper Right Corner if (k == 2) color = right, radius = radiusRight; // [5] Lower Right Corner if (k == 3) color = left, radius = radiusLeft; // [7] Lower Left Corner + float angle = angles[k]; const Vector2 center = centers[k]; + for (int i = 0; i < segments; i++) { rlColor4ub(color.r, color.g, color.b, color.a); @@ -274,57 +346,3 @@ void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float rou rlEnd(); #endif } - -int main(int argc, char *argv[]) -{ - // Initialization - //-------------------------------------------------------------------------------------- - const int screenWidth = 800; - const int screenHeight = 450; - InitWindow(screenWidth, screenHeight, "raylib [shapes] example - rectangle avanced"); - SetTargetFPS(60); - //-------------------------------------------------------------------------------------- - - // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key - { - // Update rectangle bounds - //---------------------------------------------------------------------------------- - float width = GetScreenWidth()/2.0f, height = GetScreenHeight()/6.0f; - Rectangle rec = { - GetScreenWidth() / 2.0f - width/2, - GetScreenHeight() / 2.0f - (5)*(height/2), - width, height - }; - //-------------------------------------------------------------------------------------- - - // Draw - //---------------------------------------------------------------------------------- - BeginDrawing(); - ClearBackground(RAYWHITE); - - // Draw All Rectangles with different roundess for each side and different gradients - DrawRectangleRoundedGradientH(rec, 0.8f, 0.8f, 36, BLUE, RED); - - rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 0.5f, 1.0f, 36, RED, PINK); - - rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 1.0f, 0.5f, 36, RED, BLUE); - - rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 0.0f, 1.0f, 36, BLUE, BLACK); - - rec.y += rec.height + 1; - DrawRectangleRoundedGradientH(rec, 1.0f, 0.0f, 36, BLUE, PINK); - EndDrawing(); - //-------------------------------------------------------------------------------------- - } - - // De-Initialization - //-------------------------------------------------------------------------------------- - CloseWindow(); // Close window and OpenGL context - //-------------------------------------------------------------------------------------- - return 0; -} - diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index 641731291..1b598eed5 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -219,21 +219,23 @@ 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 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 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) + # -sUSE_GLFW=3 # Use glfw3 library (context/input management) + # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! + # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) + # -sUSE_PTHREADS=1 # multithreading support + # -sWASM=0 # disable Web Assembly, emitted by default + # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS + # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data + # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) + # -sMINIFY_HTML=0 # minify generated html from shell.html # --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 TOTAL_MEMORY=16777216 --preload-file resources + # --source-map-base # allow debugging in browser with source map + # --shell-file shell.html # define a custom shell .html and output extension + CFLAGS += -Os -sUSE_GLFW=3 -sTOTAL_MEMORY=16777216 --preload-file resources -sMINIFY_HTML=0 ifeq ($(BUILD_MODE), DEBUG) - CFLAGS += -s ASSERTIONS=1 --profiling + CFLAGS += -sASSERTIONS=1 --profiling endif # Define a custom shell .html and output extension diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index 72b850d9b..389a12cf9 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -225,21 +225,23 @@ 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 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 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) + # -sUSE_GLFW=3 # Use glfw3 library (context/input management) + # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! + # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) + # -sUSE_PTHREADS=1 # multithreading support + # -sWASM=0 # disable Web Assembly, emitted by default + # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS + # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data + # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) + # -sMINIFY_HTML=0 # minify generated html from shell.html # --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 TOTAL_MEMORY=16777216 --preload-file resources + # --source-map-base # allow debugging in browser with source map + # --shell-file shell.html # define a custom shell .html and output extension + CFLAGS += -Os -sUSE_GLFW=3 -sTOTAL_MEMORY=16777216 --preload-file resources -sMINIFY_HTML=0 ifeq ($(BUILD_MODE), DEBUG) - CFLAGS += -s ASSERTIONS=1 --profiling + CFLAGS += -sASSERTIONS=1 --profiling endif # Define a custom shell .html and output extension diff --git a/src/Makefile b/src/Makefile index 37554b2a0..a626db52e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -369,20 +369,23 @@ endif ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # -Os # size optimization # -O2 # optimization level 2, if used, also set --memory-init-file 0 - # -sUSE_GLFW=3 # Use glfw3 library (context/input management) -> Only for linker! - # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! - # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) - # -sUSE_PTHREADS=1 # multithreading support - # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data - # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) - # -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading + # -sUSE_GLFW=3 # Use glfw3 library (context/input management) + # -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! + # -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) + # -sUSE_PTHREADS=1 # multithreading support + # -sWASM=0 # disable Web Assembly, emitted by default + # -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS + # -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data + # -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) + # -sMINIFY_HTML=0 # minify generated html from shell.html # --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 + # --source-map-base # allow debugging in browser with source map + # --shell-file shell.html # define a custom shell .html and output extension ifeq ($(RAYLIB_BUILD_MODE),DEBUG) CFLAGS += -sASSERTIONS=1 --profiling endif - #CFLAGS += -sGL_ENABLE_GET_PROC_ADDRESS endif ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) # Compiler flags for arquitecture diff --git a/src/minshell.html b/src/minshell.html index 4068ca36c..ec7158841 100644 --- a/src/minshell.html +++ b/src/minshell.html @@ -34,12 +34,8 @@