Merge branch 'raysan5:master' into classic

This commit is contained in:
Marco Naveni 2026-05-09 16:05:18 -03:00 committed by GitHub
commit 5d549af955
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
85 changed files with 11268 additions and 2551 deletions

4
.gitignore vendored
View File

@ -125,8 +125,8 @@ build-*/
docgen_tmp/
# Tools stuff
tools/parser/rlparser.exe
tools/parser/rlparser
tools/rlparser/rlparser.exe
tools/rlparser/rlparser
tools/rexm/rexm.exe
tools/rexm/rexm

View File

@ -6,11 +6,11 @@ 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.5** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib |
| [raylib](https://github.com/raysan5/raylib) | **6.0** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib |
| [raylib-ada](https://github.com/Fabien-Chouteau/raylib-ada) | **5.5** | [Ada](https://en.wikipedia.org/wiki/Ada_(programming_language)) | MIT |
| [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-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib6.c3l) | **6** | [C3](https://c3-lang.org) | MIT |
| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
@ -28,11 +28,12 @@ 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.5** | [D](https://dlang.org) | Zlib |
| [DenoRaylib550](https://github.com/JJLDonley/DenoRaylib550) | **5.5** | [Deno](https://deno.land) | MIT |
| [raylib-d](https://github.com/schveiguy/raylib-d) | **6.0** | [D](https://dlang.org) | Zlib |
| [Deno-Raylib](https://github.com/JJLDonley/Deno-Raylib) | **6.0** | [Deno / TS](https://deno.land) | MIT |
| [rayex](https://github.com/shiryel/rayex) | 3.7 | [elixir](https://elixir-lang.org) | Apache-2.0 |
| [raylib-elle](https://github.com/acquitelol/elle/blob/rewrite/std/raylib.le) | **5.5** | [Elle](https://github.com/acquitelol/elle) | GPL-3.0 |
| [raylib-factor](https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor) | 5.5 | [Factor](https://factorcode.org) | BSD |
| [raylib4fb](https://github.com/mudhairless/raylib4fb) | **6.0** | [FreeBASIC](https://www.freebasic.net) | Zlib |
| [raylib-freebasic](https://github.com/WIITD/raylib-freebasic) | **5.0** | [FreeBASIC](https://www.freebasic.net) | MIT |
| [raylib.f](https://github.com/cthulhuology/raylib.f) | **5.5** | [Forth](https://forth.com) | Zlib |
| [fortran-raylib](https://github.com/interkosmos/fortran-raylib) | **5.5** | [Fortran](https://fortran-lang.org) | ISC |
@ -63,7 +64,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.5** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)/[Delphi](https://en.wikipedia.org/wiki/Delphi_(software)) | Zlib |
| [Ray4Laz](https://github.com/GuvaCode/Ray4Laz) | **6.0** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)/[Delphi](https://en.wikipedia.org/wiki/Delphi_(software)) | 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.5** | [Python](https://www.python.org) | EPL-2.0 |
@ -76,6 +77,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 |
| [sola-raylib](https://github.com/brettchalupa/sola-raylib) | **6.0** | [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) | **5.5** | [Racket](https://racket-lang.org) | MIT/Apache-2.0 |
@ -85,7 +87,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
| [raylib-umka](https://github.com/robloach/raylib-umka) | 4.5 | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib |
| [raylib-v](https://github.com/vlang/raylib) | 5.5 | [V](https://vlang.io) | MIT/Unlicense |
| [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib |
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib |
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **6.0** | [Vala](https://vala.dev) | Zlib |
| [raylib-wave](https://github.com/wavefnd/raylib-wave) | **auto** |[Wave](http://wave-lang.dev) | Zlib |
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC |
| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **5.6-dev** | [Zig](https://ziglang.org) | MIT |
@ -103,7 +105,8 @@ Some people ported raylib to other languages in the form of bindings or wrappers
| [raylib-jai](https://github.com/ahmedqarmout2/raylib-jai) | **5.5** | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | MIT |
| [fnl-raylib](https://github.com/0riginaln0/fnl-raylib) | **5.5** | [Fennel](https://fennel-lang.org/) | MIT |
| [Rayua](https://github.com/uiua-lang/rayua) | **5.5** | [Uiua](https://www.uiua.org/) | **???** |
| [Target](https://github.com/FinnDemonCat/Target/tree/main/libs/raylib) | **5.5** | [Dart](https://dart.dev/) | Apache-2.0 license |
| [Target](https://github.com/FinnDemonCat/Target/tree/main/libs/raylib) | **5.5** | [Dart](https://dart.dev/) | Apache-2.0 license |
| [gclang-raylib](https://github.com/gnuchanos/gcLang_Compiler/tree/main/windows_version/raylib_version)| **6.0** | [gclang](https://github.com/gnuchanos/gcLang_Compiler) | AGPL-3.0 |
### Utility Wrapers
@ -111,7 +114,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.5** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib |
| [raylib-cpp](https://github.com/robloach/raylib-cpp) | **6.0** | [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 |

View File

@ -1,10 +1,10 @@
changelog
---------
Current Release: raylib 5.5 (18 November 2024)
Current Release: raylib 6.0 (23 April 2026)
-------------------------------------------------------------------------
Release: raylib 6.0 (?? March 2026)
Release: raylib 6.0 (23 April 2026)
-------------------------------------------------------------------------
KEY CHANGES:
- New Software Renderer backend [rlsw]
@ -17,7 +17,7 @@ KEY CHANGES:
- New File System API
- New Text Management API
- New tool: [rexm] raylib examples manager
- Added +50 new examples to learn from
- Added +70 new examples to learn from
Detailed changes:
@ -115,6 +115,7 @@ Detailed changes:
[rcore][GLFW] REVIEWED: `GetGamepadButtonPressed()`, return GAMEPAD_BUTTON_*_TRIGGER_2 if pressed (#4742) by @whaleymar
[rcore][GLFW] REVIEWED: Update `mappings.h` using `GenerateMappings.cmake` by @sleeptightAnsiC
[rcore][RGFW] ADDED: New backend option: `PLATFORM_WEB_RGFW` and update RGFW (#4480) by @colleagueRiley
[rcore][RGFW] ADDED: Support for software rendering (#5773) by @CrackedPixel
[rcore][RGFW] REVIEWED: Added missing Right Control key by @M374LX
[rcore][RGFW] REVIEWED: Changed `RGFW_window_eventWait` timeout to -1 by @doggymangc
[rcore][RGFW] REVIEWED: Duplicate entries removed from `keyMappingRGFW` (#5242) by @iamahuman1395
@ -221,6 +222,7 @@ Detailed changes:
[rlsw] REVIEWED: C++ support (#5291) by @alexgb0
[rshapes] ADDED: `DrawLineDashed()` (#5222) by @luis605
[rshapes] ADDED: `DrawEllipseV()` and `DrawEllipseLinesV()` (#4963) by @meowstr
[rshapes] REDESIGNED: `DrawCircleGradient()` to use Vector2 as center parameter by @raysan5 -WARNING-
[rshapes] REVIEWED: `DrawLine()`, fix pixel offset issue on drawing (#4666) by @Bigfoot71
[rshapes] REVIEWED: `DrawRectangleGradientEx()`, incorrect parameter names (#4980) by @vincent
[rshapes] REVIEWED: `DrawRectangleLines`, fix pixel offset issue (#4669) by @Bigfoot71
@ -285,6 +287,7 @@ Detailed changes:
[rtext] REVIEWED: `TextToFloat()`, remove removed inaccurate comment (#4596) by @hexmaster111
[rtext] REDESIGNED: `LoadFontData()`, added input parameter by @raysan5 -WARNING-
[rmodels] ADDED: Support CPU animation in OpenGL 1.1 (#4925) by @JeffM2501
[rmodels] REMOVED: `DrawModelPoints()` and `DrawModelPointsEx()`, moved to an example (#5697) by @maiconpintoabreu -WARNING-
[rmodels] RENAMED: Skinning shader variables (new default naming) by @raysan5
[rmodels] REVIEWED: glTF animation framerate calculation (#4472, #5445) by @TheLazyIndianTechie
[rmodels] REVIEWED: Assign meshes without bone weights to the bone they are attached to so they animate by @Jeffm2501
@ -311,6 +314,7 @@ Detailed changes:
[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, properly load 1 frame animations (#5561) by @arlez80
[rmodels] REVIEWED: `LoadModelAnimationsGLTF()`, anim correctly inherits world transform (#5206) by @ArmanOmmid
[rmodels] REVIEWED: `UploadMesh()`, improve default normal and tangent values (#4763) by @Bigfoot71
[rmodels] REVIEWED: `UplaodMesh()`, fix for devices without VAO support (#5692) by @psxdev
[rmodels] REVIEWED: `GenMeshTangents()`, improvements (#4937) by @Bigfoot71
[rmodels] REVIEWED: `UpdateModelAnimation()` optimization (#5244) by @Arrangemonk
[rmodels] REVIEWED: `UpdateModelAnimationBones()`, break on first mesh found and formating by @raysan5
@ -322,6 +326,8 @@ Detailed changes:
[rmodels] REVIEWED: `DrawMeshInstanced()`, breaking if instanceTransform was unused (#5469) by @al13n321
[rmodels] REVIEWED: `DrawSphereEx()`, normals support (#4926) by @karl-zylinski
[rmodels] REVIEWED: `ExportMesh()`, improve OBJ vertex data precision and lower memory usage (#4496) by @mikeemm
[rmodels] REVIEWED: `CheckCollisionSpheres()`, simplified using `Vector3DistanceSqr()` (#5695) by @Bigfoot71
[rmodels] REVIEWED: `CheckCollisionBoxSphere()`, improved performance and consistency (#5776) by @maiconpintoabreu
[raudio] REVIEWED: Fix a glitch at the end of a sound (#5578) by @mackron
[raudio] REVIEWED: Improvements to device configuration (#5577) by @mackron
[raudio] REVIEWED: Initialize sound alias properties as if it was a new sound (#5123) by @JeffM2501
@ -406,11 +412,12 @@ Detailed changes:
[build][CMake] REVIEWED: Set `libm` as public so it can be linked by consumer (#5193) by @brccabral
[build][Cmake] REVIEWED: Expose PLATFORM_WEB_RGFW (#5579) by @crisserpl2
[build][Zig] ADDED: Android target to build by @lumenkeyes
[build][Zig] REDESIGNED: Complete refactor of build.zig to support Zig 0.16.0 (#5764) by @HaxSam
[build][Zig] REVIEWED: Link EGL for Android by @lumenkeyes
[build][Zig] REVIEWED: Approach to build for web with zig-build (#5157) by @haxsam
[build][Zig] REVIEWED: Fix build accessing env vars (#5490) by @iisakki
[build][Zig] REVIEWED: Fix emscripten building by @johnnymarler
[build][Zig] REVIWED: Move examples/build.zig into main build.zig by @johnnymarler
[build][Zig] REVIEWED: Move examples/build.zig into main build.zig by @johnnymarler
[build][Zig] REVIEWED: Fix raygui inclusion in windows crosscompilation (#4489) by @kimierik
[build][Zig] REVIEWED: Issue on emscripten run if the user has not installed emsdk by @emilhakimov415
[build][Zig] REVIEWED: Make X11 the default display backend instead of choosing at runtime (#5168) by @Not-Nik
@ -458,6 +465,7 @@ Detailed changes:
[examples] ADDED: `shapes_rlgl_triangle` example (#5353) by @robinsaviary
[examples] ADDED: `shapes_starfield` (#5255) by @themushroompirates
[examples] ADDED: `shapes_triangle_strip` (#5240) by @Jopestpe
[examples] ADDED: `shapes_collision_ellipses` (#5722) by @Monjaris
[examples] ADDED: `text_inline_styling` by @raysan5
[examples] ADDED: `text_strings_management` (#5379) by @davidbuzatto
[examples] ADDED: `text_words_alignment` (#5254) by @themushroompirates

View File

@ -6,7 +6,7 @@ if(EMSCRIPTEN)
# When configuring web builds with "emcmake cmake -B build -S .", set PLATFORM to Web by default
SET(PLATFORM Web CACHE STRING "Platform to build for.")
endif()
enum_option(PLATFORM "Desktop;Web;WebRGFW;Android;Raspberry Pi;DRM;SDL;RGFW" "Platform to build for.")
enum_option(PLATFORM "Desktop;Web;WebRGFW;Android;Raspberry Pi;DRM;SDL;RGFW;Memory" "Platform to build for.")
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0;Software" "Force a specific OpenGL Version?")
@ -29,11 +29,15 @@ 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)
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
include(ParseConfigHeader)
foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS)
string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG})
cmake_dependent_option(${CMAKE_MATCH_1} "" ${CMAKE_MATCH_2} CUSTOMIZE_BUILD ${CMAKE_MATCH_2})
set(CONFIG_HEADER_FLAG_DEFAULT ${CMAKE_MATCH_2})
if (INCLUDE_EVERYTHING AND "${CONFIG_HEADER_FLAG_DEFAULT}" STREQUAL "OFF")
set(CONFIG_HEADER_FLAG_DEFAULT ON)
endif()
cmake_dependent_option(${CMAKE_MATCH_1} "" ${CONFIG_HEADER_FLAG_DEFAULT} CUSTOMIZE_BUILD ${CONFIG_HEADER_FLAG_DEFAULT})
endforeach()

View File

@ -526,26 +526,79 @@ Last but not least, I want to thank **raylib sponsors and all the raylib communi
notes on raylib 6.0
-------------------
A new raylib release is finally ready, after almost 1.5 years since last release. This is the biggest release ever with many improvements to the library, thanks to the support of many amazing contributors and also thanks to the financial support of NLnet/NGI0 funds.
A new `raylib` release is finally ready and, again, this is the **biggest `raylib` release ever**! Thanks to the support of many amazing contributors this release comes packed with many new features and improvements, also thanks to the financial support of [NLnet](https://nlnet.nl/) and the [NGI Zero Commond Fund](https://nlnet.nl/NGI0/) that allow me to work on this project mostly fulltime for the past few months.
Some astonishing numbers for this release:
- **+320** closed issues (for a TOTAL of **+2130**!)
- **+1800** commits since previous RELEASE (for a TOTAL of **+9600**!)
- **18** functions ADDED to raylib API (for a TOTAL of **599**!)
- **+50** new examples to learn from (for a TOTAL of **212**!)
- **+200** new contributors (for a TOTAL of **+840**!)
- **+330** closed issues (for a TOTAL of **+2150**!)
- **+2000** commits since previous RELEASE (for a TOTAL of **+9760**!)
- **+20** new functions ADDED to raylib API (for a TOTAL of **600**!)
- **+70** new examples to learn from (for a TOTAL of **+215**!)
- **+210** new contributors (for a TOTAL of **+850**!)
Highlights for `raylib 6.0`:
- New Software Renderer backend [rlsw]
- New rcore platform backend: Memory (memory buffer)
- New rcore platform backend: Win32 (experimental)
- New rcore platform backend: Emscripten (experimental)
- Redesigned Skeletal Animation System
- Redesigned fullscreen modes and high-dpi content scaling
- Redesigned Build Config System [config.h]
- New File System API
- New Text Management API
- New tool: [rexm] raylib examples manager
- **`NEW` Software Renderer - [`rlsw`](https://github.com/raysan5/raylib/blob/master/src/external/rlsw.h)**: The biggest addition of this new release. A new software renderer backend, that allows raylib to run purely on CPU, with no neeed for a GPU. It finally closes the circle of my search for a portable self-contained, with **no-external-dependencies**, graphics library, able to run on any device providing some CPU-power and some RAM memory. It has been possible thanks to the amazing work of **Le Juez Victor** ([@Bigfoot71](https://github.com/Bigfoot71)), who created [`rlsw`](https://github.com/raysan5/raylib/blob/master/src/external/rlsw.h), a single-file header-only library implementing OpenGL 1.1+ specification, tailored to fit into raylib [`rlgl`](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) OpenGL wrapper, and allowing to run raylib seamlessly over CPU with **no code changes required on user side**. As expected, software rendering is slower than hardware-accelerated rendering but it is still fast enough to run basic application at 30-60 fps. Actually, it already proved it usefulness on a new [raylib port for ESP32](https://components.espressif.com/components/georgik/raylib/versions/6.0.0/readme) microcontroller by Espressif, useful for industrial applications, and opens the door to the upcoming RISC-V powered devices that start arriving to the marked, and many times come with no GPU. Along the new software renderer, some of the existing platform backends have been adapted to support it (SDL, RGFW, DRM) and also **new platforms backends have been created** to accomodate it (Win32, Emscripten), incluing a new `PLATFORM_MEMORY`, that allows direct rendering to a memory framebuffer.
- **`NEW` Platform backend: Memory - [`rcore_memory`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_memory.c)**: This new platform has been added along the **software renderer** backend, allowing 2d and 3d rendering over a **platform-agnostic memory framebuffer**, it can run headless and output frames can be directly exported to images. This new backend could also be useful for graphics rendering on servers or process images directly using the memory buffer.
- **`NEW` Platform backend: Win32 - [`rcore_desktop_win32`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_win32.c)**: A new **Windows platform backend** and the first step towards a potential replacement/alternative to the platform libraries currently used by raylib (GLFW/SDL/RGFW). This backend follows same API template structure than the other raylib backends, but directly implementing Win32 API calls. It allows initializing OpenGL GPU-accelerated windows and also GDI based windows, useful for the software renderer backend. This new backend approach, following a common template-structure and separating the platform logic by specific OS/Windowing system, will simplify code, improve maintenance, readability and portability for raylib, setting some bases for the future. *NOTE: This backend is new and it could require further testing, use it as an experimental backend for now.*
- **`NEW` Platform backend: Emscripten - [`rcore_web_emscripten`](https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_web_emscripten.c)**: In the same line as Win32 backend, this new web backend moves away from `libglfw.js` and **directly implements Emscripten/JS functionality**, with **no other dependencies**, adding support for the new software renderer to draw directly on a **non-accelerated 2d canvas** but also supporting a WebGL-hardware-accelerated canvas when required. *NOTE: This backend is new and it could require further testing, use it as an experimental backend for now.*
- **`REDESIGNED` Fullscreen modes and High-DPI content scaling**: After many years and many related issues, the full-screen and high-dpi content scaling support has been **completely redesigned** from scratch. New design prioritizes **borderless fullscreen modes** and automatically detects current monitor content scaling configuration to scale window and framebuffer accordingly when required. Still, High-DPI support must be requested by user if desired enabling `FLAG_WINDOW_HIGHDPI` on window creation. This new system has been carefully tested on Windows, Linux (X11, Wayland), macOS with multiple monitors and multiple resolutions, including 4K monitors.
- **`REDESIGNED` Skeletal Animation System**: A new animation system for 3d models has been created to support animation blending, between single frames but also between differents frames on different animations, to allow easy **timed transitions** between animations. This redesign implied reviewing several raylib structures to better accomodate animation data: `Model`, `ModelSkeleton`, `ModelAnimation`, but the API was simplified and support for GPU-skinning was improved with multiple optimizations.
- **`REDESIGNED` Build Config System - [`config.h`](https://github.com/raysan5/raylib/blob/master/src/config.h)**: raylib allows lot of customization for specific needs (i.e. disabling modules not needed for specific applications like rmodels or raudio) but previous implementation did not allow easely disabling some features from **custom build systems**. New design not only allows disabling features with simple `-DSUPPORT_FILEFORMAT_OBJ=0` on building command-line but also the full system has been reviewed, removing useless flags and exposing new ones.
- **`NEW` File System API**: Along the years, multiple filesystem functions have been added to raylib API as required but it felt somewhat inconsistent with some pieces missing. In this new release, the full filesystem API has beeen reviewed and reorganized, compiling all the functionality single module: [rcore](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L1126), consequently `utils` module has been removed and build system has been simplified even more; **only 6-7 modules (.c) need to be compiled containing the full raylib library**. This new filesystem API will allow raylib to be used on the creation of custom build systems, as already demostrated with the new `rexm` tool for examples management. At the moment raylib includes **+40 file system management functions**, here a list with the new functions added:
```c
int FileRename(const char *fileName, const char *fileRename); // Rename file (if exists)
int FileRemove(const char *fileName); // Remove file (if exists)
int FileCopy(const char *srcPath, const char *dstPath); // Copy file from one path to another, dstPath created if it doesn't exist
int FileMove(const char *srcPath, const char *dstPath); // Move file from one directory to another, dstPath created if it doesn't exist
int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file
int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file
```
- **`NEW` Text Management API**: Along with the new file system functionality, a new set of text management functions has been added, also very useful for text procesing and also used in custom build systems creation using raylib. At the moment raylib includes **+30 text management functions**, here a list with the new functions added:
```c
char **LoadTextLines(const char *text, int *count); // Load text as separate lines ('\n')
void UnloadTextLines(char **text, int lineCount); // Unload text lines
const char *TextRemoveSpaces(const char *text); // Remove text spaces, concat words
char *GetTextBetween(const char *text, const char *begin, const char *end); // Get text between two strings
char *TextReplace(const char *text, const char *search, const char *replacement); // Replace text string with new string
char *TextReplaceAlloc(const char *text, const char *search, const char *replacement); // Replace text string with new string, memory must be MemFree()
char *TextReplaceBetween(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings
char *TextReplaceBetweenAlloc(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings, memory must be MemFree()
char *TextInsertAlloc(const char *text, const char *insert, int position); // Insert text in a defined byte position, memory must be MemFree()
```
- **`NEW` tool: raylib examples manager - [rexm](https://github.com/raysan5/raylib/tree/master/tools/rexm)**: raylib examples collection is huge, with **more than 200 examples** it was quite difficult to manage: adding, removing, renaming examples was a very costly process involving many files to be modified (including build systems), also the examples did not follow a common header convention neither a structure conventions. For that reason, a new support tool has been created: **rexm**, a raylib examples manager that allows to easely add/remove/rename examples, automatically fix inconsistencies and even **building and automated testing** on multiple platforms.
```
USAGE:
> rexm <command> <example_name> [<example_rename>]
COMMANDS:
create <new_example_name> : Creates an empty example, from internal template
add <example_name> : Add existing example to collection
rename <old_examples_name> <new_example_name> : Rename an existing example
remove <example_name> : Remove an existing example from collection
build <example_name> : Build example for Desktop and Web platforms
test <example_name> : Build and Test example for Desktop and Web platforms
validate : Validate examples collection, generates report
update : Validate and update examples collection, generates report
```
- **`NEW` +70 new examples**: Thanks to `rexm` and the simplification on examples management, this new raylib release includes +70 new examples to learn from, most of them contributed by community. Multiple examples have also been renamed for consistency and all examples header and structure have been reviewed and unified.
Make sure to check raylib [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) for a detailed list of changes!
I want to **thank all the contributors (+850!**) that along the years have **greatly improved raylib** and pushed it further and better day after day. And **many thanks to raylib community and all raylib users** for supporting the library along those many years.
Finally, I want to thank [puffer.ai](https://puffer.ai/) and [comma.ai](https://comma.ai/) for **using raylib and supporting the project** as platinum sponsors, along many others individuals that have been sponsoring raylib along the years. Thanks to all of you for allowing me to keep working on this library!
**After +12 years of development, `raylib 6.0` is today one of the bests libraries to enjoy games/tools/graphics programming!**
**Enjoy graphics programming with raylib!** :)

View File

@ -19,7 +19,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.5)](https://github.com/raysan5/raylib/commits/master)
[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/6.0)](https://github.com/raysan5/raylib/commits/master)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/raysan5?label=sponsors)](https://github.com/sponsors/raysan5)
[![Packaging Status](https://repology.org/badge/tiny-repos/raylib.svg)](https://repology.org/project/raylib/versions)
[![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE)

877
build.zig

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
.{
.name = .raylib,
.version = "5.6.0-dev",
.minimum_zig_version = "0.15.1",
.version = "6.0.0",
.minimum_zig_version = "0.16.0",
.fingerprint = 0x13035e5cb8bc1ac2, // Changing this has security and trust implications.
@ -11,6 +11,11 @@
.hash = "N-V-__8AALShqgXkvqYU6f__FrA22SMWmi2TXCJjNTO1m8XJ",
.lazy = true,
},
.raygui = .{
.url = "git+https://github.com/raysan5/raygui#3b2855842ab578a034f827c38cf8f62c042fc983",
.hash = "N-V-__8AAHvybwBw1kyBGn0BW_s1RqIpycNjLf_XbE-fpLUF",
.lazy = true,
},
.emsdk = .{
.url = "git+https://github.com/emscripten-core/emsdk#4.0.9",
.hash = "N-V-__8AAJl1DwBezhYo_VE6f53mPVm00R-Fk28NPW7P14EQ",

View File

@ -7,6 +7,30 @@ if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif()
include(CheckCSourceCompiles)
include(CMakePushCheckState)
function(raylib_check_libatomic_required result)
set(_atomic_test_source "
int main(void)
{
volatile long long value = 0;
return (int)__atomic_fetch_add(&value, 1, __ATOMIC_SEQ_CST);
}")
check_c_source_compiles("${_atomic_test_source}" RAYLIB_ATOMICS_WITHOUT_LIBATOMIC)
if (RAYLIB_ATOMICS_WITHOUT_LIBATOMIC)
set(${result} FALSE PARENT_SCOPE)
else ()
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_LIBRARIES atomic)
check_c_source_compiles("${_atomic_test_source}" RAYLIB_ATOMICS_WITH_LIBATOMIC)
cmake_pop_check_state()
set(${result} ${RAYLIB_ATOMICS_WITH_LIBATOMIC} PARENT_SCOPE)
endif ()
endfunction()
set(RAYLIB_DEPENDENCIES "include(CMakeFindDependencyMacro)")
if (${PLATFORM} STREQUAL "Desktop")
@ -96,21 +120,30 @@ elseif (${PLATFORM} STREQUAL "Android")
elseif ("${PLATFORM}" STREQUAL "DRM")
set(PLATFORM_CPP "PLATFORM_DRM")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
add_definitions(-D_DEFAULT_SOURCE)
add_definitions(-DEGL_NO_X11)
add_definitions(-DPLATFORM_DRM)
find_library(GLESV2 GLESv2)
find_library(EGL EGL)
find_library(DRM drm)
find_library(GBM gbm)
if (NOT CMAKE_CROSSCOMPILING OR NOT CMAKE_SYSROOT)
include_directories(/usr/include/libdrm)
endif ()
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread dl)
if ("${OPENGL_VERSION}" STREQUAL "Software")
# software rendering does not require EGL/GBM.
set(GRAPHICS "GRAPHICS_API_OPENGL_SOFTWARE")
set(LIBS_PRIVATE ${DRM} atomic pthread dl)
else ()
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
add_definitions(-DEGL_NO_X11)
find_library(GLESV2 GLESv2)
find_library(EGL EGL)
find_library(GBM gbm)
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread dl)
endif ()
set(LIBS_PUBLIC m)
elseif ("${PLATFORM}" STREQUAL "SDL")
@ -147,6 +180,7 @@ elseif ("${PLATFORM}" STREQUAL "SDL")
add_compile_definitions(USING_SDL2_PACKAGE)
endif()
endif()
elseif ("${PLATFORM}" STREQUAL "RGFW")
set(PLATFORM_CPP "PLATFORM_DESKTOP_RGFW")
@ -172,6 +206,15 @@ elseif ("${PLATFORM}" STREQUAL "WebRGFW")
set(PLATFORM_CPP "PLATFORM_WEB_RGFW")
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
elseif ("${PLATFORM}" STREQUAL "Memory")
set(PLATFORM_CPP "PLATFORM_MEMORY")
set(GRAPHICS "GRAPHICS_API_OPENGL_SOFTWARE")
set(OPENGL_VERSION "Software")
if(WIN32 OR CMAKE_C_COMPILER MATCHES "mingw|mingw32|mingw64")
set(LIBS_PRIVATE winmm)
endif()
endif ()
if (NOT ${OPENGL_VERSION} MATCHES "OFF")
@ -203,6 +246,14 @@ endif ()
set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY})
if (SUPPORT_MODULE_RAUDIO AND UNIX AND NOT APPLE)
raylib_check_libatomic_required(RAYLIB_LIBATOMIC_REQUIRED)
if (RAYLIB_LIBATOMIC_REQUIRED)
message(STATUS "64-bit atomics require libatomic")
list(APPEND LIBS_PRIVATE atomic)
endif ()
endif ()
if (${PLATFORM} MATCHES "Desktop")
set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw)
endif ()

View File

@ -10,7 +10,9 @@ string(REGEX MATCHALL ${MACRO_REGEX} MACRO_LIST ${CONFIG_HEADER_CONTENT})
set(CONFIG_HEADER_FLAGS ${MACRO_LIST})
list(FILTER CONFIG_HEADER_FLAGS INCLUDE REGEX "^.+SUPPORT_")
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=OFF]] REGEX "^//")
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=ON]])
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE ${MACRO_REGEX} [[\2=\3]] REGEX "^[^/]")
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE [[=0$]] [[=OFF]])
list(TRANSFORM CONFIG_HEADER_FLAGS REPLACE [[=1$]] [[=ON]])
set(CONFIG_HEADER_VALUES ${MACRO_LIST})
list(FILTER CONFIG_HEADER_VALUES EXCLUDE REGEX "(^.+SUPPORT_)|(^//)")

View File

@ -98,13 +98,15 @@ if (${PLATFORM} MATCHES "Android")
elseif (${PLATFORM} MATCHES "Web")
set(example_sources) # clear example_sources
list(APPEND example_sources others/web_basic_window.c)
list(APPEND example_sources core/core_input_gestures_testbed.c)
elseif ("${PLATFORM}" STREQUAL "DRM")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
elseif ("${PLATFORM}" MATCHES "Memory")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)
elseif ("${OPENGL_VERSION}" STREQUAL "Software")
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/rlgl_standalone.c)
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c)

View File

@ -510,7 +510,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
# Libraries for Windows desktop compilation
LDFLAGS += -L..\src
LDLIBS = -lraylib -lgdi32 -lwinmm -lshcore
ifneq ($(GRAPHICS),GRAPHICS_API_OPENGL_11_SOFTWARE)
ifneq ($(GRAPHICS),GRAPHICS_API_OPENGL_SOFTWARE)
LDLIBS += -lopengl32
endif
endif

View File

@ -2,7 +2,7 @@
#
# raylib makefile for Android project (APK building)
#
# Copyright (c) 2017-2025 Ramon Santamaria (@raysan5)
# Copyright (c) 2017-2026 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.

View File

@ -0,0 +1,238 @@
/*******************************************************************************************
*
* raylib [audio] example - amp envelope
*
* Example complexity rating: [] 1/4
*
* Example originally created with raylib 6.0, last time updated with raylib 6.0
*
* Example contributed by Arbinda Rizki Muhammad (@arbipink) and reviewed by Ramon Santamaria (@raysan5)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2026 Arbinda Rizki Muhammad (@arbipink)
*
********************************************************************************************/
#include "raylib.h"
#define RAYGUI_IMPLEMENTATION
#include "raygui.h"
#include <math.h> // Required for: sinf()
#define BUFFER_SIZE 4096
#define SAMPLE_RATE 44100
// Wave state
typedef enum {
IDLE,
ATTACK,
DECAY,
SUSTAIN,
RELEASE
} ADSRState;
// Grouping all ADSR parameters and state into a struct
typedef struct {
float attackTime;
float decayTime;
float sustainLevel;
float releaseTime;
float currentValue;
ADSRState state;
} Envelope;
//------------------------------------------------------------------------------------
// Module Functions Declaration
//------------------------------------------------------------------------------------
static void FillAudioBuffer(int i, float *buffer, float envelopeValue, float *audioTime);
static void UpdateEnvelope(Envelope *env);
static void DrawADSRGraph(Envelope *env, Rectangle bounds);
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [audio] example - amp envelope");
InitAudioDevice();
// Set the number of samples the stream will keep in memory at a time to BUFFER_SIZE
SetAudioStreamBufferSizeDefault(BUFFER_SIZE);
float buffer[BUFFER_SIZE] = { 0 };
// Init raw audio stream (sample rate: 44100, sample size: 32bit-float, channels: 1-mono)
AudioStream stream = LoadAudioStream(SAMPLE_RATE, 32, 1);
// Init Phase
float audioTime = 0.0f;
// Initialize the struct
Envelope env = {
.attackTime = 1.0f,
.decayTime = 1.0f,
.sustainLevel = 0.5f,
.releaseTime = 1.0f,
.currentValue = 0.0f,
.state = IDLE
};
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose())
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_SPACE)) env.state = ATTACK;
if (IsKeyReleased(KEY_SPACE) && (env.state != IDLE)) env.state = RELEASE;
if (IsAudioStreamProcessed(stream))
{
if ((env.state != IDLE) || (env.currentValue > 0.0f))
{
for (int i = 0; i < BUFFER_SIZE; i++)
{
UpdateEnvelope(&env);
FillAudioBuffer(i, buffer, env.currentValue, &audioTime);
}
}
else
{
// Clear buffer if silent to avoid looping noise
for (int i = 0; i < BUFFER_SIZE; i++) buffer[i] = 0;
audioTime = 0.0f;
}
UpdateAudioStream(stream, buffer, BUFFER_SIZE);
}
if (!IsAudioStreamPlaying(stream)) PlayAudioStream(stream);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
GuiSliderBar((Rectangle){ 100, 60, 400, 30 }, "Attack (s)", TextFormat("%2.2fs", env.attackTime), &env.attackTime, 0.1f, 3.0f);
GuiSliderBar((Rectangle){ 100, 100, 400, 30 }, "Decay (s)", TextFormat("%2.2fs", env.decayTime), &env.decayTime, 0.1f, 3.0f);
GuiSliderBar((Rectangle){ 100, 140, 400, 30 }, "Sustain", TextFormat("%2.2f", env.sustainLevel), &env.sustainLevel, 0.0f, 1.0f);
GuiSliderBar((Rectangle){ 100, 180, 400, 30 }, "Release (s)", TextFormat("%2.2fs", env.releaseTime), &env.releaseTime, 0.1f, 3.0f);
DrawADSRGraph(&env, (Rectangle){ 100, 250, 400, 100 });
DrawCircleV((Vector2){ 520, 350 - (env.currentValue * 100) }, 5, MAROON);
DrawText(TextFormat("Current Gain: %2.2f", env.currentValue), 535, 345 - (env.currentValue * 100), 10, MAROON);
DrawText("Press SPACE to PLAY the sound!", 200, 400, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadAudioStream(stream);
CloseAudioDevice();
CloseWindow();
//--------------------------------------------------------------------------------------
return 0;
}
//------------------------------------------------------------------------------------
// Module Functions Definition
//------------------------------------------------------------------------------------
static void FillAudioBuffer(int i, float *buffer, float envelopeValue, float *audioTime)
{
int frequency = 440;
buffer[i] = envelopeValue*sinf(2.0f*PI*frequency*(*audioTime));
*audioTime += (1.0f/SAMPLE_RATE);
}
static void UpdateEnvelope(Envelope *env)
{
// Calculate the time delta for ONE sample (1/44100)
float sampleTime = 1.0f/SAMPLE_RATE;
switch(env->state)
{
case ATTACK:
{
env->currentValue += (1.0f/env->attackTime)*sampleTime;
if (env->currentValue >= 1.0f)
{
env->currentValue = 1.0f;
env->state = DECAY;
}
} break;
case DECAY:
{
env->currentValue -= ((1.0f - env->sustainLevel)/env->decayTime)*sampleTime;
if (env->currentValue <= env->sustainLevel)
{
env->currentValue = env->sustainLevel;
env->state = SUSTAIN;
}
} break;
case SUSTAIN:
{
env->currentValue = env->sustainLevel;
} break;
case RELEASE:
{
env->currentValue -= (env->sustainLevel/env->releaseTime)*sampleTime;
if (env->currentValue <= 0.001f) // Use a small threshold to avoid infinite tail
{
env->currentValue = 0.0f;
env->state = IDLE;
}
} break;
default: break;
}
}
static void DrawADSRGraph(Envelope *env, Rectangle bounds)
{
DrawRectangleRec(bounds, Fade(LIGHTGRAY, 0.3f));
DrawRectangleLinesEx(bounds, 1, GRAY);
// Fixed visual width for sustain stage since it's an amplitude not a time value
float sustainWidth = 1.0f;
// Total time to visualize (sum of A, D, R + a padding for Sustain)
float totalTime = env->attackTime + env->decayTime + sustainWidth + env->releaseTime;
float scaleX = bounds.width/totalTime;
float scaleY = bounds.height;
Vector2 start = { bounds.x, bounds.y + bounds.height };
Vector2 peak = { start.x + (env->attackTime*scaleX), bounds.y };
Vector2 sustain = { peak.x + (env->decayTime*scaleX), bounds.y + (1.0f - env->sustainLevel)*scaleY };
Vector2 rel = { sustain.x + (sustainWidth*scaleX), sustain.y };
Vector2 end = { rel.x + (env->releaseTime*scaleX), bounds.y + bounds.height };
DrawLineV(start, peak, SKYBLUE);
DrawLineV(peak, sustain, BLUE);
DrawLineV(sustain, rel, DARKBLUE);
DrawLineV(rel, end, ORANGE);
DrawText("ADSR Visualizer", bounds.x, bounds.y - 20, 10, DARKGRAY);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

6051
examples/audio/raygui.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
* Copyright (c) 2013-2026 Ramon Santamaria (@raysan5)
*
********************************************************************************************/

View File

@ -21,6 +21,7 @@
#include "raygui.h" // Required for GUI controls
#define MAX_FILEPATH_SIZE 1024
#define FILE_FILTER "DIRS*;.png;.c"
//------------------------------------------------------------------------------------
// Program main entry point
@ -41,7 +42,7 @@ int main(void)
// NOTE: LoadDirectoryFiles() loads files and directories by default,
// use LoadDirectoryFilesEx() for custom filters and recursive directories loading
//FilePathList files = LoadDirectoryFiles(directory);
FilePathList files = LoadDirectoryFilesEx(directory, ".png;.c", false);
FilePathList files = LoadDirectoryFilesEx(directory, FILE_FILTER, false);
int btnBackPressed = false;
@ -61,7 +62,22 @@ int main(void)
{
TextCopy(directory, GetPrevDirectoryPath(directory));
UnloadDirectoryFiles(files);
files = LoadDirectoryFiles(directory);
files = LoadDirectoryFilesEx(directory, FILE_FILTER, false);
listScrollIndex = 0;
listItemActive = -1;
listItemFocused = -1;
}
if ((listItemActive >= 0) && (listItemActive < (int)files.count) && DirectoryExists(files.paths[listItemActive]))
{
TextCopy(directory, files.paths[listItemActive]);
UnloadDirectoryFiles(files);
files = LoadDirectoryFilesEx(directory, FILE_FILTER, false);
listScrollIndex = 0;
listItemActive = -1;
listItemFocused = -1;
}
//----------------------------------------------------------------------------------

View File

@ -52,7 +52,7 @@ int main(void)
// The target's height is flipped (in the source Rectangle), due to OpenGL reasons
Rectangle sourceRec = { 0.0f, 0.0f, (float)target.texture.width, -(float)target.texture.height };
Rectangle destRec = { -virtualRatio, -virtualRatio, screenWidth + (virtualRatio*2), screenHeight + (virtualRatio*2) };
Rectangle destRec = { (screenWidth - screenWidth/1.25f)/2.0f, (screenHeight - screenHeight/1.25f)/2.0f, screenWidth/1.25f, screenHeight/1.25f };
Vector2 origin = { 0.0f, 0.0f };
@ -61,6 +61,9 @@ int main(void)
float cameraX = 0.0f;
float cameraY = 0.0f;
bool smoothOn = true;
bool overscan = false;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@ -86,6 +89,18 @@ int main(void)
worldSpaceCamera.target.y = truncf(screenSpaceCamera.target.y);
screenSpaceCamera.target.y -= worldSpaceCamera.target.y;
screenSpaceCamera.target.y *= virtualRatio;
if (IsKeyPressed(KEY_S)) smoothOn = !smoothOn;
if (IsKeyPressed(KEY_O)) overscan = !overscan;
if (overscan)
{
destRec = (Rectangle) { -virtualRatio, -virtualRatio, screenWidth + (virtualRatio*2), screenHeight + (virtualRatio*2) };
}
else
{
destRec = (Rectangle) { (screenWidth - screenWidth/1.25f)/2.0f, (screenHeight - screenHeight/1.25f)/2.0f, screenWidth/1.25f, screenHeight/1.25f };
}
//----------------------------------------------------------------------------------
// Draw
@ -101,14 +116,23 @@ int main(void)
EndTextureMode();
BeginDrawing();
ClearBackground(RED);
ClearBackground(LIGHTGRAY);
BeginMode2D(screenSpaceCamera);
if (smoothOn)
{
BeginMode2D(screenSpaceCamera);
DrawTexturePro(target.texture, sourceRec, destRec, origin, 0.0f, WHITE);
EndMode2D();
}
else
{
DrawTexturePro(target.texture, sourceRec, destRec, origin, 0.0f, WHITE);
EndMode2D();
}
DrawText(TextFormat("Screen resolution: %ix%i", screenWidth, screenHeight), 10, 10, 20, DARKBLUE);
DrawText(TextFormat("World resolution: %ix%i", virtualScreenWidth, virtualScreenHeight), 10, 40, 20, DARKGREEN);
DrawText(TextFormat("Smooth: %s", (smoothOn ? "ON" : "OFF")), 10, screenHeight - 60, 20, RED);
DrawText(TextFormat("Overscan: %s", (overscan ? "ON" : "OFF")), 10, screenHeight - 30, 20, RED);
DrawFPS(GetScreenWidth() - 95, 10);
EndDrawing();
//----------------------------------------------------------------------------------
@ -122,4 +146,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
GLFW_ICON ICON "raylib.ico"
1 VERSIONINFO
FILEVERSION 5,5,0,0
PRODUCTVERSION 5,5,0,0
FILEVERSION 6,0,0,0
PRODUCTVERSION 6,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
@ -11,12 +11,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "raylib technologies"
VALUE "FileDescription", "raylib application (www.raylib.com)"
VALUE "FileVersion", "5.5.0"
VALUE "FileVersion", "6.0.0"
VALUE "InternalName", "raylib-example"
VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria (@raysan5)"
VALUE "LegalCopyright", "(c) 2026 Ramon Santamaria (@raysan5)"
VALUE "OriginalFilename", "raylib-example"
VALUE "ProductName", "raylib-example"
VALUE "ProductVersion", "5.5.0"
VALUE "ProductVersion", "6.0.0"
END
END
BLOCK "VarFileInfo"

View File

@ -69,7 +69,7 @@ int main(void)
DrawText("USING DEFAULT SHADER", 20, 40, 10, RED);
DrawCircle(80, 120, 35, DARKBLUE);
DrawCircleGradient(80, 220, 60, GREEN, SKYBLUE);
DrawCircleGradient((Vector2){ 80.0f, 220.0f }, 60, GREEN, SKYBLUE);
DrawCircleLines(80, 340, 80, DARKBLUE);

View File

@ -17,6 +17,8 @@
#include "raylib.h"
#include "raymath.h"
#include <stdlib.h> // Required for: malloc(), free()
#include <math.h> // Required for: hypot()
@ -68,6 +70,8 @@ int main(void)
Vector2 pressOffset = { 0 }; // Mouse press offset relative to the ball that grabbedd
float gravity = 100; // World gravity
Vector2 windowPosition = GetWindowPosition();
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//---------------------------------------------------------------------------------------
@ -128,6 +132,17 @@ int main(void)
}
}
// Get window position change for shaking
Vector2 windowPositionDelta = Vector2Subtract(windowPosition, GetWindowPosition());
if (Vector2Length(windowPositionDelta) > 5.0f)
{
for (int i = 0; i < ballCount; i++)
{
if (!balls[i].grabbed) balls[i].speed = Vector2Add(balls[i].speed, Vector2Scale(windowPositionDelta, 10.0f));
}
}
// Shake balls
if (IsMouseButtonPressed(MOUSE_BUTTON_MIDDLE))
{
@ -194,6 +209,8 @@ int main(void)
ball->prevPosition = ball->position;
}
}
windowPosition = GetWindowPosition();
//----------------------------------------------------------------------------------
// Draw
@ -222,8 +239,9 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
RL_FREE(balls);
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
}

View File

@ -50,7 +50,7 @@ int main(void)
// Circle shapes and lines
DrawCircle(screenWidth/5, 120, 35, DARKBLUE);
DrawCircleGradient(screenWidth/5, 220, 60, GREEN, SKYBLUE);
DrawCircleGradient((Vector2){ screenWidth/5.0f, 220.0f }, 60, GREEN, SKYBLUE);
DrawCircleLines(screenWidth/5, 340, 80, DARKBLUE);
DrawEllipse(screenWidth/5, 120, 25, 20, YELLOW);
DrawEllipseLines(screenWidth/5, 120, 30, 25, YELLOW);

View File

@ -0,0 +1,133 @@
/*******************************************************************************************
*
* raylib [shapes] example - ellipse collision
*
* Example complexity rating: [] 2/4
*
* Example originally created with raylib 5.5, last time updated with raylib 5.5
*
* Example contributed by Ziya (@Monjaris)
*
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software
*
* Copyright (c) 2025 Ziya (@Monjaris)
*
********************************************************************************************/
#include "raylib.h"
#include <math.h>
// Check if point is inside ellipse
static bool CheckCollisionPointEllipse(Vector2 point, Vector2 center, float rx, float ry)
{
float dx = (point.x - center.x)/rx;
float dy = (point.y - center.y)/ry;
return (dx*dx + dy*dy) <= 1.0f;
}
// Check if two ellipses collide
// Uses radial boundary distance in the direction between centers — scales correctly with radii
static bool CheckCollisionEllipses(Vector2 c1, float rx1, float ry1, Vector2 c2, float rx2, float ry2)
{
float dx = c2.x - c1.x;
float dy = c2.y - c1.y;
float dist = sqrtf(dx*dx + dy*dy);
// Ellipses are on top of each other
if (dist == 0.0f) return true;
float theta = atan2f(dy, dx);
float cosT = cosf(theta);
float sinT = sinf(theta);
// Radial distance from center to ellipse boundary in direction theta
// r(theta) = (rx * ry) / sqrt((ry*cos)^2 + (rx*sin)^2)
float r1 = (rx1*ry1)/sqrtf((ry1*cosT)*(ry1*cosT) + (rx1*sinT)*(rx1*sinT));
float r2 = (rx2*ry2)/sqrtf((ry2*cosT)*(ry2*cosT) + (rx2*sinT)*(rx2*sinT));
return dist <= (r1 + r2);
}
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - collision ellipses");
SetTargetFPS(60);
Vector2 ellipseACenter = { (float)screenWidth/4, (float)screenHeight/2 };
float ellipseARx = 120.0f;
float ellipseARy = 70.0f;
Vector2 ellipseBCenter = { (float)screenWidth*3/4, (float)screenHeight/2 };
float ellipseBRx = 90.0f;
float ellipseBRy = 140.0f;
// 0 = controlling A, 1 = controlling B
int controlled = 0;
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_A)) controlled = 0;
if (IsKeyPressed(KEY_B)) controlled = 1;
if (controlled == 0) ellipseACenter = GetMousePosition();
else ellipseBCenter = GetMousePosition();
bool ellipsesCollide = CheckCollisionEllipses(
ellipseACenter, ellipseARx, ellipseARy,
ellipseBCenter, ellipseBRx, ellipseBRy
);
bool mouseInA = CheckCollisionPointEllipse(GetMousePosition(), ellipseACenter, ellipseARx, ellipseARy);
bool mouseInB = CheckCollisionPointEllipse(GetMousePosition(), ellipseBCenter, ellipseBRx, ellipseBRy);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawEllipse((int)ellipseACenter.x, (int)ellipseACenter.y, ellipseARx, ellipseARy, ellipsesCollide ? RED : BLUE);
DrawEllipse((int)ellipseBCenter.x, (int)ellipseBCenter.y, ellipseBRx, ellipseBRy, ellipsesCollide ? RED : GREEN);
DrawEllipseLines((int)ellipseACenter.x, (int)ellipseACenter.y, ellipseARx, ellipseARy, WHITE);
DrawEllipseLines((int)ellipseBCenter.x, (int)ellipseBCenter.y, ellipseBRx, ellipseBRy, WHITE);
DrawCircleV(ellipseACenter, 4, WHITE);
DrawCircleV(ellipseBCenter, 4, WHITE);
if (ellipsesCollide) DrawText("ELLIPSES COLLIDE", screenWidth/2 - 120, 40, 28, RED);
else DrawText("NO COLLISION", screenWidth/2 - 80, 40, 28, DARKGRAY);
DrawText(controlled == 0 ? "Controlling: A" : "Controlling: B", 20, screenHeight - 40, 20, YELLOW);
if (mouseInA && controlled != 0) DrawText("Mouse inside ellipse A", 20, screenHeight - 70, 20, BLUE);
if (mouseInB && controlled != 1) DrawText("Mouse inside ellipse B", 20, screenHeight - 70, 20, GREEN);
DrawText("Press [A] or [B] to switch control", 20, 20, 20, GRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
CloseWindow();
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -341,7 +341,7 @@ static void DrawLightMask(int slot)
rlSetBlendMode(BLEND_CUSTOM);
// If we are valid, then draw the light radius to the alpha mask
if (lights[slot].valid) DrawCircleGradient((int)lights[slot].position.x, (int)lights[slot].position.y, lights[slot].outerRadius, ColorAlpha(WHITE, 0), WHITE);
if (lights[slot].valid) DrawCircleGradient(lights[slot].position, lights[slot].outerRadius, ColorAlpha(WHITE, 0), WHITE);
rlDrawRenderBatchActive();

View File

@ -5,7 +5,7 @@ project(example)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Dependencies
set(RAYLIB_VERSION 5.5)
set(RAYLIB_VERSION 6.0)
find_package(raylib ${RAYLIB_VERSION} QUIET) # QUIET or REQUIRED
if (NOT raylib_FOUND) # If there's none, fetch and build raylib
include(FetchContent)

View File

@ -191,7 +191,7 @@
<Overload retVal="const char" descr="Get clipboard text content"></Overload>
</KeyWord>
<KeyWord name="GetClipboardImage" func="yes">
<Overload retVal="Image" descr="Get clipboard image"></Overload>
<Overload retVal="Image" descr="Get clipboard image content"></Overload>
</KeyWord>
<KeyWord name="EnableEventWaiting" func="yes">
<Overload retVal="void" descr="Enable waiting for events on EndDrawing(), no automatic event polling"></Overload>
@ -360,7 +360,7 @@
</Overload>
</KeyWord>
<KeyWord name="SetShaderValueTexture" func="yes">
<Overload retVal="void" descr="Set shader uniform value for texture (sampler2d)">
<Overload retVal="void" descr="Set shader uniform value and bind the texture (sampler2d)">
<Param name="Shader shader" />
<Param name="int locIndex" />
<Param name="Texture2D texture" />
@ -498,8 +498,12 @@
</Overload>
</KeyWord>
<!-- NOTE: Following functions implemented in module [utils] -->
<!-------------------------------------------------------------------- -->
<!-- Logging system -->
<KeyWord name="SetTraceLogLevel" func="yes">
<Overload retVal="void" descr="Set the current threshold (minimum) log level">
<Param name="int logLevel" />
</Overload>
</KeyWord>
<KeyWord name="TraceLog" func="yes">
<Overload retVal="void" descr="Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)">
<Param name="int logLevel" />
@ -507,11 +511,13 @@
<Param name="..." />
</Overload>
</KeyWord>
<KeyWord name="SetTraceLogLevel" func="yes">
<Overload retVal="void" descr="Set the current threshold (minimum) log level">
<Param name="int logLevel" />
<KeyWord name="SetTraceLogCallback" func="yes">
<Overload retVal="void" descr="Set custom trace log">
<Param name="TraceLogCallback callback" />
</Overload>
</KeyWord>
<!-- Memory management, using internal allocators -->
<KeyWord name="MemAlloc" func="yes">
<Overload retVal="void" descr="Internal memory allocator">
<Param name="unsigned int size" />
@ -524,35 +530,7 @@
<Overload retVal="void" descr="Internal memory free"></Overload>
</KeyWord>
<!-- Set custom callbacks -->
<!-- WARNING: Callbacks setup is intended for advanced users -->
<KeyWord name="SetTraceLogCallback" func="yes">
<Overload retVal="void" descr="Set custom trace log">
<Param name="TraceLogCallback callback" />
</Overload>
</KeyWord>
<KeyWord name="SetLoadFileDataCallback" func="yes">
<Overload retVal="void" descr="Set custom file binary data loader">
<Param name="LoadFileDataCallback callback" />
</Overload>
</KeyWord>
<KeyWord name="SetSaveFileDataCallback" func="yes">
<Overload retVal="void" descr="Set custom file binary data saver">
<Param name="SaveFileDataCallback callback" />
</Overload>
</KeyWord>
<KeyWord name="SetLoadFileTextCallback" func="yes">
<Overload retVal="void" descr="Set custom file text data loader">
<Param name="LoadFileTextCallback callback" />
</Overload>
</KeyWord>
<KeyWord name="SetSaveFileTextCallback" func="yes">
<Overload retVal="void" descr="Set custom file text data saver">
<Param name="SaveFileTextCallback callback" />
</Overload>
</KeyWord>
<!-- Files management functions -->
<!-- File system management functions -->
<KeyWord name="char *LoadFileData" func="yes">
<Overload retVal="unsigned" descr="Load file data as byte array (read)">
<Param name="const char *fileName" />
@ -588,12 +566,69 @@
<KeyWord name="SaveFileText" func="yes">
<Overload retVal="bool" descr="Save text data to file (write), string must be '\0' terminated, returns true on success">
<Param name="const char *fileName" />
<Param name="char *text" />
<Param name="const char *text" />
</Overload>
</KeyWord>
<!-------------------------------------------------------------------- -->
<!-- File system functions -->
<!-- File access custom callbacks -->
<!-- WARNING: Callbacks setup is intended for advanced users -->
<KeyWord name="SetLoadFileDataCallback" func="yes">
<Overload retVal="void" descr="Set custom file binary data loader">
<Param name="LoadFileDataCallback callback" />
</Overload>
</KeyWord>
<KeyWord name="SetSaveFileDataCallback" func="yes">
<Overload retVal="void" descr="Set custom file binary data saver">
<Param name="SaveFileDataCallback callback" />
</Overload>
</KeyWord>
<KeyWord name="SetLoadFileTextCallback" func="yes">
<Overload retVal="void" descr="Set custom file text data loader">
<Param name="LoadFileTextCallback callback" />
</Overload>
</KeyWord>
<KeyWord name="SetSaveFileTextCallback" func="yes">
<Overload retVal="void" descr="Set custom file text data saver">
<Param name="SaveFileTextCallback callback" />
</Overload>
</KeyWord>
<KeyWord name="FileRename" func="yes">
<Overload retVal="int" descr="Rename file (if exists)">
<Param name="const char *fileName" />
<Param name="const char *fileRename" />
</Overload>
</KeyWord>
<KeyWord name="FileRemove" func="yes">
<Overload retVal="int" descr="Remove file (if exists)">
<Param name="const char *fileName" />
</Overload>
</KeyWord>
<KeyWord name="FileCopy" func="yes">
<Overload retVal="int" descr="Copy file from one path to another, dstPath created if it doesn't exist">
<Param name="const char *srcPath" />
<Param name="const char *dstPath" />
</Overload>
</KeyWord>
<KeyWord name="FileMove" func="yes">
<Overload retVal="int" descr="Move file from one directory to another, dstPath created if it doesn't exist">
<Param name="const char *srcPath" />
<Param name="const char *dstPath" />
</Overload>
</KeyWord>
<KeyWord name="FileTextReplace" func="yes">
<Overload retVal="int" descr="Replace text in an existing file">
<Param name="const char *fileName" />
<Param name="const char *search" />
<Param name="const char *replacement" />
</Overload>
</KeyWord>
<KeyWord name="FileTextFindIndex" func="yes">
<Overload retVal="int" descr="Find text in existing file">
<Param name="const char *fileName" />
<Param name="const char *search" />
</Overload>
</KeyWord>
<KeyWord name="FileExists" func="yes">
<Overload retVal="bool" descr="Check if file exists">
<Param name="const char *fileName" />
@ -605,7 +640,7 @@
</Overload>
</KeyWord>
<KeyWord name="IsFileExtension" func="yes">
<Overload retVal="bool" descr="Check file extension (including point: .png, .wav)">
<Overload retVal="bool" descr="Check file extension (recommended include point: .png, .wav)">
<Param name="const char *fileName" />
<Param name="const char *ext" />
</Overload>
@ -615,6 +650,11 @@
<Param name="const char *fileName" />
</Overload>
</KeyWord>
<KeyWord name="GetFileModTime" func="yes">
<Overload retVal="long" descr="Get file modification time (last write time)">
<Param name="const char *fileName" />
</Overload>
</KeyWord>
<KeyWord name="GetFileExtension" func="yes">
<Overload retVal="const char" descr="Get pointer to extension for a filename string (includes dot: '.png')">
<Param name="const char *fileName" />
@ -653,7 +693,7 @@
</KeyWord>
<KeyWord name="ChangeDirectory" func="yes">
<Overload retVal="bool" descr="Change working directory, return true on success">
<Param name="const char *dir" />
<Param name="const char *dirPath" />
</Overload>
</KeyWord>
<KeyWord name="IsPathFile" func="yes">
@ -667,12 +707,12 @@
</Overload>
</KeyWord>
<KeyWord name="LoadDirectoryFiles" func="yes">
<Overload retVal="FilePathList" descr="Load directory filepaths">
<Overload retVal="FilePathList" descr="Load directory filepaths, files and directories, no subdirs scan">
<Param name="const char *dirPath" />
</Overload>
</KeyWord>
<KeyWord name="LoadDirectoryFilesEx" func="yes">
<Overload retVal="FilePathList" descr="Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result">
<Overload retVal="FilePathList" descr="Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"">
<Param name="const char *basePath" />
<Param name="const char *filter" />
<Param name="bool scanSubdirs" />
@ -694,9 +734,16 @@
<Param name="FilePathList files" />
</Overload>
</KeyWord>
<KeyWord name="GetFileModTime" func="yes">
<Overload retVal="long" descr="Get file modification time (last write time)">
<Param name="const char *fileName" />
<KeyWord name="int GetDirectoryFileCount" func="yes">
<Overload retVal="unsigned" descr="Get the file count in a directory">
<Param name="const char *dirPath" />
</Overload>
</KeyWord>
<KeyWord name="int GetDirectoryFileCountEx" func="yes">
<Overload retVal="unsigned" descr="Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result">
<Param name="const char *basePath" />
<Param name="const char *filter" />
<Param name="bool scanSubdirs" />
</Overload>
</KeyWord>
@ -716,15 +763,15 @@
</Overload>
</KeyWord>
<KeyWord name="EncodeDataBase64" func="yes">
<Overload retVal="char" descr="Encode data to Base64 string, memory must be MemFree()">
<Overload retVal="char" descr="Encode data to Base64 string (includes NULL terminator), memory must be MemFree()">
<Param name="const unsigned char" />
<Param name="int dataSize" />
<Param name="int *outputSize" />
</Overload>
</KeyWord>
<KeyWord name="char *DecodeDataBase64" func="yes">
<Overload retVal="unsigned" descr="Decode Base64 string data, memory must be MemFree()">
<Param name="const unsigned char" />
<Overload retVal="unsigned" descr="Decode Base64 string (expected NULL terminated), memory must be MemFree()">
<Param name="const char *text" />
<Param name="int *outputSize" />
</Overload>
</KeyWord>
@ -746,7 +793,12 @@
<Param name="int dataSize" />
</Overload>
</KeyWord>
<KeyWord name="int *ComputeSHA256" func="yes">
<Overload retVal="unsigned" descr="Compute SHA256 hash code, returns static int[8] (32 bytes)">
<Param name="unsigned char *data" />
<Param name="int dataSize" />
</Overload>
</KeyWord>
<!-- Automation events functionality -->
<KeyWord name="LoadAutomationEventList" func="yes">
@ -823,6 +875,11 @@
<KeyWord name="GetCharPressed" func="yes">
<Overload retVal="int" descr="Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty"></Overload>
</KeyWord>
<KeyWord name="GetKeyName" func="yes">
<Overload retVal="const char" descr="Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)">
<Param name="int key" />
</Overload>
</KeyWord>
<KeyWord name="SetExitKey" func="yes">
<Overload retVal="void" descr="Set a custom key to exit program (default is ESC)">
<Param name="int key" />
@ -868,12 +925,12 @@
<Overload retVal="int" descr="Get the last gamepad button pressed"></Overload>
</KeyWord>
<KeyWord name="GetGamepadAxisCount" func="yes">
<Overload retVal="int" descr="Get gamepad axis count for a gamepad">
<Overload retVal="int" descr="Get axis count for a gamepad">
<Param name="int gamepad" />
</Overload>
</KeyWord>
<KeyWord name="GetGamepadAxisMovement" func="yes">
<Overload retVal="float" descr="Get axis movement value for a gamepad axis">
<Overload retVal="float" descr="Get movement value for a gamepad axis">
<Param name="int gamepad" />
<Param name="int axis" />
</Overload>
@ -1098,6 +1155,15 @@
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawLineDashed" func="yes">
<Overload retVal="void" descr="Draw a dashed line">
<Param name="Vector2 startPos" />
<Param name="Vector2 endPos" />
<Param name="int dashSize" />
<Param name="int spaceSize" />
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawCircle" func="yes">
<Overload retVal="void" descr="Draw a color-filled circle">
<Param name="int centerX" />
@ -1106,6 +1172,21 @@
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawCircleV" func="yes">
<Overload retVal="void" descr="Draw a color-filled circle (Vector version)">
<Param name="Vector2 center" />
<Param name="float radius" />
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawCircleGradient" func="yes">
<Overload retVal="void" descr="Draw a gradient-filled circle">
<Param name="Vector2 center" />
<Param name="float radius" />
<Param name="Color inner" />
<Param name="Color outer" />
</Overload>
</KeyWord>
<KeyWord name="DrawCircleSector" func="yes">
<Overload retVal="void" descr="Draw a piece of a circle">
<Param name="Vector2 center" />
@ -1126,22 +1207,6 @@
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawCircleGradient" func="yes">
<Overload retVal="void" descr="Draw a gradient-filled circle">
<Param name="int centerX" />
<Param name="int centerY" />
<Param name="float radius" />
<Param name="Color inner" />
<Param name="Color outer" />
</Overload>
</KeyWord>
<KeyWord name="DrawCircleV" func="yes">
<Overload retVal="void" descr="Draw a color-filled circle (Vector version)">
<Param name="Vector2 center" />
<Param name="float radius" />
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawCircleLines" func="yes">
<Overload retVal="void" descr="Draw circle outline">
<Param name="int centerX" />
@ -1166,6 +1231,14 @@
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawEllipseV" func="yes">
<Overload retVal="void" descr="Draw ellipse (Vector version)">
<Param name="Vector2 center" />
<Param name="float radiusH" />
<Param name="float radiusV" />
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawEllipseLines" func="yes">
<Overload retVal="void" descr="Draw ellipse outline">
<Param name="int centerX" />
@ -1175,6 +1248,14 @@
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawEllipseLinesV" func="yes">
<Overload retVal="void" descr="Draw ellipse outline (Vector version)">
<Param name="Vector2 center" />
<Param name="float radiusH" />
<Param name="float radiusV" />
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="DrawRing" func="yes">
<Overload retVal="void" descr="Draw ring">
<Param name="Vector2 center" />
@ -1252,8 +1333,8 @@
<Param name="Rectangle rec" />
<Param name="Color topLeft" />
<Param name="Color bottomLeft" />
<Param name="Color topRight" />
<Param name="Color bottomRight" />
<Param name="Color topRight" />
</Overload>
</KeyWord>
<KeyWord name="DrawRectangleLines" func="yes">
@ -1637,7 +1718,7 @@
</Overload>
</KeyWord>
<KeyWord name="char *ExportImageToMemory" func="yes">
<Overload retVal="unsigned" descr="Export image to memory buffer">
<Overload retVal="unsigned" descr="Export image to memory buffer, memory must be MemFree()">
<Param name="Image image" />
<Param name="const char *fileType" />
<Param name="int *fileSize" />
@ -2099,7 +2180,7 @@
<KeyWord name="ImageDrawTriangleFan" func="yes">
<Overload retVal="void" descr="Draw a triangle fan defined by points within an image (first vertex is the center)">
<Param name="Image *dst" />
<Param name="Vector2 *points" />
<Param name="const Vector2 *points" />
<Param name="int pointCount" />
<Param name="Color color" />
</Overload>
@ -2107,7 +2188,7 @@
<KeyWord name="ImageDrawTriangleStrip" func="yes">
<Overload retVal="void" descr="Draw a triangle strip defined by points within an image">
<Param name="Image *dst" />
<Param name="Vector2 *points" />
<Param name="const Vector2 *points" />
<Param name="int pointCount" />
<Param name="Color color" />
</Overload>
@ -2188,13 +2269,13 @@
</Overload>
</KeyWord>
<KeyWord name="UpdateTexture" func="yes">
<Overload retVal="void" descr="Update GPU texture with new data">
<Overload retVal="void" descr="Update GPU texture with new data (pixels should be able to fill texture)">
<Param name="Texture2D texture" />
<Param name="const void *pixels" />
</Overload>
</KeyWord>
<KeyWord name="UpdateTextureRec" func="yes">
<Overload retVal="void" descr="Update GPU texture rectangle with new data">
<Overload retVal="void" descr="Update GPU texture rectangle with new data (pixels and rec should fit in texture)">
<Param name="Texture2D texture" />
<Param name="Rectangle rec" />
<Param name="const void *pixels" />
@ -2388,7 +2469,7 @@
<Overload retVal="Font" descr="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">
<Param name="const char *fileName" />
<Param name="int fontSize" />
<Param name="int *codepoints" />
<Param name="const int *codepoints" />
<Param name="int codepointCount" />
</Overload>
</KeyWord>
@ -2405,7 +2486,7 @@
<Param name="const unsigned char" />
<Param name="int dataSize" />
<Param name="int fontSize" />
<Param name="int *codepoints" />
<Param name="const int *codepoints" />
<Param name="int codepointCount" />
</Overload>
</KeyWord>
@ -2419,9 +2500,10 @@
<Param name="const unsigned char" />
<Param name="int dataSize" />
<Param name="int fontSize" />
<Param name="int *codepoints" />
<Param name="const int *codepoints" />
<Param name="int codepointCount" />
<Param name="int type" />
<Param name="int *glyphCount" />
</Overload>
</KeyWord>
<KeyWord name="GenImageFontAtlas" func="yes">
@ -2531,6 +2613,15 @@
<Param name="float spacing" />
</Overload>
</KeyWord>
<KeyWord name="MeasureTextCodepoints" func="yes">
<Overload retVal="Vector2" descr="Measure string size for an existing array of codepoints for Font">
<Param name="Font font" />
<Param name="const int *codepoints" />
<Param name="int length" />
<Param name="float fontSize" />
<Param name="float spacing" />
</Overload>
</KeyWord>
<KeyWord name="GetGlyphIndex" func="yes">
<Overload retVal="int" descr="Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found">
<Param name="Font font" />
@ -2604,7 +2695,20 @@
</KeyWord>
<!-- Text strings management functions (no UTF-8 strings, only byte chars) -->
<!-- NOTE: Some strings allocate memory internally for returned strings, just be careful! -->
<!-- WARNING 1: Most of these functions use internal static buffers[], it's recommended to store returned data on user-side for re-use -->
<!-- WARNING 2: Some functions allocate memory internally for the returned strings, those strings must be freed by user using MemFree() -->
<KeyWord name="LoadTextLines" func="yes">
<Overload retVal="char" descr="Load text as separate lines ('\n')">
<Param name="const char *text" />
<Param name="int *count" />
</Overload>
</KeyWord>
<KeyWord name="UnloadTextLines" func="yes">
<Overload retVal="void" descr="Unload text lines">
<Param name="char **text" />
<Param name="int lineCount" />
</Overload>
</KeyWord>
<KeyWord name="TextCopy" func="yes">
<Overload retVal="int" descr="Copy one string to another, returns bytes copied">
<Param name="char *dst" />
@ -2635,80 +2739,121 @@
<Param name="int length" />
</Overload>
</KeyWord>
<KeyWord name="TextReplace" func="yes">
<Overload retVal="char" descr="Replace text string (WARNING: memory must be freed!)">
<KeyWord name="TextRemoveSpaces" func="yes">
<Overload retVal="const char" descr="Remove text spaces, concat words">
<Param name="const char *text" />
<Param name="const char *replace" />
<Param name="const char *by" />
</Overload>
</KeyWord>
<KeyWord name="GetTextBetween" func="yes">
<Overload retVal="char" descr="Get text between two strings">
<Param name="const char *text" />
<Param name="const char *begin" />
<Param name="const char *end" />
</Overload>
</KeyWord>
<KeyWord name="TextReplace" func="yes">
<Overload retVal="char" descr="Replace text string with new string">
<Param name="const char *text" />
<Param name="const char *search" />
<Param name="const char *replacement" />
</Overload>
</KeyWord>
<KeyWord name="TextReplaceAlloc" func="yes">
<Overload retVal="char" descr="Replace text string with new string, memory must be MemFree()">
<Param name="const char *text" />
<Param name="const char *search" />
<Param name="const char *replacement" />
</Overload>
</KeyWord>
<KeyWord name="TextReplaceBetween" func="yes">
<Overload retVal="char" descr="Replace text between two specific strings">
<Param name="const char *text" />
<Param name="const char *begin" />
<Param name="const char *end" />
<Param name="const char *replacement" />
</Overload>
</KeyWord>
<KeyWord name="TextReplaceBetweenAlloc" func="yes">
<Overload retVal="char" descr="Replace text between two specific strings, memory must be MemFree()">
<Param name="const char *text" />
<Param name="const char *begin" />
<Param name="const char *end" />
<Param name="const char *replacement" />
</Overload>
</KeyWord>
<KeyWord name="TextInsert" func="yes">
<Overload retVal="char" descr="Insert text in a position (WARNING: memory must be freed!)">
<Overload retVal="char" descr="Insert text in a defined byte position">
<Param name="const char *text" />
<Param name="const char *insert" />
<Param name="int position" />
</Overload>
</KeyWord>
<KeyWord name="TextInsertAlloc" func="yes">
<Overload retVal="char" descr="Insert text in a defined byte position, memory must be MemFree()">
<Param name="const char *text" />
<Param name="const char *insert" />
<Param name="int position" />
</Overload>
</KeyWord>
<KeyWord name="TextJoin" func="yes">
<Overload retVal="const char" descr="Join text strings with delimiter">
<Param name="const char **textList" />
<Overload retVal="char" descr="Join text strings with delimiter">
<Param name="char **textList" />
<Param name="int count" />
<Param name="const char *delimiter" />
</Overload>
</KeyWord>
<KeyWord name="TextSplit" func="yes">
<Overload retVal="const char" descr="Split text into multiple strings">
<Overload retVal="char" descr="Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings">
<Param name="const char *text" />
<Param name="char delimiter" />
<Param name="int *count" />
</Overload>
</KeyWord>
<KeyWord name="TextAppend" func="yes">
<Overload retVal="void" descr="Append text at specific position and move cursor!">
<Overload retVal="void" descr="Append text at specific position and move cursor">
<Param name="char *text" />
<Param name="const char *append" />
<Param name="int *position" />
</Overload>
</KeyWord>
<KeyWord name="TextFindIndex" func="yes">
<Overload retVal="int" descr="Find first text occurrence within a string">
<Overload retVal="int" descr="Find first text occurrence within a string, -1 if not found">
<Param name="const char *text" />
<Param name="const char *find" />
<Param name="const char *search" />
</Overload>
</KeyWord>
<KeyWord name="TextToUpper" func="yes">
<Overload retVal="const char" descr="Get upper case version of provided string">
<Overload retVal="char" descr="Get upper case version of provided string">
<Param name="const char *text" />
</Overload>
</KeyWord>
<KeyWord name="TextToLower" func="yes">
<Overload retVal="const char" descr="Get lower case version of provided string">
<Overload retVal="char" descr="Get lower case version of provided string">
<Param name="const char *text" />
</Overload>
</KeyWord>
<KeyWord name="TextToPascal" func="yes">
<Overload retVal="const char" descr="Get Pascal case notation version of provided string">
<Overload retVal="char" descr="Get Pascal case notation version of provided string">
<Param name="const char *text" />
</Overload>
</KeyWord>
<KeyWord name="TextToSnake" func="yes">
<Overload retVal="const char" descr="Get Snake case notation version of provided string">
<Overload retVal="char" descr="Get Snake case notation version of provided string">
<Param name="const char *text" />
</Overload>
</KeyWord>
<KeyWord name="TextToCamel" func="yes">
<Overload retVal="const char" descr="Get Camel case notation version of provided string">
<Overload retVal="char" descr="Get Camel case notation version of provided string">
<Param name="const char *text" />
</Overload>
</KeyWord>
<KeyWord name="TextToInteger" func="yes">
<Overload retVal="int" descr="Get integer value from text (negative values not supported)">
<Overload retVal="int" descr="Get integer value from text">
<Param name="const char *text" />
</Overload>
</KeyWord>
<KeyWord name="TextToFloat" func="yes">
<Overload retVal="float" descr="Get float value from text (negative values not supported)">
<Overload retVal="float" descr="Get float value from text">
<Param name="const char *text" />
</Overload>
</KeyWord>
@ -2995,7 +3140,7 @@
<Param name="Vector2 size" />
<Param name="Vector2 origin" />
<Param name="float rotation" />
<Param name="<EFBFBD><EFBFBD>_)% " />
<Param name="Color tint" />
</Overload>
</KeyWord>
@ -3180,22 +3325,20 @@
</Overload>
</KeyWord>
<KeyWord name="UpdateModelAnimation" func="yes">
<Overload retVal="void" descr="Update model animation pose (CPU)">
<Overload retVal="void" descr="Update model animation pose (vertex buffers and bone matrices)">
<Param name="Model model" />
<Param name="ModelAnimation anim" />
<Param name="int frame" />
<Param name="float frame" />
</Overload>
</KeyWord>
<KeyWord name="UpdateModelAnimationBones" func="yes">
<Overload retVal="void" descr="Update model animation mesh bone matrices (GPU skinning)">
<KeyWord name="UpdateModelAnimationEx" func="yes">
<Overload retVal="void" descr="Update model animation pose, blending two animations">
<Param name="Model model" />
<Param name="ModelAnimation anim" />
<Param name="int frame" />
</Overload>
</KeyWord>
<KeyWord name="UnloadModelAnimation" func="yes">
<Overload retVal="void" descr="Unload animation data">
<Param name="ModelAnimation anim" />
<Param name="ModelAnimation animA" />
<Param name="float frameA" />
<Param name="ModelAnimation animB" />
<Param name="float frameB" />
<Param name="float blend" />
</Overload>
</KeyWord>
<KeyWord name="UnloadModelAnimations" func="yes">
@ -3333,7 +3476,7 @@
</Overload>
</KeyWord>
<KeyWord name="UpdateSound" func="yes">
<Overload retVal="void" descr="Update sound buffer with new data">
<Overload retVal="void" descr="Update sound buffer with new data (default data format: 32 bit float, stereo)">
<Param name="Sound sound" />
<Param name="const void *data" />
<Param name="int sampleCount" />
@ -3406,7 +3549,7 @@
</Overload>
</KeyWord>
<KeyWord name="SetSoundPan" func="yes">
<Overload retVal="void" descr="Set pan for a sound (0.5 is center)">
<Overload retVal="void" descr="Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)">
<Param name="Sound sound" />
<Param name="float pan" />
</Overload>
@ -3514,7 +3657,7 @@
</Overload>
</KeyWord>
<KeyWord name="SetMusicPan" func="yes">
<Overload retVal="void" descr="Set pan for a music (0.5 is center)">
<Overload retVal="void" descr="Set pan for a music (-1.0 left, 0.0 center, 1.0 right)">
<Param name="Music music" />
<Param name="float pan" />
</Overload>
@ -3598,7 +3741,7 @@
</Overload>
</KeyWord>
<KeyWord name="SetAudioStreamPan" func="yes">
<Overload retVal="void" descr="Set pan for audio stream (0.5 is centered)">
<Overload retVal="void" descr="Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)">
<Param name="AudioStream stream" />
<Param name="float pan" />
</Overload>
@ -3638,5 +3781,3 @@
<Param name="AudioCallback processor" />
</Overload>
</KeyWord>

View File

@ -49,7 +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 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
@ -91,10 +91,10 @@ RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Lo
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
RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector
RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4)
RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d)
RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value
RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector
RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4)
RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value and bind the texture (sampler2d)
RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM)
// Screen-space-related functions
@ -109,99 +109,106 @@ RLAPI Matrix GetCameraMatrix(Camera camera); // Get c
RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix
// Timing-related functions
RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum)
RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time)
RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow()
RLAPI int GetFPS(void); // Get current FPS
RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum)
RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time)
RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow()
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)
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)
// Random values generation functions
RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator
RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included)
RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator
RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included)
RLAPI int *LoadRandomSequence(unsigned int count, int min, int max); // Load random values sequence, no values repeated
RLAPI void UnloadRandomSequence(int *sequence); // Unload random values sequence
RLAPI void UnloadRandomSequence(int *sequence); // Unload random values sequence
// Misc. functions
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format)
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)
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format)
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
RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator
RLAPI void MemFree(void *ptr); // Internal memory free
// Logging system
RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level
RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log
// Set custom callbacks
// WARNING: Callbacks setup is intended for advanced users
RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log
RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader
RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver
RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader
RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver
// Memory management, using internal allocators
RLAPI void *MemAlloc(unsigned int size); // Internal memory allocator
RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator
RLAPI void MemFree(void *ptr); // Internal memory free
// Files management functions
// File system management functions
RLAPI unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read)
RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
RLAPI bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write), returns true on success
RLAPI bool ExportDataAsCode(const unsigned char *data, int dataSize, const char *fileName); // Export data to code (.h), returns true on success
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
//------------------------------------------------------------------
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, const 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
RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists
RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav)
RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png')
RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string
RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string)
RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string)
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. 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
RLAPI void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths
RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time)
// File access custom callbacks
// WARNING: Callbacks setup is intended for advanced users
RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader
RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver
RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader
RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver
RLAPI int FileRename(const char *fileName, const char *fileRename); // Rename file (if exists)
RLAPI int FileRemove(const char *fileName); // Remove file (if exists)
RLAPI int FileCopy(const char *srcPath, const char *dstPath); // Copy file from one path to another, dstPath created if it doesn't exist
RLAPI int FileMove(const char *srcPath, const char *dstPath); // Move file from one directory to another, dstPath created if it doesn't exist
RLAPI int FileTextReplace(const char *fileName, const char *search, const char *replacement); // Replace text in an existing file
RLAPI int FileTextFindIndex(const char *fileName, const char *search); // Find text in existing file
RLAPI bool FileExists(const char *fileName); // Check if file exists
RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists
RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (recommended include point: .png, .wav)
RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time)
RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png')
RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string
RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string)
RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string)
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 *dirPath); // 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, files and directories, no subdirs scan
RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"
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
RLAPI void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths
RLAPI unsigned int GetDirectoryFileCount(const char *dirPath); // Get the file count in a directory
RLAPI unsigned int GetDirectoryFileCountEx(const char *basePath, const char *filter, bool scanSubdirs); // Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result
// Compression/Encoding functionality
RLAPI unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize); // Compress data (DEFLATE algorithm), memory must be MemFree()
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 char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string (includes NULL terminator), memory must be MemFree()
RLAPI unsigned char *DecodeDataBase64(const char *text, int *outputSize); // Decode Base64 string (expected NULL terminated), 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 *ComputeSHA256(unsigned char *data, int dataSize); // Compute SHA256 hash code, returns static int[8] (32 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)
@ -215,20 +222,20 @@ 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
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 axis count for a gamepad
RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get 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
@ -257,19 +264,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
//------------------------------------------------------------------------------------
@ -278,9 +285,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]
@ -290,24 +297,27 @@ RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);
RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line (using triangles/quads)
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 DrawLineDashed(Vector2 startPos, Vector2 endPos, int dashSize, int spaceSize, Color color); // Draw a dashed line
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 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 DrawCircleGradient(Vector2 center, float radius, Color inner, Color outer); // Draw a gradient-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 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)
RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse
RLAPI void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color); // Draw ellipse (Vector version)
RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline
RLAPI void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color); // Draw ellipse outline (Vector version)
RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring
RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline
RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline
RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
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 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 DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color bottomRight, Color topRight); // 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
@ -322,11 +332,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
@ -369,7 +379,7 @@ RLAPI Image LoadImageFromScreen(void);
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
RLAPI unsigned char *ExportImageToMemory(Image image, const char *fileType, int *fileSize); // Export image to memory buffer, memory must be MemFree()
RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success
// Image generation functions
@ -399,7 +409,7 @@ RLAPI void ImageAlphaPremultiply(Image *image);
RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation
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 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 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)
@ -440,8 +450,8 @@ RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color c
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, const 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, const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image
RLAPI void ImageDrawTriangleFan(Image *dst, const 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, const 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)
@ -456,8 +466,8 @@ RLAPI bool IsTextureValid(Texture2D texture);
RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
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
RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data (pixels should be able to fill texture)
RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data (pixels and rec should fit in texture)
// Texture configuration functions
RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture
@ -498,11 +508,11 @@ 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, font size is provided in pixels height
RLAPI Font LoadFontEx(const char *fileName, int fontSize, const 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 Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, const int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
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 GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, const int *codepoints, int codepointCount, int type, int *glyphCount); // 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)
RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM)
@ -520,42 +530,51 @@ RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int codepointCou
RLAPI void SetTextLineSpacing(int spacing); // Set vertical line spacing when drawing with line-breaks
RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
RLAPI Vector2 MeasureTextCodepoints(Font font, const int *codepoints, int length, float fontSize, float spacing); // Measure string size for an existing array of codepoints for Font
RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found
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!
// WARNING 1: Most of these functions use internal static buffers[], it's recommended to store returned data on user-side for re-use
// WARNING 2: Some functions allocate memory internally for the returned strings, those strings must be freed by user using MemFree()
RLAPI char **LoadTextLines(const char *text, int *count); // Load text as separate lines ('\n')
RLAPI void UnloadTextLines(char **text, int lineCount); // Unload text lines
RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied
RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal
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(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 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 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 const char *TextRemoveSpaces(const char *text); // Remove text spaces, concat words
RLAPI char *GetTextBetween(const char *text, const char *begin, const char *end); // Get text between two strings
RLAPI char *TextReplace(const char *text, const char *search, const char *replacement); // Replace text string with new string
RLAPI char *TextReplaceAlloc(const char *text, const char *search, const char *replacement); // Replace text string with new string, memory must be MemFree()
RLAPI char *TextReplaceBetween(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings
RLAPI char *TextReplaceBetweenAlloc(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings, memory must be MemFree()
RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a defined byte position
RLAPI char *TextInsertAlloc(const char *text, const char *insert, int position); // Insert text in a defined byte position, memory must be MemFree()
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, using MAX_TEXTSPLIT_COUNT static 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 *search); // Find first text occurrence within a string, -1 if not found
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
//------------------------------------------------------------------------------------
// Basic 3d Shapes Drawing Functions (Module: models)
@ -601,7 +620,7 @@ RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, floa
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 DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, 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
@ -639,21 +658,20 @@ 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 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 UpdateModelAnimation(Model model, ModelAnimation anim, float frame); // Update model animation pose (vertex buffers and bone matrices)
RLAPI void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend); // Update model animation pose, blending two animations
RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data
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)
@ -675,7 +693,7 @@ RLAPI Sound LoadSound(const char *fileName); // Load so
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 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 UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data (default data format: 32 bit float, stereo)
RLAPI void UnloadWave(Wave wave); // Unload wave data
RLAPI void UnloadSound(Sound sound); // Unload sound
RLAPI void UnloadSoundAlias(Sound alias); // Unload a sound alias (does not deallocate sample data)
@ -690,7 +708,7 @@ RLAPI void ResumeSound(Sound sound); // Resume
RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
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 void SetSoundPan(Sound sound, float pan); // Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)
RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave
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
@ -711,7 +729,7 @@ RLAPI void ResumeMusicStream(Music music); // Resume
RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds)
RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center)
RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (-1.0 left, 0.0 center, 1.0 right)
RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
@ -728,7 +746,7 @@ RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check i
RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream
RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered)
RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)
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
@ -737,4 +755,3 @@ RLAPI void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processo
RLAPI void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo)
RLAPI void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline

View File

@ -13,6 +13,7 @@ IDE | Platform(s) | Source | Example(s)
[SublimeText](https://www.sublimetext.com/) | Windows, Linux, macOS | ✔️ | ✔️
[VS2019](https://www.visualstudio.com) | Windows | ✔️ | ✔️
[VSCode](https://code.visualstudio.com/) | Windows, macOS | ❌ | ✔️
[Zig](https://ziglang.org) | Windows, Linux, macOS, Web | ✔️ | ✔️
scripts | Windows, Linux, macOS | ✔️ | ✔️
*New IDEs config files are welcome!*

View File

@ -1,569 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug.DLL|ARM64">
<Configuration>Debug.DLL</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug.DLL|Win32">
<Configuration>Debug.DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug.DLL|x64">
<Configuration>Debug.DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release.DLL|ARM64">
<Configuration>Release.DLL</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release.DLL|Win32">
<Configuration>Release.DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release.DLL|x64">
<Configuration>Release.DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A9C422E7-0F03-4DBC-AC93-5C3EF4942DEC}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>web_basic_window</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>web_basic_window</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\others</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>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)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;shcore.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>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)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>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)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
<Message>Copy Debug DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>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)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
<Message>Copy Debug DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<AdditionalDependencies>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)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
<Message>Copy Debug DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>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)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>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)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>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)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>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)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Copy Release DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>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)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Copy Release DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>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)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Copy Release DLL to output directory</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\examples\others\web_basic_window.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\examples\examples.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\raylib\raylib.vcxproj">
<Project>{e89d61ac-55de-4482-afd4-df7242ebc859}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

84
projects/Zig/README.md Normal file
View File

@ -0,0 +1,84 @@
# Starting your raylib project with Zig (0.16.0)
## How to compile and run it
To compile the project:
```sh
zig build
```
To run the project:
```sh
zig build run
```
## Compile with different optimization
To change from debug to release build you can do it with the `-Doptimze=` flag.
```
Debug
ReleaseSafe
ReleaseFast
ReleaseSmall
```
## Choose a different platform
To compile with a different platform you can use the `-Dplatform=` flag.
Here all the options:
```
glfw
rgfw
sdl
sdl2
sdl3
memory
win32
drm
android
```
In this example the platform `sdl` and `sdl2` are not supported
Important for the android platform you also have to compile for the right target
## Compile for a different target
To compile for a different [target](https://ziglang.org/download/0.16.0/release-notes.html#Support-Table) you can use the `-Dtarget=` flag.
Not all targets are supported
## Example: Compile for web and run it
To compile for the web we use emscripten and you run it like that:
```sh
zig build -Dtarget=wasm32-emscripten
```
To run it we do:
```sh
zig build run -Dtarget=wasm32-emscripten
```
And to make a relase build we do:
```sh
zig build -Dtarget=wasm32-emscripten -Doptimize=ReleaseFast
```
If we want to use rgfw for the web build we could do:
```sh
zig build -Dplatform=rgfw -Dtarget=wasm32-emscripten -Doptimize=ReleaseFast
```
## Compiling the Zig code? Just add `-Dzig` and try out zig ;)
## More Resources
See [Zig Build System](https://ziglang.org/learn/build-system/)

87
projects/Zig/build.zig Normal file
View File

@ -0,0 +1,87 @@
const std = @import("std");
const rl = @import("raylib");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const platform = b.option(rl.PlatformBackend, "platform", "select the platform") orelse rl.PlatformBackend.glfw;
const zig = b.option(bool, "zig", "compile zig code") orelse false;
const raylib_dep = b.dependency("raylib", .{
.target = target,
.optimize = optimize,
.platform = platform,
});
const raylib_artifact = raylib_dep.artifact("raylib");
if (platform == .sdl3) {
if (b.lazyDependency("sdl3", .{ .optimize = optimize, .target = target })) |dep| {
raylib_artifact.root_module.linkLibrary(dep.artifact("SDL3"));
}
}
var exe_mod: *std.Build.Module = undefined;
if (zig) {
exe_mod = b.createModule(.{
.root_source_file = b.path("src/core_basic_window.zig"),
.target = target,
.optimize = optimize,
});
exe_mod.addImport("raylib", raylib_dep.module("raylib"));
} else {
exe_mod = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
});
exe_mod.addCSourceFile(.{ .file = b.path("src/core_basic_window.c") });
exe_mod.linkLibrary(raylib_artifact);
}
const run_step = b.step("run", "Run the app");
// web exports are completely separate
if (target.query.os_tag == .emscripten) {
const emsdk = rl.emsdk;
const wasm = b.addLibrary(.{
.name = "core_basic_window_web",
.root_module = exe_mod,
});
const install_dir: std.Build.InstallDir = .{ .custom = "web" };
const emcc_flags = emsdk.emccDefaultFlags(b.allocator, .{ .optimize = optimize });
const emcc_settings = emsdk.emccDefaultSettings(b.allocator, .{ .optimize = optimize });
const emcc_step = emsdk.emccStep(b, raylib_artifact, wasm, .{
.optimize = optimize,
.flags = emcc_flags,
.settings = emcc_settings,
.shell_file_path = emsdk.shell(raylib_dep),
.install_dir = install_dir,
});
b.getInstallStep().dependOn(emcc_step);
const html_filename = try std.fmt.allocPrint(b.allocator, "{s}.html", .{wasm.name});
const emrun_step = emsdk.emrunStep(
b,
b.getInstallPath(install_dir, html_filename),
&.{},
);
emrun_step.dependOn(emcc_step);
run_step.dependOn(emrun_step);
} else {
const exe = b.addExecutable(.{
.name = "core_basic_window",
.root_module = exe_mod,
.use_lld = target.result.os.tag == .windows,
});
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
run_step.dependOn(&run_cmd.step);
}
}

View File

@ -0,0 +1,23 @@
.{
.name = .example,
.version = "0.0.1",
.minimum_zig_version = "0.16.0",
.paths = .{""},
.dependencies = .{
.raylib = .{
.path = "../../",
},
.emsdk = .{
.url = "git+https://github.com/emscripten-core/emsdk?ref=4.0.9#3bcf1dcd01f040f370e10fe673a092d9ed79ebb5",
.hash = "N-V-__8AAJl1DwBezhYo_VE6f53mPVm00R-Fk28NPW7P14EQ",
},
.sdl3 = .{
.url = "git+https://codeberg.org/7Games/zig-sdl3?ref=master#6d418ef3ddae99098414a96a88bf5e5fdb41785e",
.hash = "sdl3-0.1.9-NmT1QwiEJwByePqkmArtppCHQn8Y7kiSWcncT_Mop8ie",
.lazy = true,
},
},
.fingerprint = 0x6eec9b9f1a9d7aca,
}

View File

@ -0,0 +1,83 @@
/*******************************************************************************************
*
* raylib [core] example - Basic window (adapted for HTML5 platform)
*
* This example is prepared to compile for PLATFORM_WEB and PLATFORM_DESKTOP
* As you will notice, code structure is slightly different to the other examples...
* To compile it for PLATFORM_WEB just uncomment #define PLATFORM_WEB at beginning
*
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#if defined(PLATFORM_WEB)
#include <emscripten/emscripten.h>
#endif
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
//----------------------------------------------------------------------------------
// Module Functions Declaration
//----------------------------------------------------------------------------------
void UpdateDrawFrame(void); // Update and Draw one frame
//----------------------------------------------------------------------------------
// Program main entry point
//----------------------------------------------------------------------------------
int main()
{
// Initialization
//--------------------------------------------------------------------------------------
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
#if defined(PLATFORM_WEB)
emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
#else
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
UpdateDrawFrame();
}
#endif
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
//----------------------------------------------------------------------------------
// Module Functions Definition
//----------------------------------------------------------------------------------
void UpdateDrawFrame(void)
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}

View File

@ -0,0 +1,73 @@
//*******************************************************************************************
//*
//* raylib [core] example - Basic window (adapted for HTML5 platform)
//*
//* This example is prepared to compile for PLATFORM_WEB and PLATFORM_DESKTOP
//* As you will notice, code structure is slightly different to the other examples...
//* To compile it for PLATFORM_WEB just uncomment #define PLATFORM_WEB at beginning
//*
//* This example has been created using raylib 6.0 (www.raylib.com)
//* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
//*
//* Copyright (c) 2015 Ramon Santamaria (@raysan5)
//* Rewrite in Zig by HaxSam (@haxsam)
//*
//*******************************************************************************************
const rl = @import("raylib");
const std = @import("std");
const builtin = @import("builtin");
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
const screenWidth: c_int = 800;
const screenHeight: c_int = 450;
//----------------------------------------------------------------------------------
// Program main entry point
//----------------------------------------------------------------------------------
pub fn main() void {
// Initialization
//--------------------------------------------------------------------------------------
rl.InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
if (builtin.os.tag == .emscripten) {
std.os.emscripten.emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
} else {
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!rl.WindowShouldClose()) // Detect window close button or ESC key
{
UpdateDrawFrame();
}
}
// De-Initialization
//--------------------------------------------------------------------------------------
rl.CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
}
//----------------------------------------------------------------------------------
// Module Functions Definition
//----------------------------------------------------------------------------------
fn UpdateDrawFrame() callconv(.c) void {
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
rl.BeginDrawing();
rl.ClearBackground(rl.RAYWHITE);
rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.LIGHTGRAY);
rl.EndDrawing();
//----------------------------------------------------------------------------------
}

View File

@ -26,13 +26,13 @@ REM Checks if cl is available and skips to the argument loop if it is
REM (Prevents calling vcvarsall every time you run this script)
WHERE cl >nul 2>nul
IF %ERRORLEVEL% == 0 goto READ_ARGS
REM Activate the msvc build environment if cl isn't available yet
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
set VC_INIT="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
) ELSE IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" (
set VC_INIT="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat"
) ELSE IF EXIST "C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat" (
set VC_INIT="C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat"
for /f "tokens=*" %%i in (
'"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath 2^>nul'
) do set VS_PATH=%%i
IF defined VS_PATH (
set VC_INIT="%VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat"
) ELSE (
REM Initialize your vc environment here if the defaults don't work
REM set VC_INIT="C:\your\path\here\vcvarsall.bat"
@ -167,7 +167,7 @@ IF NOT EXIST !TEMP_DIR!\ (
cd !TEMP_DIR!
REM raylib source folder
set "RAYLIB_DEFINES=/D_DEFAULT_SOURCE /DPLATFORM_DESKTOP /DGRAPHICS_API_OPENGL_33"
set RAYLIB_C_FILES="!RAYLIB_SRC!\rcore.c" "!RAYLIB_SRC!\rshapes.c" "!RAYLIB_SRC!\rtextures.c" "!RAYLIB_SRC!\rtext.c" "!RAYLIB_SRC!\rmodels.c" "!RAYLIB_SRC!\utils.c" "!RAYLIB_SRC!\raudio.c" "!RAYLIB_SRC!\rglfw.c"
set RAYLIB_C_FILES="!RAYLIB_SRC!\rcore.c" "!RAYLIB_SRC!\rshapes.c" "!RAYLIB_SRC!\rtextures.c" "!RAYLIB_SRC!\rtext.c" "!RAYLIB_SRC!\rmodels.c" "!RAYLIB_SRC!\raudio.c" "!RAYLIB_SRC!\rglfw.c"
set RAYLIB_INCLUDE_FLAGS=/I"!RAYLIB_SRC!" /I"!RAYLIB_SRC!\external\glfw\include"
IF DEFINED REALLY_QUIET (

View File

@ -117,9 +117,8 @@ RAYLIB_MODULE_RAYGUI_PATH ?= $(RAYLIB_SRC_PATH)/../../raygui/src
# Use external GLFW library instead of rglfw module
USE_EXTERNAL_GLFW ?= FALSE
# Enable support for X11 by default on Linux when using GLFW
# NOTE: Wayland is disabled by default, only enable if you are sure
GLFW_LINUX_ENABLE_WAYLAND ?= FALSE
# Enable support for Wayland and X11 by default on Linux when using GLFW
GLFW_LINUX_ENABLE_WAYLAND ?= TRUE
GLFW_LINUX_ENABLE_X11 ?= TRUE
# Enable support for X11 by default on Linux when using RGFW
@ -275,15 +274,28 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
GRAPHICS ?= GRAPHICS_API_OPENGL_ES2
#GRAPHICS = GRAPHICS_API_OPENGL_SOFTWARE # Uncomment to use software rendering
endif
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
# 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
endif
ifeq ($(TARGET_PLATFORM),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
ifeq ($(GRAPHICS),GRAPHICS_API_OPENGL_SOFTWARE)
$(error WEB_RGFW: Software rendering not supported!)
endif
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
# By default use OpenGL ES 2.0 on Android
GRAPHICS ?= GRAPHICS_API_OPENGL_ES2
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_MEMORY)
# By default use OpenGL Software
GRAPHICS = GRAPHICS_API_OPENGL_SOFTWARE
endif
# Define default C compiler and archiver to pack library: CC, AR
#------------------------------------------------------------------------------------------------
@ -320,7 +332,12 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
AR = $(RPI_TOOLCHAIN)/bin/$(RPI_TOOLCHAIN_NAME)-ar
endif
endif
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
# HTML5 emscripten compiler
CC = emcc
AR = emar
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB_RGFW)
# HTML5 emscripten compiler
CC = emcc
AR = emar
@ -364,7 +381,6 @@ ifneq ($(RAYLIB_CONFIG_FLAGS), NONE)
endif
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
CFLAGS += -std=c99
@ -383,12 +399,15 @@ ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
endif
ifeq ($(RAYLIB_BUILD_MODE),RELEASE)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
CFLAGS += -Os
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
CFLAGS += -O1
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
CFLAGS += -Os
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB_RGFW)
CFLAGS += -Os
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
CFLAGS += -O2
endif
@ -402,23 +421,12 @@ endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
CFLAGS += -Werror=implicit-function-declaration
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)
# -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)
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
CFLAGS += --profiling
endif
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB_RGFW)
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
CFLAGS += --profiling
endif
@ -768,7 +776,6 @@ all: raylib
raylib: $(OBJS)
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
ifeq ($(RAYLIB_LIBTYPE),SHARED)
@echo "WARNING: $(TARGET_PLATFORM) does not support SHARED libraries. Generating STATIC library."
endif

View File

@ -73,7 +73,7 @@
#define SUPPORT_RPRAND_GENERATOR 1
#endif
#ifndef SUPPORT_MOUSE_GESTURES
// Mouse gestures are directly mapped like touches and processed by gestures system
// Mouse gestures are directly mapped like touches and processed by the gestures system
#define SUPPORT_MOUSE_GESTURES 1
#endif
#ifndef SUPPORT_SSH_KEYBOARD_RPI
@ -125,7 +125,7 @@
#endif
// rcore: Configuration values
// NOTE: Below values are alread defined inside [rcore.c] so there is no need to be
// NOTE: Below values are already defined inside [rcore.c] so there is no need to be
// redefined here, in case it must be done, uncomment the required line and update
// the value; it can also be done on compilation with -DVALUE_TO_REDEFINE=128
//------------------------------------------------------------------------------------
@ -159,7 +159,7 @@
#endif
// rlgl: Configuration values
// NOTE: Below values are alread defined inside [rlgl.h] so there is no need to be
// NOTE: Below values are already defined inside [rlgl.h] so there is no need to be
// redefined here, in case it must be done, uncomment the required line and update
// the value; it can also be done on compilation with -DVALUE_TO_REDEFINE=128
//------------------------------------------------------------------------------------
@ -252,6 +252,9 @@
#ifndef SUPPORT_FILEFORMAT_PIC
#define SUPPORT_FILEFORMAT_PIC 0 // Disabled by default
#endif
#ifndef SUPPORT_FILEFORMAT_PNM
#define SUPPORT_FILEFORMAT_PNM 0 // Disabled by default
#endif
#ifndef SUPPORT_FILEFORMAT_KTX
#define SUPPORT_FILEFORMAT_KTX 0 // Disabled by default
#endif
@ -349,7 +352,7 @@
#endif
// raudio: Configuration values
// NOTE: Below values are alread defined inside [rlgl.h] so there is no need to be
// NOTE: Below values are already defined inside [rlgl.h] so there is no need to be
// redefined here, in case it must be done, uncomment the required line and update
// the value; it can also be done on compilation with -DVALUE_TO_REDEFINE=128
//------------------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
/*
FLAC audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
dr_flac - v0.13.3 - 2026-01-17
dr_flac - v0.13.4 - TBD
David Reid - mackron@gmail.com
@ -126,7 +126,7 @@ extern "C" {
#define DRFLAC_VERSION_MAJOR 0
#define DRFLAC_VERSION_MINOR 13
#define DRFLAC_VERSION_REVISION 3
#define DRFLAC_VERSION_REVISION 4
#define DRFLAC_VERSION_STRING DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MAJOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MINOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_REVISION)
#include <stddef.h> /* For size_t. */
@ -1547,6 +1547,8 @@ static DRFLAC_INLINE drflac_bool32 drflac_has_sse41(void)
#define DRFLAC_ZERO_OBJECT(p) DRFLAC_ZERO_MEMORY((p), sizeof(*(p)))
#endif
#define DRFLAC_MIN(a, b) (((a) < (b)) ? (a) : (b))
#define DRFLAC_MAX_SIMD_VECTOR_SIZE 64 /* 64 for AVX-512 in the future. */
/* Result Codes */
@ -5980,8 +5982,6 @@ static drflac_bool32 drflac__seek_to_pcm_frame__binary_search_internal(drflac* p
break; /* Failed to seek to FLAC frame. */
}
} else {
const float approxCompressionRatio = (drflac_int64)(lastSuccessfulSeekOffset - pFlac->firstFLACFramePosInBytes) / ((drflac_int64)(pcmRangeLo * pFlac->channels * pFlac->bitsPerSample)/8.0f);
if (pcmRangeLo > pcmFrameIndex) {
/* We seeked too far forward. We need to move our target byte backward and try again. */
byteRangeHi = lastSuccessfulSeekOffset;
@ -6004,12 +6004,14 @@ static drflac_bool32 drflac__seek_to_pcm_frame__binary_search_internal(drflac* p
break; /* Failed to seek to FLAC frame. */
}
} else {
const double approxCompressionRatio = (drflac_int64)(lastSuccessfulSeekOffset - pFlac->firstFLACFramePosInBytes) / ((drflac_int64)(pcmRangeLo * pFlac->channels * pFlac->bitsPerSample)/8.0);
byteRangeLo = lastSuccessfulSeekOffset;
if (byteRangeHi < byteRangeLo) {
byteRangeHi = byteRangeLo;
}
targetByte = lastSuccessfulSeekOffset + (drflac_uint64)(((drflac_int64)((pcmFrameIndex-pcmRangeLo) * pFlac->channels * pFlac->bitsPerSample)/8.0f) * approxCompressionRatio);
targetByte = lastSuccessfulSeekOffset + (drflac_uint64)(((drflac_int64)((pcmFrameIndex-pcmRangeLo) * pFlac->channels * pFlac->bitsPerSample)/8.0) * approxCompressionRatio);
if (targetByte > byteRangeHi) {
targetByte = byteRangeHi;
}
@ -6402,7 +6404,7 @@ static void* drflac__realloc_from_callbacks(void* p, size_t szNew, size_t szOld,
}
if (p != NULL) {
DRFLAC_COPY_MEMORY(p2, p, szOld);
DRFLAC_COPY_MEMORY(p2, p, DRFLAC_MIN(szNew, szOld));
pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData);
}
@ -6430,11 +6432,22 @@ static drflac_bool32 drflac__read_and_decode_metadata(drflac_read_proc onRead, d
We want to keep track of the byte position in the stream of the seektable. At the time of calling this function we know that
we'll be sitting on byte 42.
*/
drflac_uint64 runningFilePos = 42;
drflac_uint64 seektablePos = 0;
drflac_uint32 seektableSize = 0;
drflac_uint64 runningFilePos = 42;
drflac_uint64 seektablePos = 0;
drflac_uint32 seektableSize = 0;
drflac_int64 fileSize = 0;
drflac_bool32 hasKnownFileSize = DRFLAC_FALSE;
(void)onTell;
/* We'll be doing some memory allocations here against untrusted data. We'll do a basic validation check that they don't exceed the size of the file. */
if (onTell != NULL && onSeek != NULL) {
if (onSeek(pUserData, 0, DRFLAC_SEEK_END)) {
if (onTell(pUserData, &fileSize)) {
hasKnownFileSize = DRFLAC_TRUE;
}
onSeek(pUserData, runningFilePos, DRFLAC_SEEK_SET);
}
}
for (;;) {
drflac_metadata metadata;
@ -6444,6 +6457,11 @@ static drflac_bool32 drflac__read_and_decode_metadata(drflac_read_proc onRead, d
if (drflac__read_and_decode_block_header(onRead, pUserData, &isLastBlock, &blockType, &blockSize) == DRFLAC_FALSE) {
return DRFLAC_FALSE;
}
if (hasKnownFileSize && (blockSize > ((drflac_uint64)fileSize - runningFilePos))) {
return DRFLAC_FALSE; /* Block size exceeds the size of the file. */
}
runningFilePos += 4;
metadata.type = blockType;
@ -6559,7 +6577,7 @@ static drflac_bool32 drflac__read_and_decode_metadata(drflac_read_proc onRead, d
drflac__free_from_callbacks(pRawData, pAllocationCallbacks);
return DRFLAC_FALSE;
}
metadata.data.vorbis_comment.vendor = pRunningData; pRunningData += metadata.data.vorbis_comment.vendorLength;
metadata.data.vorbis_comment.vendor = pRunningData; pRunningData += metadata.data.vorbis_comment.vendorLength;
metadata.data.vorbis_comment.commentCount = drflac__le2host_32_ptr_unaligned(pRunningData); pRunningData += 4;
/* Need space for 'commentCount' comments after the block, which at minimum is a drflac_uint32 per comment */
@ -6747,13 +6765,18 @@ static drflac_bool32 drflac__read_and_decode_metadata(drflac_read_proc onRead, d
blockSizeRemaining -= 4;
metadata.data.picture.mimeLength = drflac__be2host_32(metadata.data.picture.mimeLength);
if (blockSizeRemaining < metadata.data.picture.mimeLength) {
result = DRFLAC_FALSE;
goto done_flac;
}
pMime = (char*)drflac__malloc_from_callbacks(metadata.data.picture.mimeLength + 1, pAllocationCallbacks); /* +1 for null terminator. */
if (pMime == NULL) {
result = DRFLAC_FALSE;
goto done_flac;
}
if (blockSizeRemaining < metadata.data.picture.mimeLength || onRead(pUserData, pMime, metadata.data.picture.mimeLength) != metadata.data.picture.mimeLength) {
if (onRead(pUserData, pMime, metadata.data.picture.mimeLength) != metadata.data.picture.mimeLength) {
result = DRFLAC_FALSE;
goto done_flac;
}
@ -6769,13 +6792,18 @@ static drflac_bool32 drflac__read_and_decode_metadata(drflac_read_proc onRead, d
blockSizeRemaining -= 4;
metadata.data.picture.descriptionLength = drflac__be2host_32(metadata.data.picture.descriptionLength);
if (blockSizeRemaining < metadata.data.picture.descriptionLength) {
result = DRFLAC_FALSE;
goto done_flac;
}
pDescription = (char*)drflac__malloc_from_callbacks(metadata.data.picture.descriptionLength + 1, pAllocationCallbacks); /* +1 for null terminator. */
if (pDescription == NULL) {
result = DRFLAC_FALSE;
goto done_flac;
}
if (blockSizeRemaining < metadata.data.picture.descriptionLength || onRead(pUserData, pDescription, metadata.data.picture.descriptionLength) != metadata.data.picture.descriptionLength) {
if (onRead(pUserData, pDescription, metadata.data.picture.descriptionLength) != metadata.data.picture.descriptionLength) {
result = DRFLAC_FALSE;
goto done_flac;
}
@ -8094,11 +8122,17 @@ static drflac* drflac_open_with_metadata_private(drflac_read_proc onRead, drflac
return NULL;
}
if ((0xFFFFFFFF - (seekpointCount * sizeof(drflac_seekpoint))) < allocationSize) {
#ifndef DR_FLAC_NO_OGG
drflac__free_from_callbacks(pOggbs, &allocationCallbacks);
#endif
return NULL;
}
allocationSize += seekpointCount * sizeof(drflac_seekpoint);
}
pFlac = (drflac*)drflac__malloc_from_callbacks(allocationSize, &allocationCallbacks);
pFlac = (drflac*)drflac__malloc_from_callbacks((size_t)allocationSize, &allocationCallbacks);
if (pFlac == NULL) {
#ifndef DR_FLAC_NO_OGG
drflac__free_from_callbacks(pOggbs, &allocationCallbacks);
@ -12169,6 +12203,10 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat
/*
REVISION HISTORY
================
v0.13.4 - TBD
- Add a bounds check when allocating memory during metadata processing.
- Fix a possible overflow error when parsing picture metadata.
v0.13.3 - 2026-01-17
- Fix a compiler compatibility issue with some inlined assembly.
- Fix a compilation warning.

61
src/external/dr_mp3.h vendored
View File

@ -3188,6 +3188,10 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm
pTagDataBeg = pFirstFrameData + DRMP3_HDR_SIZE + (bs.pos/8);
pTagData = pTagDataBeg;
if (firstFrameInfo.frame_bytes - (size_t)(pTagData - pFirstFrameData) < 8) {
goto done_xing_info; /* Frame too small for a Xing/Info tag. */
}
/* Check for both "Xing" and "Info" identifiers. */
isXing = (pTagData[0] == 'X' && pTagData[1] == 'i' && pTagData[2] == 'n' && pTagData[3] == 'g');
isInfo = (pTagData[0] == 'I' && pTagData[1] == 'n' && pTagData[2] == 'f' && pTagData[3] == 'o');
@ -3199,42 +3203,60 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm
pTagData += 8; /* Skip past the ID and flags. */
if (flags & 0x01) { /* FRAMES flag. */
if (firstFrameInfo.frame_bytes - (size_t)(pTagData - pFirstFrameData) < 4) {
goto done_xing_info; /* Invalid Xing/Info tag. */
}
detectedMP3FrameCount = (drmp3_uint32)pTagData[0] << 24 | (drmp3_uint32)pTagData[1] << 16 | (drmp3_uint32)pTagData[2] << 8 | (drmp3_uint32)pTagData[3];
pTagData += 4;
}
if (flags & 0x02) { /* BYTES flag. */
if (firstFrameInfo.frame_bytes - (size_t)(pTagData - pFirstFrameData) < 4) {
goto done_xing_info; /* Invalid Xing/Info tag. */
}
bytes = (drmp3_uint32)pTagData[0] << 24 | (drmp3_uint32)pTagData[1] << 16 | (drmp3_uint32)pTagData[2] << 8 | (drmp3_uint32)pTagData[3];
(void)bytes; /* <-- Just to silence a warning about `bytes` being assigned but unused. Want to leave this here in case I want to make use of it later. */
pTagData += 4;
}
if (flags & 0x04) { /* TOC flag. */
if (firstFrameInfo.frame_bytes - (size_t)(pTagData - pFirstFrameData) < 100) {
goto done_xing_info; /* Invalid Xing/Info tag. */
}
/* TODO: Extract and bind seek points. */
pTagData += 100;
}
if (flags & 0x08) { /* SCALE flag. */
if (firstFrameInfo.frame_bytes - (size_t)(pTagData - pFirstFrameData) < 4) {
goto done_xing_info; /* Invalid Xing/Info tag. */
}
pTagData += 4;
}
/* At this point we're done with the Xing/Info header. Now we can look at the LAME data. */
if (pTagData[0]) {
int delayInPCMFrames;
int paddingInPCMFrames;
if (firstFrameInfo.frame_bytes - (size_t)(pTagData - pFirstFrameData) < 36) {
goto done_xing_info; /* Invalid Xing/Info tag. */
}
pTagData += 21;
if (pTagData - pFirstFrameData + 14 < firstFrameInfo.frame_bytes) {
int delayInPCMFrames;
int paddingInPCMFrames;
delayInPCMFrames = (( (drmp3_uint32)pTagData[0] << 4) | ((drmp3_uint32)pTagData[1] >> 4)) + (528 + 1);
paddingInPCMFrames = ((((drmp3_uint32)pTagData[1] & 0xF) << 8) | ((drmp3_uint32)pTagData[2] )) - (528 + 1);
if (paddingInPCMFrames < 0) {
paddingInPCMFrames = 0; /* Padding cannot be negative. Probably a malformed file. Ignore. */
}
pMP3->delayInPCMFrames = (drmp3_uint32)delayInPCMFrames;
pMP3->paddingInPCMFrames = (drmp3_uint32)paddingInPCMFrames;
delayInPCMFrames = (( (drmp3_uint32)pTagData[0] << 4) | ((drmp3_uint32)pTagData[1] >> 4)) + (528 + 1);
paddingInPCMFrames = ((((drmp3_uint32)pTagData[1] & 0xF) << 8) | ((drmp3_uint32)pTagData[2] )) - (528 + 1);
if (paddingInPCMFrames < 0) {
paddingInPCMFrames = 0; /* Padding cannot be negative. Probably a malformed file. Ignore. */
}
pMP3->delayInPCMFrames = (drmp3_uint32)delayInPCMFrames;
pMP3->paddingInPCMFrames = (drmp3_uint32)paddingInPCMFrames;
}
/*
@ -3273,6 +3295,8 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm
*/
drmp3dec_init(&pMP3->decoder);
}
done_xing_info:;
} else {
/* Failed to read the side info. */
}
@ -3285,7 +3309,7 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm
}
if (detectedMP3FrameCount != 0xFFFFFFFF) {
pMP3->totalPCMFrameCount = detectedMP3FrameCount * firstFramePCMFrameCount;
pMP3->totalPCMFrameCount = (drmp3_uint64)detectedMP3FrameCount * firstFramePCMFrameCount;
}
pMP3->channels = pMP3->mp3FrameChannels;
@ -4247,7 +4271,7 @@ DRMP3_API drmp3_uint64 drmp3_read_pcm_frames_f32(drmp3* pMP3, drmp3_uint64 frame
#else
/* Slow path. Convert from s16 to f32. */
{
drmp3_int16 pTempS16[8192];
drmp3_int16 pTempS16[1152*2]; /* MP3 frames have a maximum per-channel sample count of 1152. Times 2 to account for stereo. */
drmp3_uint64 totalPCMFramesRead = 0;
while (totalPCMFramesRead < framesToRead) {
@ -4284,7 +4308,7 @@ DRMP3_API drmp3_uint64 drmp3_read_pcm_frames_s16(drmp3* pMP3, drmp3_uint64 frame
#else
/* Slow path. Convert from f32 to s16. */
{
float pTempF32[4096];
float pTempF32[1152*2]; /* MP3 frames have a maximum per-channel sample count of 1152. Times 2 to account for stereo. */
drmp3_uint64 totalPCMFramesRead = 0;
while (totalPCMFramesRead < framesToRead) {
@ -4772,7 +4796,7 @@ static float* drmp3__full_read_and_close_f32(drmp3* pMP3, drmp3_config* pConfig,
drmp3_uint64 totalFramesRead = 0;
drmp3_uint64 framesCapacity = 0;
float* pFrames = NULL;
float temp[4096];
float temp[1152*2]; /* MP3 frames have a maximum per-channel sample count of 1152. Times 2 to account for stereo. */
DRMP3_ASSERT(pMP3 != NULL);
@ -4841,7 +4865,7 @@ static drmp3_int16* drmp3__full_read_and_close_s16(drmp3* pMP3, drmp3_config* pC
drmp3_uint64 totalFramesRead = 0;
drmp3_uint64 framesCapacity = 0;
drmp3_int16* pFrames = NULL;
drmp3_int16 temp[4096];
drmp3_int16 temp[1152*2]; /* MP3 frames have a maximum per-channel sample count of 1152. Times 2 to account for stereo. */
DRMP3_ASSERT(pMP3 != NULL);
@ -5010,6 +5034,9 @@ DIFFERENCES BETWEEN minimp3 AND dr_mp3
REVISION HISTORY
================
v0.7.4 - TBD
- Fix an overflow error with "Xing" and "Info" tag parsing.
- Add some validation checks for "Xing" and "Info" tag parsing.
- Reduce size of some stack allocations.
- Improvements to SIMD detection.
v0.7.3 - 2026-01-17

63
src/external/dr_wav.h vendored
View File

@ -1,6 +1,6 @@
/*
WAV audio loader and writer. Choice of public domain or MIT-0. See license statements at the end of this file.
dr_wav - v0.14.5 - 2026-03-03
dr_wav - v0.14.6 - TBD
David Reid - mackron@gmail.com
@ -147,7 +147,7 @@ extern "C" {
#define DRWAV_VERSION_MAJOR 0
#define DRWAV_VERSION_MINOR 14
#define DRWAV_VERSION_REVISION 5
#define DRWAV_VERSION_REVISION 6
#define DRWAV_VERSION_STRING DRWAV_XSTRINGIFY(DRWAV_VERSION_MAJOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_MINOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_REVISION)
#include <stddef.h> /* For size_t. */
@ -1971,7 +1971,15 @@ DRWAV_PRIVATE drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void
return DRWAV_INVALID_FILE;
}
pHeaderOut->sizeInBytes = drwav_bytes_to_u64(sizeInBytes) - 24; /* <-- Subtract 24 because w64 includes the size of the header. */
pHeaderOut->sizeInBytes = drwav_bytes_to_u64(sizeInBytes);
/* Subtract 24 from the size because with w64 the reported chunk size includes the size of the header itself. */
if (pHeaderOut->sizeInBytes >= 24) {
pHeaderOut->sizeInBytes -= 24;
} else {
return DRWAV_INVALID_FILE;
}
pHeaderOut->paddingSize = drwav__chunk_padding_size_w64(pHeaderOut->sizeInBytes);
*pRunningBytesReadOut += 24;
} else {
@ -2201,7 +2209,7 @@ DRWAV_PRIVATE drwav_uint64 drwav__read_smpl_to_metadata_obj(drwav__metadata_pars
so it's consistent with how we do it in the first stage.
*/
loopCount = drwav_bytes_to_u32(smplHeaderData + 28);
calculatedLoopCount = (pChunkHeader->sizeInBytes - DRWAV_SMPL_BYTES) / DRWAV_SMPL_LOOP_BYTES;
calculatedLoopCount = (drwav_uint32)((pChunkHeader->sizeInBytes - DRWAV_SMPL_BYTES) / DRWAV_SMPL_LOOP_BYTES);
if (loopCount != calculatedLoopCount) {
return totalBytesRead;
}
@ -2580,8 +2588,10 @@ DRWAV_PRIVATE drwav_uint64 drwav__read_bext_to_metadata_obj(drwav__metadata_pars
pMetadata->data.bext.pCodingHistory = (char*)drwav__metadata_get_memory(pParser, extraBytes + 1, 1);
DRWAV_ASSERT(pMetadata->data.bext.pCodingHistory != NULL);
bytesRead += drwav__metadata_parser_read(pParser, pMetadata->data.bext.pCodingHistory, extraBytes, NULL);
pMetadata->data.bext.codingHistorySize = (drwav_uint32)drwav__strlen(pMetadata->data.bext.pCodingHistory);
pMetadata->data.bext.codingHistorySize = (drwav_uint32)drwav__metadata_parser_read(pParser, pMetadata->data.bext.pCodingHistory, extraBytes, NULL);
pMetadata->data.bext.pCodingHistory[pMetadata->data.bext.codingHistorySize] = '\0'; /* <-- Explicit null terminator in case of a badly formed file. */
bytesRead += pMetadata->data.bext.codingHistorySize;
} else {
pMetadata->data.bext.pCodingHistory = NULL;
pMetadata->data.bext.codingHistorySize = 0;
@ -2755,10 +2765,10 @@ DRWAV_PRIVATE drwav_uint64 drwav__metadata_process_chunk(drwav__metadata_parser*
bytesJustRead = drwav__metadata_parser_read(pParser, buffer, sizeof(buffer), &bytesRead);
if (bytesJustRead == sizeof(buffer)) {
drwav_uint32 loopCount = drwav_bytes_to_u32(buffer);
drwav_uint64 calculatedLoopCount;
drwav_uint32 calculatedLoopCount;
/* The loop count must be validated against the size of the chunk. */
calculatedLoopCount = (pChunkHeader->sizeInBytes - DRWAV_SMPL_BYTES) / DRWAV_SMPL_LOOP_BYTES;
calculatedLoopCount = (drwav_uint32)((pChunkHeader->sizeInBytes - DRWAV_SMPL_BYTES) / DRWAV_SMPL_LOOP_BYTES);
if (calculatedLoopCount == loopCount) {
bytesJustRead = drwav__metadata_parser_read(pParser, buffer, sizeof(buffer), &bytesRead);
if (bytesJustRead == sizeof(buffer)) {
@ -2860,7 +2870,9 @@ DRWAV_PRIVATE drwav_uint64 drwav__metadata_process_chunk(drwav__metadata_parser*
return bytesRead;
}
allocSizeNeeded += drwav__strlen(buffer) + 1;
allocSizeNeeded += (size_t)pChunkHeader->sizeInBytes - DRWAV_BEXT_BYTES + 1; /* Coding history. */
/* Coding history. */
allocSizeNeeded += (size_t)pChunkHeader->sizeInBytes - DRWAV_BEXT_BYTES + 1;
drwav__metadata_request_extra_memory_for_stage_2(pParser, allocSizeNeeded, 1);
@ -3321,6 +3333,10 @@ DRWAV_PRIVATE drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc on
((pWav->container == drwav_container_w64) && drwav_guid_equal(header.id.guid, drwavGUID_W64_FMT))) {
drwav_uint8 fmtData[16];
if (header.sizeInBytes < sizeof(fmtData)) {
return DRWAV_FALSE; /* Invalid fmt chunk. */
}
foundChunk_fmt = DRWAV_TRUE;
if (pWav->onRead(pWav->pUserData, fmtData, sizeof(fmtData)) != sizeof(fmtData)) {
@ -3833,6 +3849,11 @@ DRWAV_PRIVATE drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc on
/* We decode two samples per byte. There will be blockCount headers in the data chunk. This is enough to know how to calculate the total PCM frame count. */
totalBlockHeaderSizeInBytes = blockCount * (6*fmt.channels);
if (totalBlockHeaderSizeInBytes >= dataChunkSize) { /* <-- We'll be subtracting totalBlockHeaderSizeInBytes from dataChunkSize next so it must be validated. */
drwav_free(pWav->pMetadata, &pWav->allocationCallbacks);
return DRWAV_FALSE; /* Invalid file. */
}
pWav->totalPCMFrameCount = ((dataChunkSize - totalBlockHeaderSizeInBytes) * 2) / fmt.channels;
}
if (pWav->translatedFormatTag == DR_WAVE_FORMAT_DVI_ADPCM) {
@ -3846,6 +3867,11 @@ DRWAV_PRIVATE drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc on
/* We decode two samples per byte. There will be blockCount headers in the data chunk. This is enough to know how to calculate the total PCM frame count. */
totalBlockHeaderSizeInBytes = blockCount * (4*fmt.channels);
if (totalBlockHeaderSizeInBytes >= dataChunkSize) { /* <-- We'll be subtracting totalBlockHeaderSizeInBytes from dataChunkSize next so it must be validated. */
drwav_free(pWav->pMetadata, &pWav->allocationCallbacks);
return DRWAV_FALSE; /* Invalid file. */
}
pWav->totalPCMFrameCount = ((dataChunkSize - totalBlockHeaderSizeInBytes) * 2) / fmt.channels;
/* The header includes a decoded sample for each channel which acts as the initial predictor sample. */
@ -6725,6 +6751,10 @@ DRWAV_PRIVATE void drwav__pcm_to_s16(drwav_int16* pOut, const drwav_uint8* pIn,
shift += 8;
}
if (!drwav__is_little_endian()) {
sample = drwav__bswap64(sample);
}
pIn += j;
*pOut++ = (drwav_int16)((drwav_int64)sample >> 48);
}
@ -7166,6 +7196,10 @@ DRWAV_PRIVATE void drwav__pcm_to_f32(float* pOut, const drwav_uint8* pIn, size_t
shift += 8;
}
if (!drwav__is_little_endian()) {
sample = drwav__bswap64(sample);
}
pIn += j;
*pOut++ = (float)((drwav_int64)sample / 9223372036854775807.0);
}
@ -7650,6 +7684,10 @@ DRWAV_PRIVATE void drwav__pcm_to_s32(drwav_int32* pOut, const drwav_uint8* pIn,
shift += 8;
}
if (!drwav__is_little_endian()) {
sample = drwav__bswap64(sample);
}
pIn += j;
*pOut++ = (drwav_int32)((drwav_int64)sample >> 32);
}
@ -8557,6 +8595,13 @@ DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b)
/*
REVISION HISTORY
================
v0.14.6 - TBD
- Fix an error when loading files with a malformed "bext" chunk.
- Fix an error when loading files with a malformed "fmt" chunk.
- Fix an underflow error with badly formed ADPCM encoded files.
- Fix an underflow error with badly formed W64 files.
- Fix an error when converting from >32 bit samples to s16/f32/s32 on big-endian architectures.
v0.14.5 - 2026-03-03
- Fix a crash when loading files with a malformed "smpl" chunk.
- Fix a signed overflow bug with the MS-ADPCM decoder.

View File

@ -1538,10 +1538,10 @@ mulong jar_mod_load_file(jar_mod_context_t * modctx, const char* filename)
modctx->modfile = (muchar *) JARMOD_MALLOC(fsize);
modctx->modfilesize = fsize;
memset(modctx->modfile, 0, fsize);
fread(modctx->modfile, fsize, 1, f);
if(fread(modctx->modfile, fsize, 1, f) != 1) fsize = 0;
fclose(f);
if(!jar_mod_load(modctx, (void *)modctx->modfile, fsize)) fsize = 0;
if(fsize && !jar_mod_load(modctx, (void *)modctx->modfile, fsize)) fsize = 0;
} else fsize = 0;
}
return fsize;

187
src/external/rlsw.h vendored
View File

@ -153,7 +153,7 @@
#define SW_MAX_TEXTURES 128
#endif
// Enables the use of a lookup table for uint8_t to float conversion
// Enable the use of a lookup table for uint8_t to float conversion
// Requires an additional 1KB of global memory
// Disabled when SIMD intrinsics are enabled
#ifndef SW_USE_COLOR_LUT
@ -164,6 +164,19 @@
#endif
#endif
// Fast power-of-two texture wrap (SW_REPEAT mode only)
// When defined, textures whose width/height are powers of two use a bitmask
// wrap (`x & (size-1)`) instead of `floorf`-based fractional wrap or the
// signed `%` chain in the linear sampler. Saves a software divide on Xtensa
// and a few instructions everywhere. NPOT textures keep using the original
// path via a runtime `(size & (size-1)) == 0` check, so SW_REPEAT remains
// correct for them. The only observable behavior change is for POT textures
// sampled with negative UV coordinates: bitmask wrap (two's complement) can
// differ from `sw_fract` by one texel. Off by default to keep bit-for-bit
// behavior; opt in if you control your asset UVs.
//
// #define SW_TEXTURE_REPEAT_POT_FAST
//----------------------------------------------------------------------------------
// OpenGL Compatibility Types
//----------------------------------------------------------------------------------
@ -200,6 +213,7 @@ typedef double GLclampd;
#define GL_RENDERER 0x1F01
#define GL_VERSION 0x1F02
#define GL_EXTENSIONS 0x1F03
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
//#define GL_ATTRIB_STACK_DEPTH 0x0BB0
//#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
@ -507,6 +521,7 @@ typedef enum {
SW_RENDERER = GL_RENDERER,
SW_VERSION = GL_VERSION,
SW_EXTENSIONS = GL_EXTENSIONS,
SW_SHADING_LANGUAGE_VERSION = GL_SHADING_LANGUAGE_VERSION,
SW_COLOR_CLEAR_VALUE = GL_COLOR_CLEAR_VALUE,
SW_DEPTH_CLEAR_VALUE = GL_DEPTH_CLEAR_VALUE,
SW_CURRENT_COLOR = GL_CURRENT_COLOR,
@ -844,6 +859,17 @@ SWAPI void swGetFramebufferAttachmentParameteriv(SWattachment attachment, SWatta
#endif
#endif
// ESP-DSP acceleration: ESP-IDF ships an optimized math library that includes
// `dspm_mult_4x4x4_f32` (4x4 matrix multiply) and `dspm_mult_4x4x1_f32`
// (matrix * vector). These are S3-tuned hand-vectorized kernels that beat the
// scalar versions for both throughput and code-size. Detection is opt-in to
// keep the dependency optional: define SW_USE_ESP_DSP from your build system
// (or rely on the `idf_component.yml` example shown in the rlsw docs).
#if defined(ESP_PLATFORM) && defined(SW_USE_ESP_DSP)
#define SW_HAS_ESP_DSP
#include "dspm_mult.h"
#endif
#ifdef __cplusplus
#define SW_CURLY_INIT(name) name
#else
@ -1038,6 +1064,9 @@ typedef struct {
SWmatrix currentMatrixMode; // Current matrix mode (e.g., sw_MODELVIEW, sw_PROJECTION)
sw_matrix_t *currentMatrix; // Pointer to the currently used matrix according to the mode
sw_matrix_t matMVP; // Model view projection matrix, calculated and used internally
#ifdef SW_HAS_ESP_DSP
float matMVP_rm[16]; // Row-major MVP, kept in sync for esp-dsp dspm_mult_4x4x1_f32 vertex transform
#endif
bool isDirtyMVP; // Indicates if the MVP matrix should be rebuilt
sw_handle_t boundFramebufferId; // Framebuffer currently bound
@ -1141,6 +1170,14 @@ static inline void sw_matrix_id(sw_matrix_t dst)
static inline void sw_matrix_mul_rst(float *SW_RESTRICT dst, const float *SW_RESTRICT left, const float *SW_RESTRICT right)
{
#ifdef SW_HAS_ESP_DSP
// dspm_mult_4x4x4_f32 treats its operands as row-major. rlsw stores matrices
// column-major, so passing them flat is equivalent to passing transposes:
// dspm_mult(L^T, R^T) computes (L^T)*(R^T) = (R*L)^T, written back into a
// flat array gives the same bit pattern as the column-major product (R*L)
// -- exactly the semantic the scalar fallback below has.
dspm_mult_4x4x4_f32(left, right, dst);
#else
float l00 = left[0], l01 = left[1], l02 = left[2], l03 = left[3];
float l10 = left[4], l11 = left[5], l12 = left[6], l13 = left[7];
float l20 = left[8], l21 = left[9], l22 = left[10], l23 = left[11];
@ -1165,6 +1202,7 @@ static inline void sw_matrix_mul_rst(float *SW_RESTRICT dst, const float *SW_RES
dst[7] = l10*right[3] + l11*right[7] + l12*right[11] + l13*right[15];
dst[11] = l20*right[3] + l21*right[7] + l22*right[11] + l23*right[15];
dst[15] = l30*right[3] + l31*right[7] + l32*right[11] + l33*right[15];
#endif
}
static inline void sw_matrix_mul(sw_matrix_t dst, const sw_matrix_t left, const sw_matrix_t right)
@ -1210,6 +1248,33 @@ static inline float sw_fract(float x)
return (x - floorf(x));
}
// Fast reciprocal: 1-ULP accurate in ~7 instructions on Xtensa using the
// hardware `recip0.s` seed + two Newton-Raphson refinement steps. All work
// stays in FPU registers — no `__divsf3` software call. Hot-path divisions
// in the rasterizer (span/triangle setup, perspective divide, etc.) call
// this. On non-Xtensa targets it transparently expands to `1.0f / x`, so
// generated code is identical to before.
#if defined(__XTENSA__)
__attribute__((always_inline))
static inline float sw_rcp(float x)
{
float result, temp;
__asm__(
"recip0.s %0, %2\n"
"const.s %1, 1\n"
"msub.s %1, %2, %0\n"
"madd.s %0, %0, %1\n"
"const.s %1, 1\n"
"msub.s %1, %2, %0\n"
"maddn.s %0, %0, %1\n"
: "=&f"(result), "=&f"(temp) : "f"(x)
);
return result;
}
#else
static inline float sw_rcp(float x) { return 1.0f/x; }
#endif
static inline uint8_t sw_luminance8(const uint8_t *color)
{
return (uint8_t)((color[0]*77 + color[1]*150 + color[2]*29) >> 8);
@ -2357,7 +2422,8 @@ static inline bool sw_texture_alloc(sw_texture_t *texture, const void *data, int
sw_pixel_read_color8_f readColor8 = NULL;
sw_pixel_read_color_f readColor = NULL;
if (!isDepth) {
if (!isDepth)
{
readColor8 = sw_pixel_get_read_color8_func(format);
readColor = sw_pixel_get_read_color_func(format);
}
@ -2405,18 +2471,38 @@ static inline void sw_texture_free(sw_texture_t *texture)
static inline void sw_texture_sample_nearest(float *SW_RESTRICT color, const sw_texture_t *SW_RESTRICT tex, float u, float v)
{
u = (tex->sWrap == SW_REPEAT)? sw_fract(u) : sw_saturate(u);
v = (tex->tWrap == SW_REPEAT)? sw_fract(v) : sw_saturate(v);
int x, y;
int x = u*tex->width;
int y = v*tex->height;
#ifdef SW_TEXTURE_REPEAT_POT_FAST
if ((tex->sWrap == SW_REPEAT) && ((tex->width & tex->wMinus1) == 0))
{
x = (int)(u*tex->width) & tex->wMinus1;
}
else
#endif
{
u = (tex->sWrap == SW_REPEAT)? sw_fract(u) : sw_saturate(u);
x = (int)(u*tex->width);
}
#ifdef SW_TEXTURE_REPEAT_POT_FAST
if ((tex->tWrap == SW_REPEAT) && ((tex->height & tex->hMinus1) == 0))
{
y = (int)(v*tex->height) & tex->hMinus1;
}
else
#endif
{
v = (tex->tWrap == SW_REPEAT)? sw_fract(v) : sw_saturate(v);
y = (int)(v*tex->height);
}
tex->readColor(color, tex->pixels, y*tex->width + x);
}
static inline void sw_texture_sample_linear(float *SW_RESTRICT color, const sw_texture_t *SW_RESTRICT tex, float u, float v)
{
// TODO: With a bit more cleverness thee number of operations can
// TODO: With a bit more cleverness the number of operations can
// be clearly reduced, but for now it works fine
float xf = (u*tex->width) - 0.5f;
@ -2431,13 +2517,19 @@ static inline void sw_texture_sample_linear(float *SW_RESTRICT color, const sw_t
int x1 = x0 + 1;
int y1 = y0 + 1;
// NOTE: If the textures are POT, avoid the division for SW_REPEAT
if (tex->sWrap == SW_CLAMP)
{
x0 = (x0 > tex->wMinus1)? tex->wMinus1 : x0;
x1 = (x1 > tex->wMinus1)? tex->wMinus1 : x1;
}
#ifdef SW_TEXTURE_REPEAT_POT_FAST
else if ((tex->width & tex->wMinus1) == 0)
{
// POT fast path: bitmask wrap covers negative ints via two's complement
x0 = x0 & tex->wMinus1;
x1 = x1 & tex->wMinus1;
}
#endif
else
{
x0 = (x0%tex->width + tex->width)%tex->width;
@ -2449,6 +2541,13 @@ static inline void sw_texture_sample_linear(float *SW_RESTRICT color, const sw_t
y0 = (y0 > tex->hMinus1)? tex->hMinus1 : y0;
y1 = (y1 > tex->hMinus1)? tex->hMinus1 : y1;
}
#ifdef SW_TEXTURE_REPEAT_POT_FAST
else if ((tex->height & tex->hMinus1) == 0)
{
y0 = y0 & tex->hMinus1;
y1 = y1 & tex->hMinus1;
}
#endif
else
{
y0 = (y0%tex->height + tex->height)%tex->height;
@ -2803,7 +2902,8 @@ static const sw_blend_f SW_BLEND_TABLE[SW_BLEND_FACTOR_COUNT][SW_BLEND_FACTOR_CO
// Maps a GL blend factor enum to its compact table index
static inline int sw_blend_factor_index(SWfactor f)
{
switch (f) {
switch (f)
{
case SW_ZERO: return 0;
case SW_ONE: return 1;
case SW_SRC_COLOR: return 2;
@ -2821,7 +2921,8 @@ static inline int sw_blend_factor_index(SWfactor f)
static bool sw_blend_factor_needs_alpha(SWfactor f)
{
switch (f) {
switch (f)
{
case SW_SRC_ALPHA:
case SW_ONE_MINUS_SRC_ALPHA:
case SW_DST_ALPHA:
@ -2829,6 +2930,7 @@ static bool sw_blend_factor_needs_alpha(SWfactor f)
case SW_SRC_ALPHA_SATURATE: return true;
default: break;
}
return false;
}
@ -3362,7 +3464,7 @@ static void sw_triangle_clip_and_project(void)
// Calculation of the reciprocal of W for normalization
// as well as perspective-correct attributes
const float wRcp = 1.0f/v->position[3];
const float wRcp = sw_rcp(v->position[3]);
// Division of XYZ coordinates by weight
v->position[0] *= wRcp;
@ -3477,7 +3579,7 @@ static void sw_quad_clip_and_project(void)
// Calculation of the reciprocal of W for normalization
// as well as perspective-correct attributes
const float wRcp = 1.0f/v->position[3];
const float wRcp = sw_rcp(v->position[3]);
// Division of XYZ coordinates by weight
v->position[0] *= wRcp;
@ -3655,8 +3757,8 @@ static bool sw_line_clip_and_project(sw_vertex_t *v0, sw_vertex_t *v1)
if (!sw_line_clip(v0, v1)) return false;
// Convert clip coordinates to NDC
v0->position[3] = 1.0f/v0->position[3];
v1->position[3] = 1.0f/v1->position[3];
v0->position[3] = sw_rcp(v0->position[3]);
v1->position[3] = sw_rcp(v1->position[3]);
for (int i = 0; i < 3; i++)
{
v0->position[i] *= v0->position[3];
@ -3705,7 +3807,7 @@ static bool sw_point_clip_and_project(sw_vertex_t *v)
if ((v->position[i] < -v->position[3]) || (v->position[i] > v->position[3])) return false;
}
v->position[3] = 1.0f/v->position[3];
v->position[3] = sw_rcp(v->position[3]);
v->position[0] *= v->position[3];
v->position[1] *= v->position[3];
v->position[2] *= v->position[3];
@ -3787,6 +3889,19 @@ static void sw_immediate_begin(SWdraw mode)
RLSW.stackModelview[RLSW.stackModelviewCounter - 1],
RLSW.stackProjection[RLSW.stackProjectionCounter - 1]);
#ifdef SW_HAS_ESP_DSP
// Pre-transpose to row-major so dspm_mult_4x4x1_f32(matMVP_rm, v, out)
// computes M*v directly in the per-vertex hot path. 16 scalar copies
// per MVP update vs. saving ~20 cycles per vertex transform.
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 4; j++)
{
RLSW.matMVP_rm[4*i + j] = RLSW.matMVP[4*j + i];
}
}
#endif
RLSW.isDirtyMVP = false;
}
@ -3838,11 +3953,17 @@ static void sw_immediate_push_vertex(const float position[4])
sw_vertex_t *vertex = &RLSW.primitive.buffer[RLSW.primitive.vertexCount++];
// Calculate clip coordinates
#ifdef SW_HAS_ESP_DSP
// dspm_mult_4x4x1_f32 declares its inputs non-const; rlsw treats them as
// read-only and the cast is safe (the kernel only loads from B).
dspm_mult_4x4x1_f32(RLSW.matMVP_rm, (float *)position, vertex->position);
#else
const float *m = RLSW.matMVP;
vertex->position[0] = m[0]*position[0] + m[4]*position[1] + m[8]*position[2] + m[12]*position[3];
vertex->position[1] = m[1]*position[0] + m[5]*position[1] + m[9]*position[2] + m[13]*position[3];
vertex->position[2] = m[2]*position[0] + m[6]*position[1] + m[10]*position[2] + m[14]*position[3];
vertex->position[3] = m[3]*position[0] + m[7]*position[1] + m[11]*position[2] + m[15]*position[3];
#endif
// Copy the attributes in the current vertex
for (int i = 0; i < 4; i++) vertex->color[i] = RLSW.primitive.color[i];
@ -4160,6 +4281,7 @@ const char *swGetString(SWget name)
case SW_RENDERER: result = "RLSW OpenGL Software Renderer"; break;
case SW_VERSION: result = RLSW_VERSION; break;
case SW_EXTENSIONS: result = "None"; break;
case SW_SHADING_LANGUAGE_VERSION: result = "Not supported"; break;
default: RLSW.errCode = SW_INVALID_ENUM; break;
}
@ -5268,7 +5390,7 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t
if (xStart == xEnd) return;
// Compute the inverse horizontal distance along the X axis
float dxRcp = 1.0f/(end->position[0] - start->position[0]);
float dxRcp = sw_rcp(end->position[0] - start->position[0]);
// Compute the interpolation steps along the X axis
float dWdx = (end->position[3] - start->position[3])*dxRcp;
@ -5322,12 +5444,12 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t
int blockEnd = x + SW_AFFINE_BLOCK;
if (blockEnd > xEnd) blockEnd = xEnd;
float blockLenF = (float)(blockEnd - x);
float blockLenRcp = 1.0f/blockLenF;
float blockLenRcp = sw_rcp(blockLenF);
// Only 2 '1/w' here; none inside the pixel loop
float wRcpA = 1.0f/w;
float wRcpA = sw_rcp(w);
float wB = w + dWdx*blockLenF;
float wRcpB = 1.0f/wB;
float wRcpB = sw_rcp(wB);
// Perspective-correct color at both block endpoints, then affine gradient
float srcColor[4] = {
@ -5398,7 +5520,9 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t
}
#endif
#ifdef SW_ENABLE_DEPTH_TEST
discard:
#endif
srcColor[0] += dSrcColordx[0];
srcColor[1] += dSrcColordx[1];
srcColor[2] += dSrcColordx[2];
@ -5443,9 +5567,10 @@ static void SW_RASTER_TRIANGLE(const sw_vertex_t *v0, const sw_vertex_t *v1, con
if (v0->position[1] > v1->position[1]) { const sw_vertex_t *tmp = v0; v0 = v1; v1 = tmp; }
// Extracting coordinates from the sorted vertices
float x0 = v0->position[0], y0 = v0->position[1];
float x1 = v1->position[0], y1 = v1->position[1];
float x2 = v2->position[0], y2 = v2->position[1];
// Put x away for safe keeping. Only y is used right now. Silences warnings.
float y0 = v0->position[1];
float y1 = v1->position[1];
float y2 = v2->position[1];
// Compute height differences
float h02 = y2 - y0;
@ -5455,9 +5580,9 @@ static void SW_RASTER_TRIANGLE(const sw_vertex_t *v0, const sw_vertex_t *v1, con
if (h02 < 1e-6f) return;
// Inverse edge dy for per-edge dV/dy (scanline interpolation)
float h02Rcp = 1.0f/h02;
float h01Rcp = (h01 > 1e-6f)? 1.0f/h01 : 0.0f;
float h12Rcp = (h12 > 1e-6f)? 1.0f/h12 : 0.0f;
float h02Rcp = sw_rcp(h02);
float h01Rcp = (h01 > 1e-6f)? sw_rcp(h01) : 0.0f;
float h12Rcp = (h12 > 1e-6f)? sw_rcp(h12) : 0.0f;
// Compute gradients for each side of the triangle
sw_vertex_t dVXdy02, dVXdy01, dVXdy12;
@ -5556,8 +5681,8 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
float h = (float)(yMax - yMin);
if ((w <= 0) || (h <= 0)) return;
float wRcp = 1.0f/w;
float hRcp = 1.0f/h;
float wRcp = sw_rcp(w);
float hRcp = sw_rcp(h);
// Subpixel corrections
float xSubstep = 1.0f - sw_fract(tl->position[0]);
@ -5655,7 +5780,9 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
}
#endif
#ifdef SW_ENABLE_DEPTH_TEST
discard:
#endif
color[0] += dCdx[0];
color[1] += dCdx[1];
color[2] += dCdx[2];
@ -5742,7 +5869,7 @@ static void SW_RASTER_LINE(const sw_vertex_t *v0, const sw_vertex_t *v1)
// Compute per pixel increments
float xInc = dx/steps;
float yInc = dy/steps;
float stepRcp = 1.0f/steps;
float stepRcp = sw_rcp(steps);
#ifdef SW_ENABLE_DEPTH_TEST
float zInc = (v1->position[2] - v0->position[2])*stepRcp;
#endif
@ -5808,7 +5935,9 @@ static void SW_RASTER_LINE(const sw_vertex_t *v0, const sw_vertex_t *v1)
}
#endif
#ifdef SW_ENABLE_DEPTH_TEST
discard:
#endif
x += xInc;
y += yInc;
#ifdef SW_ENABLE_DEPTH_TEST

View File

@ -4,14 +4,14 @@
#ifndef WIN32_CLIPBOARD_
#define WIN32_CLIPBOARD_
unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned long long int *dataSize);
unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned int *dataSize);
#endif // WIN32_CLIPBOARD_
#ifdef WIN32_CLIPBOARD_IMPLEMENTATION
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
// NOTE: These search for architecture is taken from "windows.h", and it's necessary to avoid including windows.h
// and still make it compile on msvc, because import indirectly importing "winnt.h" (e.g. <minwindef.h>) can cause problems is these are not defined
@ -213,7 +213,7 @@ static int GetPixelDataOffset(BITMAPINFOHEADER bih); // Get pixel data offset fr
//----------------------------------------------------------------------------------
// Module Functions Definition
//----------------------------------------------------------------------------------
unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned long long int *dataSize)
unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned int *dataSize)
{
unsigned char *bmpData = NULL;
@ -228,7 +228,7 @@ unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned long
*width = bmpInfoHeader->biWidth;
*height = bmpInfoHeader->biHeight;
SIZE_T clipDataSize = GlobalSize(clipHandle);
if (clipDataSize >= sizeof(BITMAPINFOHEADER))
if ((clipDataSize >= sizeof(BITMAPINFOHEADER)) && (clipDataSize < INT_MAX))
{
int pixelOffset = GetPixelDataOffset(*bmpInfoHeader);
@ -236,7 +236,7 @@ unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned long
//------------------------------------------------------------------------
BITMAPFILEHEADER bmpFileHeader = { 0 };
SIZE_T bmpFileSize = sizeof(bmpFileHeader) + clipDataSize;
*dataSize = bmpFileSize;
*dataSize = (unsigned int)bmpFileSize;
bmpFileHeader.bfType = 0x4D42; // BMP fil type constant
bmpFileHeader.bfSize = (DWORD)bmpFileSize; // Up to 4GB works fine
@ -254,7 +254,7 @@ unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned long
}
else
{
TRACELOG(LOG_WARNING, "Clipboard data is malformed");
TRACELOG(LOG_WARNING, "Clipboard data is not supported (>2GB?)");
GlobalUnlock(clipHandle);
CloseClipboard();
}

View File

@ -616,13 +616,13 @@ void ShowCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
CORE.Input.Mouse.cursorHidden = true;
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
// Set cursor position in the middle
@ -656,9 +656,9 @@ double GetTime(void)
double time = 0.0;
struct timespec ts = { 0 };
clock_gettime(CLOCK_MONOTONIC, &ts);
unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec;
unsigned long long nanoSeconds = (unsigned long long)ts.tv_sec*1000000000LLU + (unsigned long long)ts.tv_nsec;
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
return time;
}

View File

@ -111,6 +111,12 @@
//----------------------------------------------------------------------------------
typedef struct {
GLFWwindow *handle; // GLFW window handle (graphic device)
#if defined(__linux__) && defined(_GLFW_X11)
// Local storage for the window handle returned by glfwGetX11Window
// This is needed as X11 handles are integers and may not fit inside a pointer depending on platform
// Storing the handle locally and returning a pointer in GetWindowHandle allows the code to work regardless of pointer width
XID windowHandleX11;
#endif
} PlatformData;
//----------------------------------------------------------------------------------
@ -755,12 +761,6 @@ void SetWindowFocused(void)
glfwFocusWindow(platform.handle);
}
#if defined(__linux__) && defined(_GLFW_X11)
// Local storage for the window handle returned by glfwGetX11Window
// This is needed as X11 handles are integers and may not fit inside a pointer depending on platform
// Storing the handle locally and returning a pointer in GetWindowHandle allows the code to work regardless of pointer width
static XID X11WindowHandle;
#endif
// Get native window handle
void *GetWindowHandle(void)
{
@ -778,17 +778,16 @@ void *GetWindowHandle(void)
}
else
{
X11WindowHandle = glfwGetX11Window(platform.handle);
return &X11WindowHandle;
platform.windowHandleX11 = glfwGetX11Window(platform.handle);
return &platform.windowHandleX11;
}
#else
return glfwGetWaylandWindow(platform.handle);
#endif
#elif defined(_GLFW_X11)
// Store the window handle localy and return a pointer to the variable instead
// Reasoning detailed in the declaration of X11WindowHandle
X11WindowHandle = glfwGetX11Window(platform.handle);
return &X11WindowHandle;
platform.windowHandleX11 = glfwGetX11Window(platform.handle);
return &platform.windowHandleX11;
#endif
#endif
#if defined(__APPLE__)
@ -1055,12 +1054,13 @@ Image GetClipboardImage(void)
#if SUPPORT_CLIPBOARD_IMAGE && SUPPORT_MODULE_RTEXTURES
#if defined(_WIN32)
unsigned long long int dataSize = 0;
unsigned int dataSize = 0;
void *bmpData = NULL;
int width = 0;
int height = 0;
bmpData = (void *)Win32GetClipboardImageData(&width, &height, &dataSize);
bmpData = (void *)Win32GetClipboardImageData(&width, &height, &dataSize);
if (bmpData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data.");
else image = LoadImageFromMemory(".bmp", (const unsigned char *)bmpData, (int)dataSize);
@ -1113,7 +1113,7 @@ Image GetClipboardImage(void)
XCloseDisplay(dpy);
#else
TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform");
#endif // defined(_WIN32)
#endif // _WIN32
#else
TRACELOG(LOG_WARNING, "Clipboard image: SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly");
#endif // SUPPORT_CLIPBOARD_IMAGE
@ -1129,7 +1129,7 @@ void ShowCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
@ -1137,7 +1137,7 @@ void HideCursor(void)
CORE.Input.Mouse.cursorHidden = true;
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
@ -1151,7 +1151,7 @@ void EnableCursor(void)
CORE.Input.Mouse.cursorLocked = false;
}
// Disables cursor (lock cursor)
// Disable cursor (lock cursor)
void DisableCursor(void)
{
// Reset mouse position within the window area before disabling cursor

View File

@ -177,6 +177,13 @@ typedef struct {
RGFW_window *window; // Native display device (physical screen connection)
RGFW_monitor *monitor;
mg_gamepads minigamepad;
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
RGFW_surface *surface;
u8 *surfacePixels;
i32 surfaceWidth;
i32 surfaceHeight;
#endif
} PlatformData;
//----------------------------------------------------------------------------------
@ -723,7 +730,7 @@ void SetWindowIcon(Image image)
TRACELOG(LOG_WARNING, "RGFW: Window icon image must be in R8G8B8A8 pixel format");
return;
}
RGFW_window_setIcon(platform.window, (u8 *)image.data, image.width, image.height, 4);
RGFW_window_setIcon(platform.window, (u8 *)image.data, image.width, image.height, RGFW_formatRGBA8);
}
// Set icon for window
@ -749,8 +756,8 @@ void SetWindowIcons(Image *images, int count)
if ((smallIcon == NULL) || ((images[i].width < smallIcon->width) && (images[i].height > smallIcon->height))) smallIcon = &images[i];
}
if (smallIcon != NULL) RGFW_window_setIconEx(platform.window, (u8 *)smallIcon->data, smallIcon->width, smallIcon->height, 4, RGFW_iconWindow);
if (bigIcon != NULL) RGFW_window_setIconEx(platform.window, (u8 *)bigIcon->data, bigIcon->width, bigIcon->height, 4, RGFW_iconTaskbar);
if (smallIcon != NULL) RGFW_window_setIconEx(platform.window, (u8 *)smallIcon->data, smallIcon->width, smallIcon->height, RGFW_formatRGBA8, RGFW_iconWindow);
if (bigIcon != NULL) RGFW_window_setIconEx(platform.window, (u8 *)bigIcon->data, bigIcon->width, bigIcon->height, RGFW_formatRGBA8, RGFW_iconTaskbar);
}
}
@ -1017,15 +1024,15 @@ Image GetClipboardImage(void)
#if SUPPORT_CLIPBOARD_IMAGE && SUPPORT_MODULE_RTEXTURES
#if defined(_WIN32)
unsigned long long int dataSize = 0; // moved into _WIN32 scope until other platforms gain support
void *fileData = NULL; // moved into _WIN32 scope until other platforms gain support
unsigned int dataSize = 0;
void *fileData = NULL;
int width = 0;
int height = 0;
fileData = (void *)Win32GetClipboardImageData(&width, &height, &dataSize);
fileData = (void *)Win32GetClipboardImageData(&width, &height, &dataSize);
if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data");
else image = LoadImageFromMemory(".bmp", (const unsigned char *)fileData, dataSize);
else image = LoadImageFromMemory(".bmp", (const unsigned char *)fileData, (int)dataSize);
#elif defined(__linux__) && defined(DRGFW_X11)
@ -1075,7 +1082,7 @@ Image GetClipboardImage(void)
XCloseDisplay(dpy);
#else
TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement GetClipboardImage() for this OS");
#endif // defined(_WIN32)
#endif // _WIN32
#else
TRACELOG(LOG_WARNING, "Clipboard image: SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly");
#endif // SUPPORT_CLIPBOARD_IMAGE
@ -1090,14 +1097,14 @@ void ShowCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
RGFW_window_showMouse(platform.window, false);
CORE.Input.Mouse.cursorHidden = true;
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
RGFW_window_captureRawMouse(platform.window, false);
@ -1109,7 +1116,7 @@ void EnableCursor(void)
CORE.Input.Mouse.cursorLocked = true;
}
// Disables cursor (lock cursor)
// Disable cursor (lock cursor)
void DisableCursor(void)
{
RGFW_window_captureRawMouse(platform.window, true);
@ -1121,7 +1128,35 @@ void DisableCursor(void)
// Swap back buffer with front buffer (screen drawing)
void SwapScreenBuffer(void)
{
RGFW_window_swapBuffers_OpenGL(platform.window);
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
{
if (platform.surface)
{
// copy rlsw pixel data to the surface framebuffer
swReadPixels(0, 0, platform.surfaceWidth, platform.surfaceHeight, SW_RGBA, SW_UNSIGNED_BYTE, platform.surfacePixels);
// Mac wants a different pixel order. I cant seem to get this to work any other way
#if defined(__APPLE__)
unsigned char temp = 0;
unsigned char *p = NULL;
for (int i = 0; i < (platform.surfaceWidth * platform.surfaceHeight); i += 1)
{
p = platform.surfacePixels + (i * 4);
temp = p[0];
p[0] = p[2];
p[2] = temp;
}
#endif
// blit surface to the window
RGFW_window_blitSurface(platform.window, platform.surface);
}
}
#else
{
RGFW_window_swapBuffers_OpenGL(platform.window);
}
#endif
}
//----------------------------------------------------------------------------------
@ -1131,7 +1166,9 @@ void SwapScreenBuffer(void)
// Get elapsed time measure in seconds since InitTimer()
double GetTime(void)
{
double time = get_time_seconds() - CORE.Time.base;
// CORE.Time.base is nanoseconds as integer
double baseTime = (double)CORE.Time.base*1e-9;
double time = get_time_seconds() - baseTime;
return time;
}
@ -1313,6 +1350,9 @@ void PollInputEvents(void)
// Window events are also polled (Minimized, maximized, close...)
case RGFW_windowResized:
{
// set flag that the window was resized
CORE.Window.resizedLastFrame = true;
#if defined(__APPLE__)
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI))
{
@ -1361,7 +1401,42 @@ void PollInputEvents(void)
CORE.Window.currentFbo.width = CORE.Window.screen.width;
CORE.Window.currentFbo.height = CORE.Window.screen.height;
#endif
CORE.Window.resizedLastFrame = true;
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
#if defined(__APPLE__)
RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window);
CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f);
SetupViewport(platform.window->w * currentMonitor->pixelRatio, platform.window->h * currentMonitor->pixelRatio);
CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio;
CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio;
CORE.Window.currentFbo.width = CORE.Window.render.width;
CORE.Window.currentFbo.height = CORE.Window.render.height;
#endif
platform.surfaceWidth = CORE.Window.currentFbo.width;
platform.surfaceHeight = CORE.Window.currentFbo.height;
// in software mode we dont have the viewport so we need to reverse the highdpi changes
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI))
{
Vector2 scaleDpi = GetWindowScaleDPI();
platform.surfaceWidth *= scaleDpi.x;
platform.surfaceHeight *= scaleDpi.y;
}
if (platform.surfacePixels != NULL)
{
RL_FREE(platform.surfacePixels);
platform.surfacePixels = RL_MALLOC(platform.surfaceWidth * platform.surfaceHeight * 4);
}
if (platform.surface != NULL)
{
RGFW_surface_free(platform.surface);
platform.surface = RGFW_window_createSurface(platform.window, platform.surfacePixels, platform.surfaceWidth, platform.surfaceHeight, RGFW_formatBGRA8);
swResize(platform.surfaceWidth, platform.surfaceHeight);
}
#endif
} break;
case RGFW_windowMaximized:
{
@ -1639,6 +1714,12 @@ int InitPlatform(void)
hints->major = 4;
hints->minor = 3;
}
else if (rlGetVersion() == RL_OPENGL_SOFTWARE)
{
hints->major = 1;
hints->minor = 1;
hints->renderer = RGFW_glSoftware;
}
if (FLAG_IS_SET(CORE.Window.flags, FLAG_MSAA_4X_HINT)) hints->samples = 4;
@ -1654,7 +1735,6 @@ int InitPlatform(void)
RGFW_setGlobalHints_OpenGL(hints);
platform.window = RGFW_createWindow((CORE.Window.title != 0)? CORE.Window.title : " ", 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, flags | RGFW_windowOpenGL);
CORE.Time.base = get_time_seconds();
#ifndef PLATFORM_WEB_RGFW
i32 screenSizeWidth;
@ -1719,7 +1799,41 @@ int InitPlatform(void)
#endif
}
TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully");
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
// apple always scales for retina
#if defined(__APPLE__)
RGFW_monitor* currentMonitor = RGFW_window_getMonitor(platform.window);
CORE.Window.screenScale = MatrixScale(currentMonitor->pixelRatio, currentMonitor->pixelRatio, 1.0f);
CORE.Window.render.width = CORE.Window.screen.width * currentMonitor->pixelRatio;
CORE.Window.render.height = CORE.Window.screen.height * currentMonitor->pixelRatio;
CORE.Window.currentFbo.width = CORE.Window.render.width;
CORE.Window.currentFbo.height = CORE.Window.render.height;
#endif
platform.surfaceWidth = CORE.Window.currentFbo.width;
platform.surfaceHeight = CORE.Window.currentFbo.height;
platform.surfacePixels = RL_MALLOC(platform.surfaceWidth * platform.surfaceHeight * 4);
if (platform.surfacePixels == NULL)
{
TRACELOG(LOG_FATAL, "PLATFORM: Failed to initialize software pixel buffer");
return -1;
}
platform.surface = RGFW_window_createSurface(platform.window, platform.surfacePixels, platform.surfaceWidth, platform.surfaceHeight, RGFW_formatBGRA8);
if (platform.surface == NULL)
{
RL_FREE(platform.surfacePixels);
TRACELOG(LOG_FATAL, "PLATFORM: Failed to initialize software surface");
return -1;
}
#endif
TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully %s",
FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)? "(HighDPI)" : "");
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);
@ -1748,20 +1862,63 @@ int InitPlatform(void)
//----------------------------------------------------------------------------
#if defined(RGFW_WAYLAND)
if (RGFW_usingWayland()) TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - Wayland): Initialized successfully");
else TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - X11 (fallback)): Initialized successfully");
if (rlGetVersion() == RL_OPENGL_SOFTWARE)
{
if (RGFW_usingWayland()) TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - Wayland, Software): Initialized successfully");
else TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - X11, Software (fallback)): Initialized successfully");
}
else
{
if (RGFW_usingWayland()) TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - Wayland): Initialized successfully");
else TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - X11 (fallback)): Initialized successfully");
}
#elif defined(RGFW_X11)
#if defined(__APPLE__)
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - X11 (MacOS)): Initialized successfully");
if (rlGetVersion() == RL_OPENGL_SOFTWARE)
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - X11, Software, (MacOS)): Initialized successfully");
}
else
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - X11, (MacOS)): Initialized successfully");
}
#else
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - X11): Initialized successfully");
if (rlGetVersion() == RL_OPENGL_SOFTWARE)
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - X11, Software): Initialized successfully");
}
else
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - X11): Initialized successfully");
}
#endif
#elif defined (RGFW_WINDOWS)
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - Win32): Initialized successfully");
if (rlGetVersion() == RL_OPENGL_SOFTWARE)
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - Win32, Software): Initialized successfully");
}
else
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - Win32): Initialized successfully");
}
#elif defined(RGFW_WASM)
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - WASMs): Initialized successfully");
if (rlGetVersion() == RL_OPENGL_SOFTWARE)
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - WASMs, Software): Initialized successfully");
}
else
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - WASMs): Initialized successfully");
}
#elif defined(RGFW_MACOS)
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - MacOS): Initialized successfully");
if (rlGetVersion() == RL_OPENGL_SOFTWARE)
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - MacOS, Software): Initialized successfully");
}
else
{
TRACELOG(LOG_INFO, "PLATFORM: DESKTOP (RGFW - MacOS): Initialized successfully");
}
#endif
mg_gamepads_init(&platform.minigamepad);
@ -1774,6 +1931,18 @@ void ClosePlatform(void)
{
mg_gamepads_free(&platform.minigamepad);
RGFW_window_close(platform.window);
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
if (platform.surfacePixels != NULL)
{
RL_FREE(platform.surfacePixels);
}
if (platform.surface != NULL)
{
RGFW_surface_free(platform.surface);
}
#endif
}
// Keycode mapping
@ -1791,34 +1960,36 @@ double get_time_seconds(void)
#if defined(_WIN32)
static LARGE_INTEGER freq = { 0 };
static int freq_init = 0;
LARGE_INTEGER counter;
if (!freq_init) {
static bool freqInitialized = false;
LARGE_INTEGER counter = { 0 };
if (!freqInitialized)
{
// Lazy initialization
QueryPerformanceFrequency(&freq);
freq_init = 1;
freqInitialized = true;
}
QueryPerformanceCounter(&counter);
currentTime = (double)counter.QuadPart / (double)freq.QuadPart;
currentTime = (double)counter.QuadPart/(double)freq.QuadPart;
#elif defined(__EMSCRIPTEN__)
currentTime = emscripten_get_now() / 1000.0;
currentTime = emscripten_get_now()/1000.0;
#elif defined(__APPLE__)
static mach_timebase_info_data_t tb;
static int tb_initialized = 0;
if (!tb_initialized) {
static mach_timebase_info_data_t tb = { 0 };
static bool tbInitialized = false;
if (!tbInitialized)
{
mach_timebase_info(&tb);
tb_initialized = 1;
tbInitialized = true;
}
uint64_t ticks = mach_absolute_time();
currentTime = (double)ticks * (double)tb.numer / (double)tb.denom / 1e9;
currentTime = (double)ticks*(double)tb.numer/(double)tb.denom/1e9;
#elif defined(__linux__)
struct timespec ts;
struct timespec ts = { 0 };
clock_gettime(CLOCK_MONOTONIC, &ts);
currentTime = (double)ts.tv_sec + (double)ts.tv_nsec / 1e9;
currentTime = (double)ts.tv_sec + (double)ts.tv_nsec/1e9;
#else
// fallback to cstd
currentTime = (double)clock() / (double)CLOCKS_PER_SEC;
// Fallback to cstd
currentTime = (double)clock()/(double)CLOCKS_PER_SEC;
#endif
return currentTime;

View File

@ -1144,7 +1144,7 @@ const char *GetClipboardText(void)
char *clipboard = SDL_GetClipboardText();
int clipboardSize = snprintf(buffer, sizeof(buffer), "%s", clipboard);
int clipboardSize = snprintf(buffer, MAX_CLIPBOARD_BUFFER_LENGTH, "%s", clipboard);
if (clipboardSize >= MAX_CLIPBOARD_BUFFER_LENGTH)
{
char *truncate = buffer + MAX_CLIPBOARD_BUFFER_LENGTH - 4;
@ -1227,7 +1227,7 @@ void ShowCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
#if defined(USING_VERSION_SDL3)
@ -1238,7 +1238,7 @@ void HideCursor(void)
CORE.Input.Mouse.cursorHidden = true;
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
SDL_SetRelativeMouseMode(SDL_FALSE);
@ -1247,7 +1247,7 @@ void EnableCursor(void)
CORE.Input.Mouse.cursorLocked = false;
}
// Disables cursor (lock cursor)
// Disable cursor (lock cursor)
void DisableCursor(void)
{
SDL_SetRelativeMouseMode(SDL_TRUE);
@ -1528,6 +1528,10 @@ void PollInputEvents(void)
if ((width + borderLeft + borderRight != usableBounds.w) && (height + borderTop + borderBottom != usableBounds.h)) FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED);
}
#endif
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
swResize(width, height);
#endif
} break;
case SDL_WINDOWEVENT_ENTER: CORE.Input.Mouse.cursorOnScreen = true; break;
@ -1671,8 +1675,13 @@ void PollInputEvents(void)
} break;
case SDL_MOUSEWHEEL:
{
CORE.Input.Mouse.currentWheelMove.x = (float)event.wheel.x;
CORE.Input.Mouse.currentWheelMove.y = (float)event.wheel.y;
#if defined(USING_VERSION_SDL3)
CORE.Input.Mouse.currentWheelMove.x = event.wheel.x;
CORE.Input.Mouse.currentWheelMove.y = event.wheel.y;
#else
CORE.Input.Mouse.currentWheelMove.x = event.wheel.preciseX;
CORE.Input.Mouse.currentWheelMove.y = event.wheel.preciseY;
#endif
} break;
case SDL_MOUSEMOTION:
{
@ -2064,7 +2073,8 @@ int InitPlatform(void)
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: Device initialized successfully %s",
FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)? "(HighDPI)" : "");
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);

View File

@ -1063,14 +1063,14 @@ Vector2 GetMonitorPosition(int monitor)
// Get selected monitor width (currently used by monitor)
int GetMonitorWidth(int monitor)
{
TRACELOG(LOG_WARNING, "GetMonitorWidth not implemented");
//TRACELOG(LOG_WARNING, "GetMonitorWidth not implemented");
return 0;
}
// Get selected monitor height (currently used by monitor)
int GetMonitorHeight(int monitor)
{
TRACELOG(LOG_WARNING, "GetMonitorHeight not implemented");
//TRACELOG(LOG_WARNING, "GetMonitorHeight not implemented");
return 0;
}
@ -1105,7 +1105,7 @@ const char *GetMonitorName(int monitor)
// Get window position XY on monitor
Vector2 GetWindowPosition(void)
{
TRACELOG(LOG_WARNING, "GetWindowPosition not implemented");
//TRACELOG(LOG_WARNING, "GetWindowPosition not implemented");
return (Vector2){ 0, 0 };
}
@ -1146,7 +1146,7 @@ void ShowCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
// NOTE: Using SetCursor() instead of ShowCursor() because
@ -1155,7 +1155,7 @@ void HideCursor(void)
CORE.Input.Mouse.cursorHidden = true;
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
if (CORE.Input.Mouse.cursorLocked)
@ -1526,7 +1526,6 @@ int InitPlatform(void)
if (hr < 0) TRACELOG(LOG_ERROR, "%s failed, hresult=0x%lx", "SetProcessDpiAwareness", (DWORD)hr);
}
*/
HINSTANCE hInstance = GetModuleHandleW(0);
// Define window class
@ -1643,7 +1642,8 @@ 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: Device initialized successfully %s",
FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)? "(HighDPI)" : "");
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);
@ -1760,13 +1760,31 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
memset(CORE.Input.Keyboard.previousKeyState, 0, sizeof(CORE.Input.Keyboard.previousKeyState));
memset(CORE.Input.Keyboard.currentKeyState, 0, sizeof(CORE.Input.Keyboard.currentKeyState));
} break;
case WM_SIZING:
case WM_SIZING: // Sent to a window that the user is resizing
{
if (!(CORE.Window.flags & FLAG_WINDOW_RESIZABLE))
TRACELOG(LOG_WARNING, "WIN32: WINDOW: Trying to resize a non-resizable window");
if (CORE.Window.flags & FLAG_WINDOW_RESIZABLE)
{
//HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
}
result = TRUE;
} break;
case WM_SIZE:
{
// WARNING: Don't trust the docs, they say this message can not be obtained if not calling DefWindowProc()
// in response to WM_WINDOWPOSCHANGED but looks like when a window is created,
// this message can be obtained without getting WM_WINDOWPOSCHANGED
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
// WARNING: Waiting two frames before resizing because software-renderer backend is initilized with swInit() later
// than InitPlatform(), that triggers WM_SIZE, so avoid crashing
if (CORE.Time.frameCounter > 2) HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
#else
// NOTE: This message is only triggered on window creation
HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
#endif
result = 0; // If an application processes WM_SIZE message, it should return zero
} break;
case WM_GETMINMAXINFO:
{
DWORD style = MakeWindowStyle(platform.desiredFlags);
@ -1865,19 +1883,13 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
default: break;
}
} break;
case WM_SIZE:
{
// WARNING: Don't trust the docs, they say this message can not be obtained if not calling DefWindowProc()
// in response to WM_WINDOWPOSCHANGED but looks like when a window is created,
// this message can be obtained without getting WM_WINDOWPOSCHANGED
// WARNING: This call fails for Software-Renderer backend
//HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
} break;
//case WM_MOVE
//case WM_MOVE: break;
case WM_WINDOWPOSCHANGED:
{
WINDOWPOS *pos = (WINDOWPOS*)lparam;
if (!(pos->flags & SWP_NOSIZE)) HandleWindowResize(hwnd, &platform.appScreenWidth, &platform.appScreenHeight);
DefWindowProc(hwnd, msg, wparam, lparam);
} break;
case WM_GETDPISCALEDSIZE:
{
@ -2091,6 +2103,10 @@ static void HandleWindowResize(HWND hwnd, int *width, int *height)
CORE.Window.screenScale = MatrixScale( (float)CORE.Window.render.width/CORE.Window.screen.width,
(float)CORE.Window.render.height/CORE.Window.screen.height, 1.0f);
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
swResize(clientSize.cx, clientSize.cy);
#endif
}
// Update window style

View File

@ -266,9 +266,12 @@ static void PollKeyboardEvents(void); // Process evdev keyboard events
static void PollGamepadEvents(void); // Process evdev gamepad events
static void PollMouseEvents(void); // Process evdev mouse events
// Not used by software rendering.
#if !defined(GRAPHICS_API_OPENGL_SOFTWARE)
static int FindMatchingConnectorMode(const drmModeConnector *connector, const drmModeModeInfo *mode); // Search matching DRM mode in connector's mode list
static int FindExactConnectorMode(const drmModeConnector *connector, uint width, uint height, uint fps, bool allowInterlaced); // Search exactly matching DRM connector mode in connector's list
static int FindNearestConnectorMode(const drmModeConnector *connector, uint width, uint height, uint fps, bool allowInterlaced); // Search the nearest matching DRM connector mode in connector's list
#endif
static void SetupFramebuffer(int width, int height); // Setup main framebuffer (required by InitPlatform())
@ -561,13 +564,13 @@ void ShowCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
CORE.Input.Mouse.cursorHidden = true;
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
// Set cursor position in the middle
@ -577,7 +580,7 @@ void EnableCursor(void)
CORE.Input.Mouse.cursorLocked = false;
}
// Disables cursor (lock cursor)
// Disable cursor (lock cursor)
void DisableCursor(void)
{
// Set cursor position in the middle
@ -837,14 +840,8 @@ void SwapScreenBuffer(void)
uint32_t height = mode->vdisplay;
// Dumb buffers use a fixed format based on bpp
#if SW_COLOR_BUFFER_BITS == 24
const uint32_t bpp = 32; // 32 bits per pixel (XRGB8888 format)
const uint32_t depth = 24; // Color depth, here only 24 bits, alpha is not used
#else
// REVIEW: Not sure how it will be interpreted (RGB or RGBA?)
const uint32_t bpp = SW_COLOR_BUFFER_BITS;
const uint32_t depth = SW_COLOR_BUFFER_BITS;
#endif
// Create a dumb buffer for software rendering
struct drm_mode_create_dumb creq = { 0 };
@ -899,7 +896,7 @@ void SwapScreenBuffer(void)
// Copy the software rendered buffer to the dumb buffer with scaling if needed
// NOTE: RLSW will make a simple copy if the dimensions match
swBlitFramebuffer(0, 0, width, height, 0, 0, width, height, SW_RGBA, SW_UNSIGNED_BYTE, dumbBuffer);
swBlitPixels(0, 0, width, height, 0, 0, width, height, SW_RGBA, SW_UNSIGNED_BYTE, dumbBuffer);
// Unmap the buffer
munmap(dumbBuffer, creq.size);
@ -1009,9 +1006,9 @@ double GetTime(void)
double time = 0.0;
struct timespec ts = { 0 };
clock_gettime(CLOCK_MONOTONIC, &ts);
unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec;
unsigned long long nanoSeconds = (unsigned long long)ts.tv_sec*1000000000LLU + (unsigned long long)ts.tv_nsec;
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
return time;
}
@ -1432,7 +1429,7 @@ int InitPlatform(void)
if (eglGetPlatformDisplayEXT != NULL) platform.device = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, platform.gbmDevice, NULL);
}
// In case extension not found or display could not be retrieved, try useing legacy version
// In case extension not found or display could not be retrieved, try using legacy version
if (platform.device == EGL_NO_DISPLAY) platform.device = eglGetDisplay((EGLNativeDisplayType)platform.gbmDevice);
#endif
if (platform.device == EGL_NO_DISPLAY)
@ -1555,12 +1552,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
{
@ -1586,13 +1577,14 @@ 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;
#endif
TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully (Software Rendering)");
TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully %s",
FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)? "(HighDPI)" : "");
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);
#endif
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED)) MinimizeWindow();
@ -2571,6 +2563,7 @@ static void PollMouseEvents(void)
}
}
#if !defined(GRAPHICS_API_OPENGL_SOFTWARE)
// Search matching DRM mode in connector's mode list
static int FindMatchingConnectorMode(const drmModeConnector *connector, const drmModeModeInfo *mode)
{
@ -2659,6 +2652,7 @@ static int FindNearestConnectorMode(const drmModeConnector *connector, uint widt
return nearestIndex;
}
#endif
// Compute framebuffer size relative to screen size and display size
// NOTE: Global variables CORE.Window.render.width/CORE.Window.render.height and CORE.Window.renderOffset.x/CORE.Window.renderOffset.y can be modified

View File

@ -324,13 +324,13 @@ void ShowCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
CORE.Input.Mouse.cursorHidden = true;
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
// Set cursor position in the middle
@ -339,7 +339,7 @@ void EnableCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Disables cursor (lock cursor)
// Disable cursor (lock cursor)
void DisableCursor(void)
{
// Set cursor position in the middle
@ -364,14 +364,16 @@ double GetTime(void)
{
double time = 0.0;
#if defined(_WIN32)
LARGE_INTEGER now = { 0 };
QueryPerformanceCounter(&now);
return (double)(now.QuadPart - CORE.Time.base)/(double)platform.timerFrequency.QuadPart;
LARGE_INTEGER currentTicks = { 0 };
QueryPerformanceCounter(&currentTicks);
time = (double)(currentTicks.QuadPart - CORE.Time.base)/(double)platform.timerFrequency.QuadPart;
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
struct timespec ts = { 0 };
clock_gettime(CLOCK_MONOTONIC, &ts);
unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec;
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
unsigned long long nanoSeconds = (unsigned long long)ts.tv_sec*1000000000LLU + (unsigned long long)ts.tv_nsec;
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
#endif
return time;
}

View File

@ -303,13 +303,13 @@ void ShowCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
CORE.Input.Mouse.cursorHidden = true;
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
// Set cursor position in the middle
@ -318,7 +318,7 @@ void EnableCursor(void)
CORE.Input.Mouse.cursorHidden = false;
}
// Disables cursor (lock cursor)
// Disable cursor (lock cursor)
void DisableCursor(void)
{
// Set cursor position in the middle
@ -341,10 +341,12 @@ void SwapScreenBuffer(void)
double GetTime(void)
{
double time = 0.0;
struct timespec ts = { 0 };
clock_gettime(CLOCK_MONOTONIC, &ts);
unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec;
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
unsigned long long nanoSeconds = (unsigned long long)ts.tv_sec*1000000000LLU + (unsigned long long)ts.tv_nsec;
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
return time;
}
@ -474,12 +476,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
{
@ -494,7 +490,8 @@ int InitPlatform(void)
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: Device initialized successfully %s",
FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)? "(HighDPI)" : "");
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);

View File

@ -76,7 +76,6 @@ typedef struct {
char canvasId[64]; // Keep current canvas id where wasm app is running
// NOTE: Useful when trying to run multiple wasms in different canvases in same webpage
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
unsigned int *pixels; // Pointer to pixel data buffer (RGBA 32bit format)
#endif
@ -913,7 +912,7 @@ void ShowCursor(void)
}
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
if (!CORE.Input.Mouse.cursorHidden)
@ -924,7 +923,7 @@ void HideCursor(void)
}
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
emscripten_exit_pointerlock();
@ -935,7 +934,7 @@ void EnableCursor(void)
// NOTE: CORE.Input.Mouse.cursorLocked handled by EmscriptenPointerlockCallback()
}
// Disables cursor (lock cursor)
// Disable cursor (lock cursor)
void DisableCursor(void)
{
emscripten_request_pointerlock(platform.canvasId, 1);
@ -1423,7 +1422,8 @@ int InitPlatform(void)
CORE.Window.currentFbo.width = fbWidth;
CORE.Window.currentFbo.height = fbHeight;
TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully");
TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully %s",
FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)? "(HighDPI)" : "");
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);

View File

@ -891,7 +891,7 @@ void ShowCursor(void)
}
}
// Hides mouse cursor
// Hide mouse cursor
void HideCursor(void)
{
if (!CORE.Input.Mouse.cursorHidden)
@ -902,7 +902,7 @@ void HideCursor(void)
}
}
// Enables cursor (unlock cursor)
// Enable cursor (unlock cursor)
void EnableCursor(void)
{
emscripten_exit_pointerlock();
@ -913,7 +913,7 @@ void EnableCursor(void)
// NOTE: CORE.Input.Mouse.cursorLocked handled by EmscriptenPointerlockCallback()
}
// Disables cursor (lock cursor)
// Disable cursor (lock cursor)
void DisableCursor(void)
{
emscripten_request_pointerlock(platform.canvasId, 1);
@ -1245,7 +1245,8 @@ int InitPlatform(void)
CORE.Window.currentFbo.width = fbWidth;
CORE.Window.currentFbo.height = fbHeight;
TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully");
TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully %s",
FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)? "(HighDPI)" : "");
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);

View File

@ -11,22 +11,22 @@
* - Play/Stop/Pause/Resume loaded audio
*
* CONFIGURATION:
* #define SUPPORT_MODULE_RAUDIO
* #define SUPPORT_MODULE_RAUDIO 1
* raudio module is included in the build
*
* #define RAUDIO_STANDALONE
* Define to use the module as standalone library (independently of raylib)
* Required types and functions are defined in the same module
*
* #define SUPPORT_FILEFORMAT_WAV
* #define SUPPORT_FILEFORMAT_OGG
* #define SUPPORT_FILEFORMAT_MP3
* #define SUPPORT_FILEFORMAT_QOA
* #define SUPPORT_FILEFORMAT_FLAC
* #define SUPPORT_FILEFORMAT_XM
* #define SUPPORT_FILEFORMAT_MOD
* #define SUPPORT_FILEFORMAT_WAV 1
* #define SUPPORT_FILEFORMAT_OGG 1
* #define SUPPORT_FILEFORMAT_MP3 1
* #define SUPPORT_FILEFORMAT_QOA 1
* #define SUPPORT_FILEFORMAT_FLAC 0
* #define SUPPORT_FILEFORMAT_XM 1
* #define SUPPORT_FILEFORMAT_MOD 1
* Selected desired fileformats to be supported for loading. Some of those formats are
* supported by default, to remove support, comment unrequired #define in this module
* supported by default, to remove support, #define as 0 in this module or your build system
*
* DEPENDENCIES:
* miniaudio.h - Audio device management lib (https://github.com/mackron/miniaudio)
@ -378,7 +378,7 @@ struct rAudioProcessor {
rAudioProcessor *prev; // Previous audio processor on the list
};
#define AudioBuffer rAudioBuffer // HACK: To avoid CoreAudio (macOS) symbol collision
#define AudioBuffer rAudioBuffer // WARNING: Renamed to avoid symbol collision with CoreAudio (macOS) AudioBuffer type
// Audio data context
typedef struct AudioData {
@ -434,6 +434,7 @@ static const char *GetFileName(const char *filePath); // Get point
static const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string)
static unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read)
static void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
static bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write)
static bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated
#endif
@ -857,7 +858,7 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int
else if ((strcmp(fileType, ".mp3") == 0) || (strcmp(fileType, ".MP3") == 0))
{
drmp3_config config = { 0 };
unsigned long long int totalFrameCount = 0;
unsigned long long totalFrameCount = 0;
// NOTE: Forcing conversion to 32bit float sample size on reading
wave.data = drmp3_open_memory_and_read_pcm_frames_f32(fileData, dataSize, &config, &totalFrameCount, NULL);
@ -867,7 +868,7 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int
{
wave.channels = config.channels;
wave.sampleRate = config.sampleRate;
wave.frameCount = (int)totalFrameCount;
wave.frameCount = (unsigned int)totalFrameCount; // WARNING: Potential loss of data
}
else TRACELOG(LOG_WARNING, "WAVE: Failed to load MP3 data");
@ -895,13 +896,13 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int
#if SUPPORT_FILEFORMAT_FLAC
else if ((strcmp(fileType, ".flac") == 0) || (strcmp(fileType, ".FLAC") == 0))
{
unsigned long long int totalFrameCount = 0;
unsigned long long totalFrameCount = 0;
// NOTE: Forcing conversion to 16bit sample size on reading
wave.data = drflac_open_memory_and_read_pcm_frames_s16(fileData, dataSize, &wave.channels, &wave.sampleRate, &totalFrameCount, NULL);
wave.sampleSize = 16;
if (wave.data != NULL) wave.frameCount = (unsigned int)totalFrameCount;
if (wave.data != NULL) wave.frameCount = (unsigned int)totalFrameCount; // WARNING: Potential loss of data
else TRACELOG(LOG_WARNING, "WAVE: Failed to load FLAC data");
}
#endif
@ -912,7 +913,7 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int
return wave;
}
// Checks if wave data is valid (data loaded and parameters)
// Check if wave data is valid (data loaded and parameters)
bool IsWaveValid(Wave wave)
{
bool result = false;
@ -980,7 +981,7 @@ Sound LoadSoundFromWave(Wave wave)
return sound;
}
// Clone sound from existing sound data, clone does not own wave data
// Load sound alias, clone sound from existing sound data, clone does not own wave data
// NOTE: Wave data must be unallocated manually and will be shared across all clones
Sound LoadSoundAlias(Sound source)
{
@ -1012,7 +1013,7 @@ Sound LoadSoundAlias(Sound source)
return sound;
}
// Checks if a sound is valid (data loaded and buffers initialized)
// Check if a sound is valid (data loaded and buffers initialized)
bool IsSoundValid(Sound sound)
{
bool result = false;
@ -1702,8 +1703,7 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data,
// Copy data to allocated memory for default UnloadMusicStream
unsigned char *newData = (unsigned char *)RL_MALLOC(dataSize);
int it = dataSize/sizeof(unsigned char);
for (int i = 0; i < it; i++) newData[i] = data[i];
for (int i = 0; i < dataSize; i++) newData[i] = data[i];
// Memory loaded version for jar_mod_load_file()
if (dataSize && (dataSize < 32*1024*1024))
@ -1750,7 +1750,7 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data,
return music;
}
// Checks if a music stream is valid (context and buffers initialized)
// Check if a music stream is valid (context and buffers initialized)
bool IsMusicValid(Music music)
{
return ((music.ctxData != NULL) && // Validate context loaded
@ -1763,6 +1763,8 @@ bool IsMusicValid(Music music)
// Unload music stream
void UnloadMusicStream(Music music)
{
if (IsMusicStreamPlaying(music)) StopMusicStream(music);
UnloadAudioStream(music.stream);
if (music.ctxData != NULL)
@ -2065,7 +2067,7 @@ void SetMusicPitch(Music music, float pitch)
SetAudioBufferPitch(music.stream.buffer, pitch);
}
// Set pan for a music
// Set pan for music
void SetMusicPan(Music music, float pan)
{
SetAudioBufferPan(music.stream.buffer, pan);
@ -2153,7 +2155,7 @@ AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, un
return stream;
}
// Checks if an audio stream is valid (buffers initialized)
// Check if an audio stream is valid (buffers initialized)
bool IsAudioStreamValid(AudioStream stream)
{
return ((stream.buffer != NULL) && // Validate stream buffer
@ -2881,6 +2883,12 @@ static unsigned char *LoadFileData(const char *fileName, int *dataSize)
return data;
}
// Unload file data allocated by LoadFileData()
static void UnloadFileData(unsigned char *data)
{
RL_FREE(data);
}
// Save data to file from buffer
static bool SaveFileData(const char *fileName, void *data, int dataSize)
{

View File

@ -1,8 +1,8 @@
GLFW_ICON ICON "raylib.ico"
1 VERSIONINFO
FILEVERSION 5,5,0,0
PRODUCTVERSION 5,5,0,0
FILEVERSION 6,0,0,0
PRODUCTVERSION 6,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
@ -11,12 +11,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "raylib technologies"
VALUE "FileDescription", "raylib dynamic library (www.raylib.com)"
VALUE "FileVersion", "5.5.0"
VALUE "FileVersion", "6.0.0"
VALUE "InternalName", "raylib.dll"
VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria (@raysan5)"
VALUE "LegalCopyright", "(c) 2026 Ramon Santamaria (@raysan5)"
VALUE "OriginalFilename", "raylib.dll"
VALUE "ProductName", "raylib"
VALUE "ProductVersion", "5.5.0"
VALUE "ProductVersion", "6.0.0"
END
END
BLOCK "VarFileInfo"

Binary file not shown.

View File

@ -1,6 +1,6 @@
/**********************************************************************************************
*
* raylib v6.0 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
* raylib v6.1-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
@ -10,7 +10,7 @@
* - Software renderer optional, for systems with no GPU: [rlsw]
* - Custom OpenGL abstraction layer (usable as standalone module): [rlgl]
* - Multiple Fonts formats supported (TTF, OTF, FNT, BDF, Sprite fonts)
* - Many texture formats supportted, including compressed formats (DXT, ETC, ASTC)
* - Many texture formats supported, including compressed formats (DXT, ETC, ASTC)
* - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more!
* - Flexible Materials system, supporting classic maps and PBR maps
* - Animated 3D models supported (skeletal bones animation) (IQM, M3D, GLTF)
@ -35,14 +35,14 @@
* [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorithm
* [rcore] sdefl (Micha Mettke) for DEFLATE compression algorithm
* [rcore] rprand (Ramon Santamaria) for pseudo-random numbers generation
* [rtextures] qoi (Dominic Szablewski - https://phoboslab.org) for QOI image manage
* [rtextures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...)
* [rtextures] stb_image_write (Sean Barret) for image writing (BMP, TGA, PNG, JPG)
* [rtextures] stb_image_resize2 (Sean Barret) for image resizing algorithms
* [rtextures] stb_perlin (Sean Barret) for Perlin Noise image generation
* [rtextures] qoi (Dominic Szablewski - https://phoboslab.org) for QOI image management
* [rtextures] stb_image (Sean Barrett) for images loading (BMP, TGA, PNG, JPEG, HDR...)
* [rtextures] stb_image_write (Sean Barrett) for image writing (BMP, TGA, PNG, JPG)
* [rtextures] stb_image_resize2 (Sean Barrett) for image resizing algorithms
* [rtextures] stb_perlin (Sean Barrett) for Perlin Noise image generation
* [rtextures] rltexgpu (Ramon Santamaria) for GPU-compressed texture formats
* [rtext] stb_truetype (Sean Barret) for ttf fonts loading
* [rtext] stb_rect_pack (Sean Barret) for rectangles packing
* [rtext] stb_truetype (Sean Barrett) for ttf fonts loading
* [rtext] stb_rect_pack (Sean Barrett) for rectangles packing
* [rmodels] par_shapes (Philip Rideout) for parametric 3d shapes generation
* [rmodels] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL)
* [rmodels] cgltf (Johannes Kuhlmann) for models loading (glTF)
@ -51,10 +51,10 @@
* [raudio] dr_wav (David Reid) for WAV audio file loading
* [raudio] dr_flac (David Reid) for FLAC audio file loading
* [raudio] dr_mp3 (David Reid) for MP3 audio file loading
* [raudio] stb_vorbis (Sean Barret) for OGG audio loading
* [raudio] stb_vorbis (Sean Barrett) for OGG audio loading
* [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading
* [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading
* [raudio] qoa (Dominic Szablewski - https://phoboslab.org) for QOA audio manage
* [raudio] qoa (Dominic Szablewski - https://phoboslab.org) for QOA audio management
*
*
* LICENSE: zlib/libpng
@ -87,9 +87,9 @@
#include <stdarg.h> // Required for: va_list - Only used by TraceLogCallback
#define RAYLIB_VERSION_MAJOR 6
#define RAYLIB_VERSION_MINOR 0
#define RAYLIB_VERSION_MINOR 1
#define RAYLIB_VERSION_PATCH 0
#define RAYLIB_VERSION "6.0"
#define RAYLIB_VERSION "6.1-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
@ -203,12 +203,14 @@
// Types and Structures Definition
//----------------------------------------------------------------------------------
// Boolean type
#if !defined(__cplusplus)
#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
#include <stdbool.h>
#elif !defined(__cplusplus) && !defined(bool)
#elif !defined(bool)
typedef enum bool { false = 0, true = !false } bool;
#define RL_BOOL_TYPE
#endif
#endif
// Vector2, 2 components
typedef struct Vector2 {
@ -963,10 +965,10 @@ typedef enum {
// Callbacks to hook some internal functions
// WARNING: These callbacks are intended for advanced users
typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages
typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, int *dataSize); // FileIO: Load binary data
typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, int dataSize); // FileIO: Save binary data
typedef char *(*LoadFileTextCallback)(const char *fileName); // FileIO: Load text data
typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages
typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, int *dataSize); // FileIO: Load binary data
typedef bool (*SaveFileDataCallback)(const char *fileName, const void *data, int dataSize); // FileIO: Save binary data
typedef char *(*LoadFileTextCallback)(const char *fileName); // FileIO: Load text data
typedef bool (*SaveFileTextCallback)(const char *fileName, const char *text); // FileIO: Save text data
//------------------------------------------------------------------------------------
@ -1034,23 +1036,23 @@ RLAPI void EnableEventWaiting(void); // Enable wait
RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling
// Cursor-related functions
RLAPI void ShowCursor(void); // Shows cursor
RLAPI void HideCursor(void); // Hides cursor
RLAPI void ShowCursor(void); // Show cursor
RLAPI void HideCursor(void); // Hide cursor
RLAPI bool IsCursorHidden(void); // Check if cursor is not visible
RLAPI void EnableCursor(void); // Enables cursor (unlock cursor)
RLAPI void DisableCursor(void); // Disables cursor (lock cursor)
RLAPI void EnableCursor(void); // Enable cursor (unlock cursor)
RLAPI void DisableCursor(void); // Disable cursor (lock cursor)
RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the screen
// Drawing-related functions
RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color)
RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing
RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering)
RLAPI void ClearBackground(Color color); // Clear background (framebuffer) to color
RLAPI void BeginDrawing(void); // Begin canvas (framebuffer) drawing
RLAPI void EndDrawing(void); // End canvas (framebuffer) drawing and swap buffers (double buffering)
RLAPI void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D)
RLAPI void EndMode2D(void); // Ends 2D mode with custom camera
RLAPI void EndMode2D(void); // End 2D mode with custom camera
RLAPI void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D)
RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode
RLAPI void EndMode3D(void); // End 3D mode and returns to default 2D orthographic mode
RLAPI void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture
RLAPI void EndTextureMode(void); // Ends drawing to render texture
RLAPI void EndTextureMode(void); // End drawing to render texture
RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing
RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader)
RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom)
@ -1071,9 +1073,9 @@ RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Lo
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
RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector
RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4)
RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value
RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector
RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4)
RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value and bind the texture (sampler2d)
RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM)
@ -1081,10 +1083,10 @@ RLAPI void UnloadShader(Shader shader); // Un
#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 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position
RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get screen space position for a 3d world space position
RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get sized screen space position for a 3d world space position
RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get screen space position for a 2d camera world space position
RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get 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
@ -1110,7 +1112,7 @@ RLAPI void UnloadRandomSequence(int *sequence); // Unload random values
// Misc. functions
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format)
RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS)
RLAPI void SetConfigFlags(unsigned int flags); // Set up init configuration flags (view FLAGS)
RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available)
// Logging system
@ -1126,7 +1128,7 @@ RLAPI void MemFree(void *ptr); // Internal memo
// File system management functions
RLAPI unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read)
RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
RLAPI bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write), returns true on success
RLAPI bool SaveFileData(const char *fileName, const void *data, int dataSize); // Save data to file from byte array (write), returns true on success
RLAPI bool ExportDataAsCode(const unsigned char *data, int dataSize, const char *fileName); // Export data to code (.h), returns true on success
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()
@ -1162,7 +1164,7 @@ RLAPI bool ChangeDirectory(const char *dirPath); // Change wo
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, files and directories, no subdirs scan
RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"
RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`
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
@ -1175,10 +1177,10 @@ 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 (includes NULL terminator), memory must be MemFree()
RLAPI unsigned char *DecodeDataBase64(const char *text, int *outputSize); // Decode Base64 string (expected NULL terminated), 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 *ComputeSHA256(unsigned char *data, int dataSize); // Compute SHA256 hash code, returns static int[8] (32 bytes)
RLAPI unsigned int ComputeCRC32(const unsigned char *data, int dataSize); // Compute CRC32 hash code
RLAPI unsigned int *ComputeMD5(const unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes)
RLAPI unsigned int *ComputeSHA1(const unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes)
RLAPI unsigned int *ComputeSHA256(const unsigned char *data, int dataSize); // Compute SHA256 hash code, returns static int[8] (32 bytes)
// Automation events functionality
RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
@ -1245,7 +1247,7 @@ 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 bool IsGestureDetected(unsigned int gesture); // Check if a gesture has 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
@ -1279,10 +1281,10 @@ RLAPI void DrawLineStrip(const Vector2 *points, int pointCount, Color color);
RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw line segment cubic-bezier in-out interpolation
RLAPI void DrawLineDashed(Vector2 startPos, Vector2 endPos, int dashSize, int spaceSize, Color color); // Draw a dashed line
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 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 DrawCircleGradient(Vector2 center, float radius, Color inner, Color outer); // Draw a gradient-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 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)
RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse
@ -1290,7 +1292,7 @@ RLAPI void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color colo
RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline
RLAPI void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color); // Draw ellipse outline (Vector version)
RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring
RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline
RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline
RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
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
@ -1302,12 +1304,13 @@ RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color c
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, 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 DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle lines 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 DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors (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(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 DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon of n sides
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
@ -1327,14 +1330,14 @@ RLAPI void DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vect
RLAPI Vector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t); // Get (evaluate) spline point: Linear
RLAPI Vector2 GetSplinePointBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: B-Spline
RLAPI Vector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: Catmull-Rom
RLAPI Vector2 GetSplinePointBezierQuad(Vector2 p1, Vector2 c2, Vector2 p3, float t); // Get (evaluate) spline point: Quadratic Bezier
RLAPI Vector2 GetSplinePointBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float t); // Get (evaluate) spline point: Quadratic Bezier
RLAPI Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t); // Get (evaluate) spline point: Cubic Bezier
// Basic shapes collision detection functions
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 CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created between 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
@ -1355,7 +1358,7 @@ RLAPI Image LoadImageAnim(const char *fileName, int *frames);
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 Image LoadImageFromScreen(void); // Load image from screen buffer (screenshot)
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
@ -1401,7 +1404,7 @@ RLAPI void ImageRotateCCW(Image *image);
RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint
RLAPI void ImageColorInvert(Image *image); // Modify image color: invert
RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale
RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
RLAPI void ImageColorContrast(Image *image, int contrast); // Modify image color: contrast (-100 to 100)
RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit)
@ -1426,9 +1429,10 @@ RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color c
RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image
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 ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle lines within an image
RLAPI void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image with extended parameters
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 ImageDrawTriangleGradient(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, const 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, const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image
@ -1460,7 +1464,7 @@ RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint);
RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
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
RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw 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
@ -1504,7 +1508,7 @@ RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color co
RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation)
RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint)
RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint)
RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple characters (codepoint)
// Text font info functions
RLAPI void SetTextLineSpacing(int spacing); // Set vertical line spacing when drawing with line-breaks
@ -1532,18 +1536,18 @@ RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size);
RLAPI char **LoadTextLines(const char *text, int *count); // Load text as separate lines ('\n')
RLAPI void UnloadTextLines(char **text, int lineCount); // Unload text lines
RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied
RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal
RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text strings are equal
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 const char *TextRemoveSpaces(const char *text); // Remove text spaces, concat words
RLAPI char *GetTextBetween(const char *text, const char *begin, const char *end); // Get text between two strings
RLAPI char *TextReplace(const char *text, const char *search, const char *replacement); // Replace text string with new string
RLAPI char *TextReplaceAlloc(const char *text, const char *search, const char *replacement); // Replace text string with new string, memory must be MemFree()
RLAPI char *TextReplaceAlloc(const char *text, const char *search, const char *replacement); // Replace text string with new string, memory must be MemFree()
RLAPI char *TextReplaceBetween(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings
RLAPI char *TextReplaceBetweenAlloc(const char *text, const char *begin, const char *end, const char *replacement); // Replace text between two specific strings, memory must be MemFree()
RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a defined byte position
RLAPI char *TextInsertAlloc(const char *text, const char *insert, int position); // Insert text in a defined byte position, memory must be MemFree()
RLAPI char *TextInsertAlloc(const char *text, const char *insert, int position); // Insert text in a defined byte position, memory must be MemFree()
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, using MAX_TEXTSPLIT_COUNT static strings
RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor
@ -1576,9 +1580,9 @@ RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slice
RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone
RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos
RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires
RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos
RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos
RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos
RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int slices, Color color); // Draw a cylinder wires with base at startPos and top at endPos
RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos
RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos
RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ
RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line
RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
@ -1600,7 +1604,7 @@ RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, floa
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 DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, 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
@ -1668,15 +1672,15 @@ 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 IsWaveValid(Wave wave); // Checks if wave data is valid (data loaded and parameters)
RLAPI bool IsWaveValid(Wave wave); // Check 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 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 (default data format: 32 bit float, stereo)
RLAPI Sound LoadSoundAlias(Sound source); // Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data
RLAPI bool IsSoundValid(Sound sound); // Check if a sound is valid (data loaded and buffers initialized)
RLAPI void UpdateSound(Sound sound, const void *data, int frameCount); // Update sound buffer with new data (default data format: 32 bit float, stereo)
RLAPI void UnloadWave(Wave wave); // Unload wave data
RLAPI void UnloadSound(Sound sound); // Unload sound
RLAPI void UnloadSoundAlias(Sound alias); // Unload a sound alias (does not deallocate sample data)
RLAPI void UnloadSoundAlias(Sound alias); // Unload sound alias (does not deallocate sample data)
RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success
RLAPI bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success
@ -1698,24 +1702,24 @@ 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 IsMusicValid(Music music); // Checks if a music stream is valid (context and buffers initialized)
RLAPI bool IsMusicValid(Music music); // Check 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
RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming
RLAPI void UpdateMusicStream(Music music); // Update buffers for music streaming
RLAPI void StopMusicStream(Music music); // Stop music playing
RLAPI void PauseMusicStream(Music music); // Pause music playing
RLAPI void ResumeMusicStream(Music music); // Resume playing paused music
RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds)
RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (-1.0 left, 0.0 center, 1.0 right)
RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for music (1.0 is base level)
RLAPI void SetMusicPan(Music music, float pan); // Set pan for music (-1.0 left, 0.0 center, 1.0 right)
RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
// 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 IsAudioStreamValid(AudioStream stream); // Checks if an audio stream is valid (buffers initialized)
RLAPI bool IsAudioStreamValid(AudioStream stream); // Check 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
@ -1726,7 +1730,7 @@ RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check i
RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream
RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)
RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right)
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

View File

@ -1,8 +1,8 @@
GLFW_ICON ICON "raylib.ico"
1 VERSIONINFO
FILEVERSION 5,5,0,0
PRODUCTVERSION 5,5,0,0
FILEVERSION 6,0,0,0
PRODUCTVERSION 6,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
@ -11,12 +11,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "raylib technologies"
VALUE "FileDescription", "raylib application (www.raylib.com)"
VALUE "FileVersion", "5.5.0"
VALUE "FileVersion", "6.0.0"
VALUE "InternalName", "raylib"
VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria (@raysan5)"
VALUE "LegalCopyright", "(c) 2026 Ramon Santamaria (@raysan5)"
VALUE "OriginalFilename", "raylib"
VALUE "ProductName", "raylib app"
VALUE "ProductVersion", "5.5.0"
VALUE "ProductVersion", "6.0.0"
END
END
BLOCK "VarFileInfo"

Binary file not shown.

View File

@ -1,6 +1,6 @@
/**********************************************************************************************
*
* raymath v2.0 - Math functions to work with Vector2, Vector3, Matrix and Quaternions
* raymath v2.0 - Math functions to work with Vector2, Vector3, Vector4, Matrix and Quaternions
*
* CONVENTIONS:
* - Matrix structure is defined as row-major (memory layout) but parameters naming AND all
@ -15,7 +15,7 @@
* - Functions use always a "result" variable for return (except C++ operators)
* - Functions are always defined inline
* - Angles are always in radians (DEG2RAD/RAD2DEG macros provided for convenience)
* - No compound literals used to make sure libray is compatible with C++
* - No compound literals used to make sure the library is compatible with C++
*
* CONFIGURATION:
* #define RAYMATH_IMPLEMENTATION
@ -183,7 +183,7 @@ typedef struct float16 {
#if RAYMATH_USE_SIMD_INTRINSICS
// SIMD is used on the most costly raymath function MatrixMultiply()
// NOTE: Only SSE intrinsics support implemented
// TODO: Consider support for other SIMD instrinsics:
// TODO: Consider support for other SIMD intrinsics:
// - SSEx, AVX, AVX2, FMA, NEON, RVV
/*
#if defined(__SSE4_2__)
@ -1151,7 +1151,7 @@ RMAPI Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view)
// Create quaternion from source point
Quaternion quat = { source.x, source.y, source.z, 1.0f };
// Multiply quat point by unprojecte matrix
// Multiply quat point by unprojected matrix
Quaternion qtransformed = { // QuaternionTransform(quat, matViewProjInv)
matViewProjInv.m0*quat.x + matViewProjInv.m4*quat.y + matViewProjInv.m8*quat.z + matViewProjInv.m12*quat.w,
matViewProjInv.m1*quat.x + matViewProjInv.m5*quat.y + matViewProjInv.m9*quat.z + matViewProjInv.m13*quat.w,
@ -1264,19 +1264,21 @@ RMAPI Vector3 Vector3Refract(Vector3 v, Vector3 n, float r)
//----------------------------------------------------------------------------------
// Module Functions Definition - Vector4 math
//----------------------------------------------------------------------------------
// Get vector zero
RMAPI Vector4 Vector4Zero(void)
{
Vector4 result = { 0.0f, 0.0f, 0.0f, 0.0f };
return result;
}
// Get vector one
RMAPI Vector4 Vector4One(void)
{
Vector4 result = { 1.0f, 1.0f, 1.0f, 1.0f };
return result;
}
// Add two vectors
RMAPI Vector4 Vector4Add(Vector4 v1, Vector4 v2)
{
Vector4 result = {
@ -1288,6 +1290,7 @@ RMAPI Vector4 Vector4Add(Vector4 v1, Vector4 v2)
return result;
}
// Add value to vector components
RMAPI Vector4 Vector4AddValue(Vector4 v, float add)
{
Vector4 result = {
@ -1299,6 +1302,7 @@ RMAPI Vector4 Vector4AddValue(Vector4 v, float add)
return result;
}
// Substract vectors
RMAPI Vector4 Vector4Subtract(Vector4 v1, Vector4 v2)
{
Vector4 result = {
@ -1310,6 +1314,7 @@ RMAPI Vector4 Vector4Subtract(Vector4 v1, Vector4 v2)
return result;
}
// Substract value from vector components
RMAPI Vector4 Vector4SubtractValue(Vector4 v, float add)
{
Vector4 result = {
@ -1321,18 +1326,21 @@ RMAPI Vector4 Vector4SubtractValue(Vector4 v, float add)
return result;
}
// Vector length
RMAPI float Vector4Length(Vector4 v)
{
float result = sqrtf((v.x*v.x) + (v.y*v.y) + (v.z*v.z) + (v.w*v.w));
return result;
}
// Vector square length
RMAPI float Vector4LengthSqr(Vector4 v)
{
float result = (v.x*v.x) + (v.y*v.y) + (v.z*v.z) + (v.w*v.w);
return result;
}
// Vectors dot product
RMAPI float Vector4DotProduct(Vector4 v1, Vector4 v2)
{
float result = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z + v1.w*v2.w);
@ -1358,6 +1366,7 @@ RMAPI float Vector4DistanceSqr(Vector4 v1, Vector4 v2)
return result;
}
// Scale vector components by value (multiply)
RMAPI Vector4 Vector4Scale(Vector4 v, float scale)
{
Vector4 result = { v.x*scale, v.y*scale, v.z*scale, v.w*scale };
@ -1753,13 +1762,14 @@ RMAPI Matrix MatrixMultiply(Matrix left, Matrix right)
return result;
}
// Multiply matrix components by value
RMAPI Matrix MatrixMultiplyValue(Matrix left, float value)
{
Matrix result = {
left.m0 * value, left.m4 * value, left.m8 * value, left.m12 * value,
left.m1 * value, left.m5 * value, left.m9 * value, left.m13 * value,
left.m2 * value, left.m6 * value, left.m10 * value, left.m14 * value,
left.m3 * value, left.m7 * value, left.m11 * value, left.m15 * value
left.m0*value, left.m4*value, left.m8*value, left.m12*value,
left.m1*value, left.m5*value, left.m9*value, left.m13*value,
left.m2*value, left.m6*value, left.m10*value, left.m14*value,
left.m3*value, left.m7*value, left.m11*value, left.m15*value
};
return result;
@ -2495,19 +2505,14 @@ RMAPI Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle)
{
Quaternion result = { 0.0f, 0.0f, 0.0f, 1.0f };
float axisLength = sqrtf(axis.x*axis.x + axis.y*axis.y + axis.z*axis.z);
float length = sqrtf(axis.x*axis.x + axis.y*axis.y + axis.z*axis.z);
if (axisLength != 0.0f)
if (length != 0.0f)
{
angle *= 0.5f;
float length = 0.0f;
float ilength = 0.0f;
// Vector3Normalize(axis)
length = axisLength;
if (length == 0.0f) length = 1.0f;
ilength = 1.0f/length;
float ilength = 1.0f/length;
axis.x *= ilength;
axis.y *= ilength;
axis.z *= ilength;
@ -2797,6 +2802,11 @@ inline const Vector2& operator -= (Vector2& lhs, const Vector2& rhs)
return lhs;
}
inline Vector2 operator * (const float& lhs, const Vector2& rhs)
{
return Vector2Scale(rhs, lhs);
}
inline Vector2 operator * (const Vector2& lhs, const float& rhs)
{
return Vector2Scale(lhs, rhs);
@ -2891,6 +2901,11 @@ inline const Vector3& operator -= (Vector3& lhs, const Vector3& rhs)
return lhs;
}
inline Vector3 operator * (const float& lhs, const Vector3& rhs)
{
return Vector3Scale(rhs, lhs);
}
inline Vector3 operator * (const Vector3& lhs, const float& rhs)
{
return Vector3Scale(lhs, rhs);
@ -2986,6 +3001,11 @@ inline const Vector4& operator -= (Vector4& lhs, const Vector4& rhs)
return lhs;
}
inline Vector4 operator * (const float& lhs, const Vector4& rhs)
{
return Vector4Scale(rhs, lhs);
}
inline Vector4 operator * (const Vector4& lhs, const float& rhs)
{
return Vector4Scale(lhs, rhs);

View File

@ -103,7 +103,7 @@
Vector3 position; // Camera position
Vector3 target; // Camera target it looks-at
Vector3 up; // Camera up vector (rotation over its axis)
float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
float fovy; // Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic
int projection; // Camera projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
} Camera3D;
@ -352,7 +352,7 @@ void CameraYaw(Camera *camera, float angle, bool rotateAroundTarget)
// Rotates the camera around its right vector, pitch is "looking up and down"
// - lockView prevents camera overrotation (aka "somersaults")
// - rotateAroundTarget defines if rotation is around target or around its position
// - rotateUp rotates the up direction as well (typically only usefull in CAMERA_FREE)
// - rotateUp rotates the up direction as well (typically only useful in CAMERA_FREE)
// NOTE: [angle] must be provided in radians
void CameraPitch(Camera *camera, float angle, bool lockView, bool rotateAroundTarget, bool rotateUp)
{

View File

@ -35,31 +35,31 @@
* - Memory framebuffer output, using software renderer, no OS required
*
* CONFIGURATION:
* #define SUPPORT_CAMERA_SYSTEM
* #define SUPPORT_CAMERA_SYSTEM 1
* Camera module is included (rcamera.h) and multiple predefined cameras are available:
* free, 1st/3rd person, orbital, custom
*
* #define SUPPORT_GESTURES_SYSTEM
* #define SUPPORT_GESTURES_SYSTEM 1
* Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag
*
* #define SUPPORT_MOUSE_GESTURES
* #define SUPPORT_MOUSE_GESTURES 1
* Mouse gestures are directly mapped like touches and processed by gestures system
*
* #define SUPPORT_BUSY_WAIT_LOOP
* #define SUPPORT_BUSY_WAIT_LOOP 1
* Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used
*
* #define SUPPORT_PARTIALBUSY_WAIT_LOOP
* #define SUPPORT_PARTIALBUSY_WAIT_LOOP 0
* Use a partial-busy wait loop, in this case frame sleeps for most of the time and runs a busy-wait-loop at the end
*
* #define SUPPORT_SCREEN_CAPTURE
* #define SUPPORT_SCREEN_CAPTURE 1
* Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()
*
* #define SUPPORT_COMPRESSION_API
* #define SUPPORT_COMPRESSION_API 1
* Support CompressData() and DecompressData() functions, those functions use zlib implementation
* provided by stb_image and stb_image_write libraries, so, those libraries must be enabled on textures module
* for linkage
*
* #define SUPPORT_AUTOMATION_EVENTS
* #define SUPPORT_AUTOMATION_EVENTS 1
* Support automatic events recording and playing, useful for automated testing systems or AI based game playing
*
* DEPENDENCIES:
@ -106,7 +106,7 @@
#include "config.h" // Defines module configuration flags
#include <stdlib.h> // Required for: srand(), rand(), atexit(), exit()
#include <stdlib.h> // Required for: srand(), rand(), exit()
#include <stdio.h> // Required for: FILE, fopen(), fseek(), ftell(), fread(), fwrite(), fprintf(), vprintf(), fclose(), sprintf() [Used in OpenURL()]
#include <string.h> // Required for: strlen(), strncpy(), strcmp(), strrchr(), memset(), strcat()
#include <stdarg.h> // Required for: va_list, va_start(), va_end() [Used in TraceLog()]
@ -307,7 +307,7 @@ typedef struct CoreData {
Size screen; // Screen current width and height
Point position; // Window current position
Size previousScreen; // Screen previous width and height (required on fullscreen/borderless-windowed toggle)
Point previousPosition; // Window previous position (required on fullscreeen/borderless-windowed toggle)
Point previousPosition; // Window previous position (required on fullscreen/borderless-windowed toggle)
Size render; // Screen framebuffer width and height
Point renderOffset; // Screen framebuffer render offset (Not required anymore?)
Size currentFbo; // Current framebuffer render width and height (depends on active render texture)
@ -329,7 +329,7 @@ typedef struct CoreData {
char currentKeyState[MAX_KEYBOARD_KEYS]; // Registers current frame key state
char previousKeyState[MAX_KEYBOARD_KEYS]; // Registers previous frame key state
// NOTE: Since key press logic involves comparing previous vs currrent key state,
// NOTE: Since key press logic involves comparing previous vs current key state,
// key repeats needs to be handled specially
char keyRepeatInFrame[MAX_KEYBOARD_KEYS]; // Registers key repeats for current frame
@ -379,14 +379,14 @@ typedef struct CoreData {
} Gamepad;
} Input;
struct {
double current; // Current time measure
double previous; // Previous time measure
double update; // Time measure for frame update
double draw; // Time measure for frame draw
double frame; // Time measure for one frame
double target; // Desired time for one frame, if 0 not applied
unsigned long long int base; // Base time measure for hi-res timer (PLATFORM_ANDROID, PLATFORM_DRM)
unsigned int frameCounter; // Frame counter
double current; // Current time measure (seconds)
double previous; // Previous time measure (seconds)
double update; // Time measure for frame update (seconds)
double draw; // Time measure for frame draw (seconds)
double frame; // Time measure for one frame (seconds)
double target; // Desired time for one frame, if 0 not applied (seconds)
unsigned long long base; // Base time measure for hi-res timer (ticks or nanoseconds)
unsigned int frameCounter; // Frame counter (frames)
} Time;
} CoreData;
@ -442,18 +442,6 @@ typedef enum AutomationEventType {
ACTION_SETTARGETFPS // param[0]: fps
} AutomationEventType;
// Event type to config events flags
// WARNING: Not used at the moment
typedef enum {
EVENT_INPUT_KEYBOARD = 0,
EVENT_INPUT_MOUSE = 1,
EVENT_INPUT_GAMEPAD = 2,
EVENT_INPUT_TOUCH = 4,
EVENT_INPUT_GESTURE = 8,
EVENT_WINDOW = 16,
EVENT_CUSTOM = 32
} EventType;
// Event type name strings, required for export
static const char *autoEventTypeName[] = {
"EVENT_NONE",
@ -482,16 +470,6 @@ static const char *autoEventTypeName[] = {
"ACTION_SETTARGETFPS"
};
/*
// Automation event (24 bytes)
// NOTE: Opaque struct, internal to raylib
struct AutomationEvent {
unsigned int frame; // Event frame
unsigned int type; // Event type (AutomationEventType)
int params[4]; // Event parameters (if required)
};
*/
static AutomationEventList *currentEventList = NULL; // Current automation events list, set by user, keep internal pointer
static bool automationEventRecording = false; // Recording automation events flag
//static short automationEventEnabled = 0b0000001111111111; // TODO: Automation events enabled for recording/playing
@ -714,7 +692,7 @@ void InitWindow(int width, int height, const char *title)
Rectangle rec = GetFontDefault().recs[95];
if (FLAG_IS_SET(CORE.Window.flags, FLAG_MSAA_4X_HINT))
{
// NOTE: Try to maxime rec padding to avoid pixel bleeding on MSAA filtering
// NOTE: Try to maximize rec padding to avoid pixel bleeding on MSAA filtering
SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 2, rec.y + 2, 1, 1 });
}
else
@ -869,14 +847,14 @@ bool IsCursorOnScreen(void)
// Module Functions Definition: Screen Drawing
//----------------------------------------------------------------------------------
// Set background color (framebuffer clear color)
// Clear background (framebuffer) to color
void ClearBackground(Color color)
{
rlClearColor(color.r, color.g, color.b, color.a); // Set clear color
rlClearScreenBuffers(); // Clear current framebuffers
}
// Setup canvas (framebuffer) to start drawing
// Begin canvas (framebuffer) drawing
void BeginDrawing(void)
{
// WARNING: Previously to BeginDrawing() other render textures drawing could happen,
@ -893,7 +871,7 @@ void BeginDrawing(void)
// NOTE: Not required with OpenGL 3.3+
}
// End canvas drawing and swap buffers (double buffering)
// End canvas (framebuffer) drawing and swap buffers (double buffering)
void EndDrawing(void)
{
rlDrawRenderBatchActive(); // Update and draw internal render batch
@ -949,7 +927,7 @@ void BeginMode2D(Camera2D camera)
rlMultMatrixf(MatrixToFloat(GetCameraMatrix2D(camera)));
}
// Ends 2D mode with custom camera
// End 2D mode with custom camera
void EndMode2D(void)
{
rlDrawRenderBatchActive(); // Update and draw internal render batch
@ -998,7 +976,7 @@ void BeginMode3D(Camera camera)
rlEnableDepthTest(); // Enable DEPTH_TEST for 3D
}
// Ends 3D mode and returns to default 2D orthographic mode
// End 3D mode and returns to default 2D orthographic mode
void EndMode3D(void)
{
rlDrawRenderBatchActive(); // Update and draw internal render batch
@ -1045,7 +1023,7 @@ void BeginTextureMode(RenderTexture2D target)
CORE.Window.usingFbo = true;
}
// Ends drawing to render texture
// End drawing to render texture
void EndTextureMode(void)
{
rlDrawRenderBatchActive(); // Update and draw internal render batch
@ -1514,7 +1492,7 @@ Matrix GetCameraMatrix2D(Camera2D camera)
return matTransform;
}
// Get the screen space position from a 3d world space position
// Get screen space position from a 3d world space position
Vector2 GetWorldToScreen(Vector3 position, Camera camera)
{
Vector2 screenPosition = GetWorldToScreenEx(position, camera, GetScreenWidth(), GetScreenHeight());
@ -1522,7 +1500,7 @@ Vector2 GetWorldToScreen(Vector3 position, Camera camera)
return screenPosition;
}
// Get size position for a 3d world space position (useful for texture drawing)
// Get sized screen space position for a 3d world space position (useful for texture drawing)
Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height)
{
// Calculate projection matrix (from perspective instead of frustum
@ -1564,7 +1542,7 @@ Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int heigh
return screenPosition;
}
// Get the screen space position for a 2d camera world space position
// Get screen space position for a 2d camera world space position
Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera)
{
Matrix matCamera = GetCameraMatrix2D(camera);
@ -1573,7 +1551,7 @@ Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera)
return (Vector2){ transform.x, transform.y };
}
// Get the world space position for a 2d camera screen space position
// Get world space position for a 2d camera screen space position
Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera)
{
Matrix invMatCamera = MatrixInvert(GetCameraMatrix2D(camera));
@ -1757,9 +1735,9 @@ int GetRandomValue(int min, int max)
else
{
// Rejection sampling to get a uniform integer in [min, max]
unsigned long c = (unsigned long)RAND_MAX + 1UL; // number of possible rand() results
unsigned long m = (unsigned long)range; // size of the target interval
unsigned long t = c - (c%m); // largest multiple of m <= c
unsigned long c = (unsigned long)RAND_MAX + 1UL; // Number of possible results
unsigned long m = (unsigned long)range; // Size of the target interval
unsigned long t = c - (c%m); // Largest multiple of m <= c
unsigned long r = 0;
for (;;)
@ -1853,7 +1831,7 @@ void TakeScreenshot(const char *fileName)
#endif
}
// Setup window configuration flags (view FLAGS)
// Set up window configuration flags (view FLAGS)
// NOTE: This function is expected to be called before window creation,
// because it sets up some flags for the window creation process
// To configure window states after creation, use SetWindowState()
@ -1992,7 +1970,7 @@ unsigned char *LoadFileData(const char *fileName, int *dataSize)
size_t count = fread(data, sizeof(unsigned char), size, file);
// WARNING: fread() returns a size_t value, usually 'unsigned int' (32bit compilation) and 'unsigned long long' (64bit compilation)
// dataSize is unified along raylib as a 'int' type, so, for file-sizes > INT_MAX (2147483647 bytes) there is a limitation
// dataSize is unified along raylib as a 'int' type, so, for file-sizes >INT_MAX (2147483647 bytes) there is a limitation
if (count > 2147483647)
{
TRACELOG(LOG_WARNING, "FILEIO: [%s] File is bigger than 2147483647 bytes, avoid using LoadFileData()", fileName);
@ -2004,7 +1982,7 @@ unsigned char *LoadFileData(const char *fileName, int *dataSize)
{
*dataSize = (int)count;
if ((*dataSize) != size) TRACELOG(LOG_WARNING, "FILEIO: [%s] File partially loaded (%i bytes out of %i)", fileName, dataSize, count);
if ((*dataSize) != size) TRACELOG(LOG_WARNING, "FILEIO: [%s] File partially loaded (%i bytes out of %i)", fileName, *dataSize, size);
else TRACELOG(LOG_INFO, "FILEIO: [%s] File loaded successfully", fileName);
}
}
@ -2028,7 +2006,7 @@ void UnloadFileData(unsigned char *data)
}
// Save data to file from buffer
bool SaveFileData(const char *fileName, void *data, int dataSize)
bool SaveFileData(const char *fileName, const void *data, int dataSize)
{
bool result = false;
@ -2283,7 +2261,10 @@ int FileMove(const char *srcPath, const char *dstPath)
if (FileExists(srcPath))
{
if (FileCopy(srcPath, dstPath) == 0) result = FileRemove(srcPath);
FileCopy(srcPath, dstPath);
// Make sure file has been correctly copied before removing
if (FileExists(dstPath) && (GetFileLength(srcPath) == GetFileLength(dstPath))) result = FileRemove(srcPath);
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to copy file to [%s]", srcPath, dstPath);
}
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Source file does not exist", srcPath);
@ -2362,8 +2343,7 @@ bool IsFileExtension(const char *fileName, const char *ext)
{
int fileExtLength = (int)strlen(fileExt);
char fileExtLower[16] = { 0 };
char *fileExtLowerPtr = fileExtLower;
for (int i = 0; (i < fileExtLength) && (i < 16); i++)
for (int i = 0; (i < fileExtLength) && (i < 15); i++)
{
// Copy and convert to lower-case
if ((fileExt[i] >= 'A') && (fileExt[i] <= 'Z')) fileExtLower[i] = fileExt[i] + 32;
@ -2374,7 +2354,7 @@ bool IsFileExtension(const char *fileName, const char *ext)
int extLength = (int)strlen(ext);
char *extList = (char *)RL_CALLOC(extLength + 1, 1);
char *extListPtrs[MAX_FILE_EXTENSIONS] = { 0 };
strncpy(extList, ext, extLength);
memcpy(extList, ext, extLength);
extListPtrs[0] = extList;
for (int i = 0; i < extLength; i++)
@ -2383,11 +2363,15 @@ bool IsFileExtension(const char *fileName, const char *ext)
if ((extList[i] >= 'A') && (extList[i] <= 'Z')) extList[i] += 32;
// Get pointer to next extension and add null-terminator
if ((extList[i] == ';') && (extCount < (MAX_FILE_EXTENSIONS - 1)))
if (extList[i] == ';')
{
extList[i] = '\0';
extListPtrs[extCount] = extList + i + 1;
extCount++;
if (extCount < MAX_FILE_EXTENSIONS)
{
extListPtrs[extCount] = extList + i + 1;
extCount++;
}
}
}
@ -2395,7 +2379,7 @@ bool IsFileExtension(const char *fileName, const char *ext)
{
// Consider the case where extension provided
// does not start with the '.'
fileExtLowerPtr = fileExtLower;
char *fileExtLowerPtr = fileExtLower;
if (extListPtrs[i][0] != '.') fileExtLowerPtr++;
if (strcmp(fileExtLowerPtr, extListPtrs[i]) == 0)
@ -2514,9 +2498,9 @@ const char *GetFileNameWithoutExt(const char *filePath)
if (filePath != NULL)
{
strncpy(fileName, GetFileName(filePath), MAX_FILENAME_LENGTH - 1); // Get filename.ext without path
int fileNameLenght = (int)strlen(fileName); // Get size in bytes
int fileNameLength = (int)strlen(fileName); // Get size in bytes
for (int i = fileNameLenght; i > 0; i--) // Reverse search '.'
for (int i = fileNameLength; i > 0; i--) // Reverse search '.'
{
if (fileName[i] == '.')
{
@ -2608,7 +2592,7 @@ const char *GetWorkingDirectory(void)
static char currentDir[MAX_FILEPATH_LENGTH] = { 0 };
memset(currentDir, 0, MAX_FILEPATH_LENGTH);
char *path = GETCWD(currentDir, MAX_FILEPATH_LENGTH - 1);
char *path = GETCWD(currentDir, MAX_FILEPATH_LENGTH);
return path;
}
@ -2955,9 +2939,9 @@ unsigned int GetDirectoryFileCountEx(const char *basePath, const char *filter, b
{
// Construct new path from our base path
#if defined(_WIN32)
int pathLength = snprintf(path, MAX_FILEPATH_LENGTH - 1, "%s\\%s", basePath, entity->d_name);
int pathLength = snprintf(path, MAX_FILEPATH_LENGTH, "%s\\%s", basePath, entity->d_name);
#else
int pathLength = snprintf(path, MAX_FILEPATH_LENGTH - 1, "%s/%s", basePath, entity->d_name);
int pathLength = snprintf(path, MAX_FILEPATH_LENGTH, "%s/%s", basePath, entity->d_name);
#endif
// Don't add to count if path too long
if ((pathLength < 0) || (pathLength >= MAX_FILEPATH_LENGTH))
@ -3039,7 +3023,7 @@ unsigned char *DecompressData(const unsigned char *compData, int compDataSize, i
char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize)
{
// Base64 conversion table from RFC 4648 [0..63]
// NOTE: They represent 64 values (6 bits), to encode 3 bytes of data into 4 "sixtets" (6bit characters)
// NOTE: They represent 64 values (6 bits), to encode 3 bytes of data into 4 "sextets" (6bit characters)
static const char base64EncodeTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
// Compute expected size and padding
@ -3126,7 +3110,7 @@ unsigned char *DecodeDataBase64(const char *text, int *outputSize)
int outputCount = 0;
for (int i = 0; i < dataSize;)
{
// Every 4 sixtets must generate 3 octets
// Every 4 sextets must generate 3 octets
if ((i + 2) >= dataSize)
{
TRACELOG(LOG_WARNING, "BASE64: Decoding error: Input data size is not valid");
@ -3160,7 +3144,7 @@ unsigned char *DecodeDataBase64(const char *text, int *outputSize)
}
// Compute CRC32 hash code
unsigned int ComputeCRC32(unsigned char *data, int dataSize)
unsigned int ComputeCRC32(const unsigned char *data, int dataSize)
{
static unsigned int crcTable[256] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
@ -3206,7 +3190,7 @@ unsigned int ComputeCRC32(unsigned char *data, int dataSize)
// Compute MD5 hash code
// NOTE: Returns a static int[4] array (16 bytes)
unsigned int *ComputeMD5(unsigned char *data, int dataSize)
unsigned int *ComputeMD5(const unsigned char *data, int dataSize)
{
#define ROTATE_LEFT(x, c) (((x) << (c)) | ((x) >> (32 - (c))))
@ -3324,7 +3308,7 @@ 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(const unsigned char *data, int dataSize)
{
#define SHA1_ROTATE_LEFT(x, c) (((x) << (c)) | ((x) >> (32 - (c))))
@ -3352,15 +3336,15 @@ unsigned int *ComputeSHA1(unsigned char *data, int dataSize)
memcpy(msg, data, dataSize);
msg[dataSize] = 128; // Write the '1' bit
unsigned long long bitsLen = 8ULL * dataSize;
msg[newDataSize-1] = (unsigned char)(bitsLen);
msg[newDataSize-2] = (unsigned char)(bitsLen >> 8);
msg[newDataSize-3] = (unsigned char)(bitsLen >> 16);
msg[newDataSize-4] = (unsigned char)(bitsLen >> 24);
msg[newDataSize-5] = (unsigned char)(bitsLen >> 32);
msg[newDataSize-6] = (unsigned char)(bitsLen >> 40);
msg[newDataSize-7] = (unsigned char)(bitsLen >> 48);
msg[newDataSize-8] = (unsigned char)(bitsLen >> 56);
unsigned long long bitsLen = 8ULL*dataSize;
msg[newDataSize - 1] = (unsigned char)(bitsLen);
msg[newDataSize - 2] = (unsigned char)(bitsLen >> 8);
msg[newDataSize - 3] = (unsigned char)(bitsLen >> 16);
msg[newDataSize - 4] = (unsigned char)(bitsLen >> 24);
msg[newDataSize - 5] = (unsigned char)(bitsLen >> 32);
msg[newDataSize - 6] = (unsigned char)(bitsLen >> 40);
msg[newDataSize - 7] = (unsigned char)(bitsLen >> 48);
msg[newDataSize - 8] = (unsigned char)(bitsLen >> 56);
// Process the message in successive 512-bit chunks
for (int offset = 0; offset < newDataSize; offset += (512/8))
@ -3434,7 +3418,7 @@ unsigned int *ComputeSHA1(unsigned char *data, int dataSize)
// Compute SHA-256 hash code
// NOTE: Returns a static int[8] array (32 bytes)
unsigned int *ComputeSHA256(unsigned char *data, int dataSize)
unsigned int *ComputeSHA256(const unsigned char *data, int dataSize)
{
#define SHA256_ROTATE_RIGHT(x, c) ((x >> c) | (x << ((sizeof(unsigned int)*8) - c)))
#define SHA256_A0(x) (SHA256_ROTATE_RIGHT(x, 7) ^ SHA256_ROTATE_RIGHT(x, 18) ^ (x >> 3))
@ -3469,8 +3453,8 @@ unsigned int *ComputeSHA256(unsigned char *data, int dataSize)
hash[6] = 0x1f83d9ab;
hash[7] = 0x5be0cd19;
const unsigned long long int bitLen = ((unsigned long long int)dataSize)*8;
unsigned long long int paddedSize = dataSize + sizeof(dataSize);
const unsigned long long bitLen = 8ULL*dataSize;
unsigned long long paddedSize = dataSize + sizeof(dataSize);
paddedSize += (64 - (paddedSize%64));
unsigned char *buffer = (unsigned char *)RL_CALLOC(paddedSize, sizeof(unsigned char));
@ -3481,7 +3465,7 @@ unsigned int *ComputeSHA256(unsigned char *data, int dataSize)
buffer[(paddedSize - sizeof(bitLen)) + (i - 1)] = (bitLen >> (8*(sizeof(bitLen) - i))) & 0xFF;
}
for (unsigned long long int blockN = 0; blockN < paddedSize/64; blockN++)
for (unsigned long long blockN = 0; blockN < paddedSize/64; blockN++)
{
unsigned int a = hash[0];
unsigned int b = hash[1];
@ -3503,7 +3487,7 @@ unsigned int *ComputeSHA256(unsigned char *data, int dataSize)
}
for (int t = 16; t < 64; t++) w[t] = SHA256_A1(w[t - 2]) + w[t - 7] + SHA256_A0(w[t - 15]) + w[t - 16];
for (unsigned long long int t = 0; t < 64; t++)
for (int t = 0; t < 64; t++)
{
unsigned int e1 = (SHA256_ROTATE_RIGHT(e, 6) ^ SHA256_ROTATE_RIGHT(e, 11) ^ SHA256_ROTATE_RIGHT(e, 25));
unsigned int ch = ((e & f) ^ (~e & g));
@ -4125,8 +4109,8 @@ Vector2 GetMouseDelta(void)
{
Vector2 delta = { 0 };
delta.x = CORE.Input.Mouse.currentPosition.x - CORE.Input.Mouse.previousPosition.x;
delta.y = CORE.Input.Mouse.currentPosition.y - CORE.Input.Mouse.previousPosition.y;
delta.x = (CORE.Input.Mouse.currentPosition.x - CORE.Input.Mouse.previousPosition.x)*CORE.Input.Mouse.scale.x;
delta.y = (CORE.Input.Mouse.currentPosition.y - CORE.Input.Mouse.previousPosition.y)*CORE.Input.Mouse.scale.y;
return delta;
}
@ -4235,7 +4219,7 @@ void InitTimer(void)
if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) // Success
{
CORE.Time.base = (unsigned long long int)now.tv_sec*1000000000LLU + (unsigned long long int)now.tv_nsec;
CORE.Time.base = (unsigned long long)now.tv_sec*1000000000LLU + (unsigned long long)now.tv_nsec;
}
else TRACELOG(LOG_WARNING, "TIMER: Hi-resolution timer not available");
#endif
@ -4283,9 +4267,9 @@ static void ScanDirectoryFiles(const char *basePath, FilePathList *files, const
{
// Construct new path from our base path
#if defined(_WIN32)
int pathLength = snprintf(path, MAX_FILEPATH_LENGTH - 1, "%s\\%s", basePath, dp->d_name);
int pathLength = snprintf(path, MAX_FILEPATH_LENGTH, "%s\\%s", basePath, dp->d_name);
#else
int pathLength = snprintf(path, MAX_FILEPATH_LENGTH - 1, "%s/%s", basePath, dp->d_name);
int pathLength = snprintf(path, MAX_FILEPATH_LENGTH, "%s/%s", basePath, dp->d_name);
#endif
if ((pathLength < 0) || (pathLength >= MAX_FILEPATH_LENGTH))
@ -4297,7 +4281,7 @@ static void ScanDirectoryFiles(const char *basePath, FilePathList *files, const
if ((filter == NULL) || (strstr(filter, FILE_FILTER_TAG_ALL) != NULL) ||
(strstr(filter, FILE_FILTER_TAG_FILE_ONLY) != NULL) || IsFileExtension(path, filter))
{
strncpy(files->paths[files->count], path, MAX_FILEPATH_LENGTH - 1);
memcpy(files->paths[files->count], path, pathLength);
files->count++;
}
}
@ -4305,7 +4289,7 @@ static void ScanDirectoryFiles(const char *basePath, FilePathList *files, const
{
if ((filter != NULL) && ((strstr(filter, FILE_FILTER_TAG_DIR_ONLY) != NULL) || (strstr(filter, FILE_FILTER_TAG_ALL) != NULL)))
{
strncpy(files->paths[files->count], path, MAX_FILEPATH_LENGTH - 1);
memcpy(files->paths[files->count], path, pathLength);
files->count++;
}

View File

@ -59,10 +59,13 @@
// NOTE: Below types are required for standalone usage
//----------------------------------------------------------------------------------
// Boolean type
#if !defined(__cplusplus)
#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
#include <stdbool.h>
#elif !defined(__cplusplus) && !defined(bool) && !defined(RL_BOOL_TYPE)
#elif !defined(bool)
typedef enum bool { false = 0, true = !false } bool;
#define RL_BOOL_TYPE
#endif
#endif
#if !defined(RL_VECTOR2_TYPE)
@ -124,7 +127,7 @@ void UpdateGestures(void); // Update gestures detec
#if defined(RGESTURES_STANDALONE)
void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
bool IsGestureDetected(int gesture); // Check if a gesture have been detected
bool IsGestureDetected(int gesture); // Check if a gesture has been detected
int GetGestureDetected(void); // Get latest detected gesture
float GetGestureHoldDuration(void); // Get gesture hold time in seconds
@ -154,8 +157,8 @@ float GetGesturePinchAngle(void); // Get gesture pinch ang
extern "C" { // Prevents name mangling of functions
#endif
// Functions required to query time on Windows
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
int __stdcall QueryPerformanceCounter(unsigned long long *lpPerformanceCount);
int __stdcall QueryPerformanceFrequency(unsigned long long *lpFrequency);
#if defined(__cplusplus)
}
#endif
@ -297,10 +300,10 @@ void ProcessGestureEvent(GestureEvent event)
}
else if (event.touchAction == TOUCH_ACTION_UP)
{
// A swipe can happen while the current gesture is drag, but (specially for web) also hold, so set upPosition for both cases
// A swipe can happen while the current gesture is drag, but (especially for web) also hold, so set upPosition for both cases
if (GESTURES.current == GESTURE_DRAG || GESTURES.current == GESTURE_HOLD) GESTURES.Touch.upPosition = event.position[0];
// NOTE: GESTURES.Drag.intensity dependent on the resolution of the screen
// NOTE: GESTURES.Drag.intensity is dependent on the resolution of the screen
GESTURES.Drag.distance = rgVector2Distance(GESTURES.Touch.downPositionA, GESTURES.Touch.upPosition);
GESTURES.Drag.intensity = GESTURES.Drag.distance/(float)((rgGetCurrentTime() - GESTURES.Swipe.startTime));
@ -515,37 +518,36 @@ static double rgGetCurrentTime(void)
time = GetTime();
#else
#if defined(_WIN32)
unsigned long long int clockFrequency, currentTime;
unsigned long long clockFrequency = 0;
unsigned long long currentClockTicks = 0;
QueryPerformanceFrequency(&clockFrequency); // BE CAREFUL: Costly operation!
QueryPerformanceCounter(&currentTime);
QueryPerformanceCounter(&currentClockTicks);
time = (double)currentTime/clockFrequency; // Time in seconds
time = (double)currentClockTicks/clockFrequency; // Time in seconds
#endif
#if defined(__linux__)
// NOTE: Only for Linux-based systems
struct timespec now;
struct timespec now = { 0 };
clock_gettime(CLOCK_MONOTONIC, &now);
unsigned long long int nowTime = (unsigned long long int)now.tv_sec*1000000000LLU + (unsigned long long int)now.tv_nsec; // Time in nanoseconds
unsigned long long nanoSeconds = (unsigned long long)now.tv_sec*1000000000LLU + (unsigned long long)now.tv_nsec;
time = ((double)nowTime*1e-9); // Time in seconds
time = ((double)nanoSeconds*1e-9); // Time in seconds
#endif
#if defined(__APPLE__)
//#define CLOCK_REALTIME CALENDAR_CLOCK // returns UTC time since 1970-01-01
//#define CLOCK_MONOTONIC SYSTEM_CLOCK // returns the time since boot time
clock_serv_t cclock;
mach_timespec_t now;
clock_serv_t cclock = { 0 };
mach_timespec_t now = { 0 };
host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &cclock);
// NOTE: OS X does not have clock_gettime(), using clock_get_time()
clock_get_time(cclock, &now);
mach_port_deallocate(mach_task_self(), cclock);
unsigned long long int nowTime = (unsigned long long int)now.tv_sec*1000000000LLU + (unsigned long long int)now.tv_nsec; // Time in nanoseconds
unsigned long long nanoSeconds = (unsigned long long)now.tv_sec*1000000000LLU + (unsigned long long)now.tv_nsec;
time = ((double)nowTime*1e-9); // Time in seconds
time = ((double)nanoSeconds*1e-9); // Time in seconds
#endif
#endif

View File

@ -7,10 +7,10 @@
* that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
*
* ADDITIONAL NOTES:
* When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are
* When choosing an OpenGL backend different than OpenGL 1.1, some internal buffers are
* initialized on rlglInit() to accumulate vertex data
*
* When an internal state change is required all the stored vertex data is rendered in batch,
* When an internal state change is required all the stored vertex data is rendered in a batch,
* additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch
*
* Some resources are also loaded for convenience, here the complete list:
@ -29,7 +29,7 @@
* #define GRAPHICS_API_OPENGL_ES2
* #define GRAPHICS_API_OPENGL_ES3
* Use selected OpenGL graphics backend, should be supported by platform
* Those preprocessor defines are only used on rlgl module, if OpenGL version is
* Those preprocessor defines are only used on the rlgl module, if OpenGL version is
* required by any other module, use rlGetVersion() to check it
*
* #define RLGL_IMPLEMENTATION
@ -49,7 +49,7 @@
* #define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits
* #define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering)
* #define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture)
* #define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
* #define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of texture units that can be activated on batch drawing (SetShaderValueTexture())
*
* #define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack
* #define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
@ -358,11 +358,13 @@
//----------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
#if !defined(__cplusplus)
#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
#include <stdbool.h>
#elif !defined(__cplusplus) && !defined(bool) && !defined(RL_BOOL_TYPE)
// Boolean type
typedef enum bool { false = 0, true = !false } bool;
#elif !defined(bool)
typedef enum bool { false = 0, true = !false } bool;
#define RL_BOOL_TYPE
#endif
#endif
#if !defined(RL_MATRIX_TYPE)
@ -1015,9 +1017,7 @@ 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_LOCATION_BONEWEIGHTS
#endif
#ifndef RL_DEFAULT_SHADER_UNIFORM_NAME_BONEMATRICES
#define RL_DEFAULT_SHADER_UNIFORM_NAME_BONEMATRICES "boneMatrices" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEMATRICES
#endif
#ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCETRANSFORM
#define RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCETRANSFORM "instanceTransform" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCETRANSFORM
#endif
@ -1141,21 +1141,23 @@ typedef struct rlglData {
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
static bool isGpuReady = false;
static double rlCullDistanceNear = RL_CULL_DISTANCE_NEAR;
static double rlCullDistanceFar = RL_CULL_DISTANCE_FAR;
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
static rlglData RLGL = { 0 };
#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2
static bool isGpuReady = false;
#endif
#if defined(GRAPHICS_API_OPENGL_ES2) && !defined(GRAPHICS_API_OPENGL_ES3)
// VAO functions entry points
// NOTE: VAO functionality is exposed through extensions (OES)
static PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays = NULL;
static PFNGLBINDVERTEXARRAYOESPROC glBindVertexArray = NULL;
static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays = NULL;
// NOTE: Instancing functionality could also be available through extension
// Instancing functionality entry points
// NOTE: Instancing functionality could be available through extensions
static PFNGLDRAWARRAYSINSTANCEDEXTPROC glDrawArraysInstanced = NULL;
static PFNGLDRAWELEMENTSINSTANCEDEXTPROC glDrawElementsInstanced = NULL;
static PFNGLVERTEXATTRIBDIVISOREXTPROC glVertexAttribDivisor = NULL;
@ -3366,8 +3368,15 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
// Texture parameters configuration
// NOTE: glTexParameteri does NOT affect texture uploading
#if defined(GRAPHICS_API_OPENGL_ES2)
// Check if texture is power-of-two (POT)
bool texIsPOT = false;
if (((width > 0) && ((width & (width - 1)) == 0)) &&
((height > 0) && ((height & (height - 1)) == 0))) texIsPOT = true;
// NOTE: OpenGL ES 2.0 with no GL_OES_texture_npot support (i.e. WebGL) has limited NPOT support, so CLAMP_TO_EDGE must be used
if (RLGL.ExtSupported.texNPOT)
if ((texIsPOT) || (RLGL.ExtSupported.texNPOT))
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); // Set texture to repeat on x-axis
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); // Set texture to repeat on y-axis
@ -3638,7 +3647,7 @@ void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned
case RL_PIXELFORMAT_UNCOMPRESSED_R16: if (RLGL.ExtSupported.texFloat16) *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_HALF_FLOAT_ARB; break;
case RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16: if (RLGL.ExtSupported.texFloat16) *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_HALF_FLOAT_ARB; break;
case RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16: if (RLGL.ExtSupported.texFloat16) *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_HALF_FLOAT_ARB; break;
#else // defined(GRAPHICS_API_OPENGL_ES2)
#else // GRAPHICS_API_OPENGL_ES2
case RL_PIXELFORMAT_UNCOMPRESSED_R16: if (RLGL.ExtSupported.texFloat16) *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_HALF_FLOAT_OES; break; // NOTE: Requires extension OES_texture_half_float
case RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16: if (RLGL.ExtSupported.texFloat16) *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_HALF_FLOAT_OES; break; // NOTE: Requires extension OES_texture_half_float
case RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16: if (RLGL.ExtSupported.texFloat16) *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_HALF_FLOAT_OES; break; // NOTE: Requires extension OES_texture_half_float
@ -3687,6 +3696,8 @@ void rlUnloadTexture(unsigned int id)
// NOTE: Only supports GPU mipmap generation
void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int *mipmaps)
{
if (!isGpuReady) { TRACELOG(RL_LOG_WARNING, "GL: GPU is not ready to load data, trying to load before InitWindow()?"); return; }
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
glBindTexture(GL_TEXTURE_2D, id);

View File

@ -3,19 +3,19 @@
* rmodels - Basic functions to draw 3d shapes and load and draw 3d models
*
* CONFIGURATION:
* #define SUPPORT_MODULE_RMODELS
* #define SUPPORT_MODULE_RMODELS 1
* rmodels module is included in the build
*
* #define SUPPORT_FILEFORMAT_OBJ
* #define SUPPORT_FILEFORMAT_MTL
* #define SUPPORT_FILEFORMAT_IQM
* #define SUPPORT_FILEFORMAT_GLTF
* #define SUPPORT_FILEFORMAT_GLTF_WRITE
* #define SUPPORT_FILEFORMAT_VOX
* #define SUPPORT_FILEFORMAT_M3D
* #define SUPPORT_FILEFORMAT_OBJ 1
* #define SUPPORT_FILEFORMAT_MTL 1
* #define SUPPORT_FILEFORMAT_IQM 1
* #define SUPPORT_FILEFORMAT_GLTF 1
* #define SUPPORT_FILEFORMAT_GLTF_WRITE 0
* #define SUPPORT_FILEFORMAT_VOX 1
* #define SUPPORT_FILEFORMAT_M3D 1
* Selected desired fileformats to be supported for model data loading
*
* #define SUPPORT_MESH_GENERATION
* #define SUPPORT_MESH_GENERATION 1
* Support procedural mesh generation functions, uses external par_shapes.h library
* NOTE: Some generated meshes DO NOT include generated texture coordinates
*
@ -85,7 +85,7 @@
#define VOX_FREE RL_FREE
#define VOX_LOADER_IMPLEMENTATION
#include "external/vox_loader.h" // VOX file format loading (MagikaVoxel)
#include "external/vox_loader.h" // VOX file format loading (MagicaVoxel)
#endif
#if SUPPORT_FILEFORMAT_M3D
@ -724,9 +724,9 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl
// Draw a wired cylinder with base at startPos and top at endPos
// NOTE: It could be also used for pyramid and cone
void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color)
void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int slices, Color color)
{
if (sides < 3) sides = 3;
if (slices < 3) slices = 3;
Vector3 direction = { endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z };
if ((direction.x == 0) && (direction.y == 0) && (direction.z == 0)) return; // Security check
@ -735,12 +735,12 @@ void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, fl
Vector3 b1 = Vector3Normalize(Vector3Perpendicular(direction));
Vector3 b2 = Vector3Normalize(Vector3CrossProduct(b1, direction));
float baseAngle = (2.0f*PI)/sides;
float baseAngle = (2.0f*PI)/slices;
rlBegin(RL_LINES);
rlColor4ub(color.r, color.g, color.b, color.a);
for (int i = 0; i < sides; i++)
for (int i = 0; i < slices; i++)
{
// Compute the four vertices
float s1 = sinf(baseAngle*(i + 0))*startRadius;
@ -769,7 +769,7 @@ void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, fl
}
// Draw a capsule with the center of its sphere caps at startPos and endPos
void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color)
void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color)
{
if (slices < 3) slices = 3;
@ -908,7 +908,7 @@ void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int
}
// Draw capsule wires with the center of its sphere caps at startPos and endPos
void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color)
void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color)
{
if (slices < 3) slices = 3;
@ -1182,16 +1182,17 @@ bool IsModelValid(Model model)
// but some VBOs could not be used, it depends on Mesh vertex data
for (int i = 0; i < model.meshCount; i++)
{
if ((model.meshes[i].vertices != NULL) && (model.meshes[i].vboId[0] == 0)) { result = false; break; } // Vertex position buffer not uploaded to GPU
if ((model.meshes[i].vertices != NULL) && (model.meshes[i].vboId[0] == 0)) { result = false; break; } // Vertex position buffer not uploaded to GPU
if ((model.meshes[i].texcoords != NULL) && (model.meshes[i].vboId[1] == 0)) { result = false; break; } // Vertex textcoords buffer not uploaded to GPU
if ((model.meshes[i].normals != NULL) && (model.meshes[i].vboId[2] == 0)) { result = false; break; } // Vertex normals buffer not uploaded to GPU
if ((model.meshes[i].colors != NULL) && (model.meshes[i].vboId[3] == 0)) { result = false; break; } // Vertex colors buffer not uploaded to GPU
if ((model.meshes[i].tangents != NULL) && (model.meshes[i].vboId[4] == 0)) { result = false; break; } // Vertex tangents buffer not uploaded to GPU
if ((model.meshes[i].texcoords2 != NULL) && (model.meshes[i].vboId[5] == 0)) { result = false; break; } // Vertex texcoords2 buffer not uploaded to GPU
if ((model.meshes[i].indices != NULL) && (model.meshes[i].vboId[6] == 0)) { result = false; break; } // Vertex indices buffer not uploaded to GPU
if ((model.meshes[i].boneIndices != NULL) && (model.meshes[i].vboId[7] == 0)) { result = false; break; } // Vertex boneIndices buffer not uploaded to GPU
if ((model.meshes[i].boneWeights != NULL) && (model.meshes[i].vboId[8] == 0)) { result = false; break; } // Vertex boneWeights buffer not uploaded to GPU
if ((model.meshes[i].normals != NULL) && (model.meshes[i].vboId[2] == 0)) { result = false; break; } // Vertex normals buffer not uploaded to GPU
if ((model.meshes[i].colors != NULL) && (model.meshes[i].vboId[3] == 0)) { result = false; break; } // Vertex colors buffer not uploaded to GPU
if ((model.meshes[i].tangents != NULL) && (model.meshes[i].vboId[4] == 0)) { result = false; break; } // Vertex tangents buffer not uploaded to GPU
if ((model.meshes[i].texcoords2 != NULL) && (model.meshes[i].vboId[5] == 0)) { result = false; break; } // Vertex texcoords2 buffer not uploaded to GPU
if ((model.meshes[i].indices != NULL) && (model.meshes[i].vboId[6] == 0)) { result = false; break; } // Vertex indices buffer not uploaded to GPU
#if SUPPORT_GPU_SKINNING
if ((model.meshes[i].boneIndices != NULL) && (model.meshes[i].vboId[7] == 0)) { result = false; break; } // Vertex boneIndices buffer not uploaded to GPU
if ((model.meshes[i].boneWeights != NULL) && (model.meshes[i].vboId[8] == 0)) { result = false; break; } // Vertex boneWeights buffer not uploaded to GPU
#endif
// NOTE: Some OpenGL versions do not support VAO, so avoid below check
//if (model.meshes[i].vaoId == 0) { result = false; break }
}
@ -3935,7 +3936,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota
Color colDiffuse = mat.maps[MATERIAL_MAP_DIFFUSE].color;
// Applying color tint directly to material diffuse map,
// because is comes as an input paramter to the function
// because it comes as an input parameter to the function
Color colTinted = { 0 };
colTinted.r = (unsigned char)(((int)colDiffuse.r*(int)tint.r)/255);
colTinted.g = (unsigned char)(((int)colDiffuse.g*(int)tint.g)/255);
@ -4105,7 +4106,7 @@ bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, floa
// Check for distances squared to avoid sqrtf()
float radSum = radius1 + radius2;
if (Vector3DistanceSqr(center1, center2) <= radSum*radSum) collision = true;
if (Vector3DistanceSqr(center1, center2) <= (radSum*radSum)) collision = true;
return collision;
}
@ -4131,18 +4132,13 @@ bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius)
{
bool collision = false;
float dmin = 0;
Vector3 closestPoint = {
Clamp(center.x, box.min.x, box.max.x),
Clamp(center.y, box.min.y, box.max.y),
Clamp(center.z, box.min.z, box.max.z)
};
if (center.x < box.min.x) dmin += powf(center.x - box.min.x, 2);
else if (center.x > box.max.x) dmin += powf(center.x - box.max.x, 2);
if (center.y < box.min.y) dmin += powf(center.y - box.min.y, 2);
else if (center.y > box.max.y) dmin += powf(center.y - box.max.y, 2);
if (center.z < box.min.z) dmin += powf(center.z - box.min.z, 2);
else if (center.z > box.max.z) dmin += powf(center.z - box.max.z, 2);
if (dmin <= (radius*radius)) collision = true;
if (Vector3DistanceSqr(center, closestPoint) <= (radius*radius)) collision = true;
return collision;
}
@ -6898,7 +6894,7 @@ static Model LoadM3D(const char *fileName)
mi = m3d->face[i].materialid;
// Only allocate colors VertexBuffer if there's a color vertex in the model for this material batch
// if all colors are fully transparent black for all verteces of this materal, then assuming no vertex colors
// if all colors are fully transparent black for all vertices of this material, then assuming no vertex colors
for (j = i, l = vcolor = 0; (j < (int)m3d->numface) && (mi == m3d->face[j].materialid); j++, l++)
{
if (!m3d->vertex[m3d->face[j].vertex[0]].color ||

View File

@ -8,18 +8,18 @@
* are used but QUADS implementation can be selected with SUPPORT_QUADS_DRAW_MODE define
*
* Some functions define texture coordinates (rlTexCoord2f()) for the shapes and use a
* user-provided texture with SetShapesTexture(), the pourpouse of this implementation
* user-provided texture with SetShapesTexture(), the purpose of this implementation
* is allowing to reduce draw calls when combined with a texture-atlas
*
* By default, raylib sets the default texture and rectangle at InitWindow()[rcore] to one
* white character of default font [rtext], this way, raylib text and shapes can be draw with
* white character of default font [rtext], this way, raylib text and shapes can be drawn with
* a single draw call and it also allows users to configure it the same way with their own fonts
*
* CONFIGURATION:
* #define SUPPORT_MODULE_RSHAPES
* #define SUPPORT_MODULE_RSHAPES 1
* rshapes module is included in the build
*
* #define SUPPORT_QUADS_DRAW_MODE
* #define SUPPORT_QUADS_DRAW_MODE 1
* Use QUADS instead of TRIANGLES for drawing when possible. Lines-based shapes still use LINES
*
*
@ -324,6 +324,22 @@ void DrawCircleV(Vector2 center, float radius, Color color)
DrawCircleSector(center, radius, 0, 360, 36, color);
}
// Draw a gradient-filled circle
void DrawCircleGradient(Vector2 center, float radius, Color inner, Color outer)
{
rlBegin(RL_TRIANGLES);
for (int i = 0; i < 360; i += 10)
{
rlColor4ub(inner.r, inner.g, inner.b, inner.a);
rlVertex2f(center.x, center.y);
rlColor4ub(outer.r, outer.g, outer.b, outer.a);
rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radius, center.y + sinf(DEG2RAD*(i + 10))*radius);
rlColor4ub(outer.r, outer.g, outer.b, outer.a);
rlVertex2f(center.x + cosf(DEG2RAD*i)*radius, center.y + sinf(DEG2RAD*i)*radius);
}
rlEnd();
}
// Draw a piece of a circle
void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color)
{
@ -473,22 +489,6 @@ void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float
rlEnd();
}
// Draw a gradient-filled circle
void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer)
{
rlBegin(RL_TRIANGLES);
for (int i = 0; i < 360; i += 10)
{
rlColor4ub(inner.r, inner.g, inner.b, inner.a);
rlVertex2f((float)centerX, (float)centerY);
rlColor4ub(outer.r, outer.g, outer.b, outer.a);
rlVertex2f((float)centerX + cosf(DEG2RAD*(i + 10))*radius, (float)centerY + sinf(DEG2RAD*(i + 10))*radius);
rlColor4ub(outer.r, outer.g, outer.b, outer.a);
rlVertex2f((float)centerX + cosf(DEG2RAD*i)*radius, (float)centerY + sinf(DEG2RAD*i)*radius);
}
rlEnd();
}
// Draw circle outline
void DrawCircleLines(int centerX, int centerY, float radius, Color color)
{
@ -1421,6 +1421,12 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
// Draw a triangle
// NOTE: Vertex must be provided in counter-clockwise order
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
{
DrawTriangleGradient(v1, v2, v3, color, color, color);
}
// Draw triangle with interpolated colors (vertex in counter-clockwise order!)
void DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3)
{
#if SUPPORT_QUADS_DRAW_MODE
rlSetTexture(GetShapesTexture().id);
@ -1428,17 +1434,20 @@ void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
rlBegin(RL_QUADS);
rlNormal3f(0.0f, 0.0f, 1.0f);
rlColor4ub(color.r, color.g, color.b, color.a);
rlColor4ub(c1.r, c1.g, c1.b, c1.a);
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
rlVertex2f(v1.x, v1.y);
rlColor4ub(c2.r, c2.g, c2.b, c2.a);
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
rlVertex2f(v2.x, v2.y);
rlColor4ub(c3.r, c3.g, c3.b, c3.a);
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
rlVertex2f(v3.x, v3.y);
rlColor4ub(c3.r, c3.g, c3.b, c3.a);
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
rlVertex2f(v3.x, v3.y);
rlEnd();
@ -1446,9 +1455,11 @@ void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
rlSetTexture(0);
#else
rlBegin(RL_TRIANGLES);
rlColor4ub(color.r, color.g, color.b, color.a);
rlColor4ub(c1.r, c1.g, c1.b, c1.a);
rlVertex2f(v1.x, v1.y);
rlColor4ub(c2.r, c2.g, c2.b, c2.a);
rlVertex2f(v2.x, v2.y);
rlColor4ub(c3.r, c3.g, c3.b, c3.a);
rlVertex2f(v3.x, v3.y);
rlEnd();
#endif
@ -1531,7 +1542,7 @@ void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color)
}
}
// Draw a regular polygon of n sides (Vector version)
// Draw a polygon of n sides
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color)
{
if (sides < 3) sides = 3;
@ -2214,7 +2225,7 @@ Vector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4,
}
// Get spline point for a given t [0.0f .. 1.0f], Quadratic Bezier
Vector2 GetSplinePointBezierQuad(Vector2 startPos, Vector2 controlPos, Vector2 endPos, float t)
Vector2 GetSplinePointBezierQuadratic(Vector2 startPos, Vector2 controlPos, Vector2 endPos, float t)
{
Vector2 point = { 0 };
@ -2387,8 +2398,11 @@ bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2,
if ((0.0f <= t) && (t <= 1.0f) && (0.0f <= u) && (u <= 1.0f))
{
collisionPoint->x = startPos1.x + t*rx;
collisionPoint->y = startPos1.y + t*ry;
if (collisionPoint)
{
collisionPoint->x = startPos1.x + t*rx;
collisionPoint->y = startPos1.y + t*ry;
}
collision = true;
}

View File

@ -3,22 +3,22 @@
* rtext - Basic functions to load fonts and draw text
*
* CONFIGURATION:
* #define SUPPORT_MODULE_RTEXT
* #define SUPPORT_MODULE_RTEXT 1
* rtext module is included in the build
*
* #define SUPPORT_FILEFORMAT_FNT
* #define SUPPORT_FILEFORMAT_TTF
* #define SUPPORT_FILEFORMAT_BDF
* #define SUPPORT_FILEFORMAT_FNT 1
* #define SUPPORT_FILEFORMAT_TTF 1
* #define SUPPORT_FILEFORMAT_BDF 0
* Selected desired fileformats to be supported for loading. Some of those formats are
* supported by default, to remove support, comment unrequired #define in this module
* supported by default, to remove support, #define as 0 in this module or your build system
*
* #define TEXTSPLIT_MAX_TEXT_BUFFER_LENGTH
* TextSplit() function static buffer max size
* #define MAX_TEXT_BUFFER_LENGTH 1024
* Text functions using static buffer max size
*
* #define MAX_TEXTSPLIT_COUNT
* #define MAX_TEXTSPLIT_COUNT 128
* TextSplit() function static substrings pointers array (pointing to static buffer)
*
* #define FONT_ATLAS_CORNER_REC_SIZE
* #define FONT_ATLAS_CORNER_REC_SIZE 3
* On font atlas image generation [GenImageFontAtlas()], add a NxN pixels white rectangle
* at the bottom-right corner of the atlas. It can be useful to for shapes drawing, to allow
* drawing text and shapes with a single draw call [SetShapesTexture()]
@ -156,7 +156,7 @@ extern void LoadFontDefault(void)
{
#define BIT_CHECK(a,b) ((a) & (1u << (b)))
// Check to see if the font for an image has alreeady been allocated,
// Check to see if the font for an image has already been allocated,
// and if no need to upload, then return
if (defaultFont.glyphs != NULL) return;
@ -1279,7 +1279,7 @@ void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSiz
DrawTexturePro(font.texture, srcRec, dstRec, (Vector2){ 0, 0 }, 0.0f, tint);
}
// Draw multiple character (codepoints)
// Draw multiple characters (codepoints)
void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint)
{
float textOffsetY = 0; // Offset between lines (on linebreak '\n')
@ -1674,7 +1674,7 @@ int TextCopy(char *dst, const char *src)
return bytes;
}
// Check if two text string are equal
// Check if two text strings are equal
// REQUIRES: strcmp()
bool TextIsEqual(const char *text1, const char *text2)
{
@ -1724,7 +1724,7 @@ const char *TextRemoveSpaces(const char *text)
if (text != NULL)
{
// Avoid copying the ' ' characters
for (int i = 0, j = 0; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++)
for (int i = 0, j = 0; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[i] != '\0'); i++)
{
if (text[i] != ' ') { buffer[j] = text[i]; j++; }
}

View File

@ -3,31 +3,31 @@
* rtextures - Basic functions to load and draw textures
*
* CONFIGURATION:
* #define SUPPORT_MODULE_RTEXTURES
* #define SUPPORT_MODULE_RTEXTURES 1
* rtextures module is included in the build
*
* #define SUPPORT_FILEFORMAT_BMP
* #define SUPPORT_FILEFORMAT_PNG
* #define SUPPORT_FILEFORMAT_TGA
* #define SUPPORT_FILEFORMAT_JPG
* #define SUPPORT_FILEFORMAT_GIF
* #define SUPPORT_FILEFORMAT_QOI
* #define SUPPORT_FILEFORMAT_PSD
* #define SUPPORT_FILEFORMAT_HDR
* #define SUPPORT_FILEFORMAT_PIC
* #define SUPPORT_FILEFORMAT_PNM
* #define SUPPORT_FILEFORMAT_DDS
* #define SUPPORT_FILEFORMAT_PKM
* #define SUPPORT_FILEFORMAT_KTX
* #define SUPPORT_FILEFORMAT_PVR
* #define SUPPORT_FILEFORMAT_ASTC
* Select desired fileformats to be supported for image data loading. Some of those formats are
* supported by default, to remove support, comment unrequired #define in this module
* #define SUPPORT_FILEFORMAT_BMP 1
* #define SUPPORT_FILEFORMAT_PNG 1
* #define SUPPORT_FILEFORMAT_TGA 0
* #define SUPPORT_FILEFORMAT_JPG 0
* #define SUPPORT_FILEFORMAT_GIF 1
* #define SUPPORT_FILEFORMAT_QOI 1
* #define SUPPORT_FILEFORMAT_PSD 0
* #define SUPPORT_FILEFORMAT_HDR 0
* #define SUPPORT_FILEFORMAT_PIC 0
* #define SUPPORT_FILEFORMAT_PNM 0
* #define SUPPORT_FILEFORMAT_DDS 1
* #define SUPPORT_FILEFORMAT_PKM 0
* #define SUPPORT_FILEFORMAT_KTX 0
* #define SUPPORT_FILEFORMAT_PVR 0
* #define SUPPORT_FILEFORMAT_ASTC 0
* Selected desired fileformats to be supported for image data loading. Some of those formats are
* supported by default, to remove support, #define as 0 in this module or your build system
*
* #define SUPPORT_IMAGE_EXPORT
* #define SUPPORT_IMAGE_EXPORT 1
* Support image export in multiple file formats
*
* #define SUPPORT_IMAGE_GENERATION
* #define SUPPORT_IMAGE_GENERATION 1
* Support procedural image generation functionality (gradient, spot, perlin-noise, cellular)
*
* DEPENDENCIES:
@ -366,7 +366,7 @@ Image LoadImageAnim(const char *fileName, int *frames)
return image;
}
// Load animated image data
// Load animated image data from memory
// - Image.data buffer includes all frames: [image#0][image#1][image#2][...]
// - Number of frames is returned through 'frames' parameter
// - All frames are returned in RGBA format
@ -580,7 +580,7 @@ Image LoadImageFromTexture(Texture2D texture)
return image;
}
// Load image from screen buffer and (screenshot)
// Load image from screen buffer (screenshot)
Image LoadImageFromScreen(void)
{
Image image = { 0 };
@ -1575,7 +1575,7 @@ Image ImageFromChannel(Image image, int selectedChannel)
// Check for RGBA formats
if (selectedChannel > 3)
{
TRACELOG(LOG_WARNING, "ImageFromChannel supports channels 0 to 3 (rgba). Setting channel to alpha.");
TRACELOG(LOG_WARNING, "ImageFromChannel supports channels 0 to 3 (RGBA). Setting channel to alpha.");
selectedChannel = 3;
}
@ -2795,7 +2795,7 @@ void ImageColorGrayscale(Image *image)
// Modify image color: contrast
// NOTE: Contrast values between -100 and 100
void ImageColorContrast(Image *image, float contrast)
void ImageColorContrast(Image *image, int contrast)
{
// Security check to avoid program crash
if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return;
@ -2803,8 +2803,8 @@ void ImageColorContrast(Image *image, float contrast)
if (contrast < -100) contrast = -100;
if (contrast > 100) contrast = 100;
contrast = (100.0f + contrast)/100.0f;
contrast *= contrast;
float factor = (float)(100.0f + contrast)/100.0f;
factor *= factor;
Color *pixels = LoadImageColors(*image);
@ -2812,7 +2812,7 @@ void ImageColorContrast(Image *image, float contrast)
{
float pR = (float)pixels[i].r/255.0f;
pR -= 0.5f;
pR *= contrast;
pR *= factor;
pR += 0.5f;
pR *= 255;
if (pR < 0) pR = 0;
@ -2820,7 +2820,7 @@ void ImageColorContrast(Image *image, float contrast)
float pG = (float)pixels[i].g/255.0f;
pG -= 0.5f;
pG *= contrast;
pG *= factor;
pG += 0.5f;
pG *= 255;
if (pG < 0) pG = 0;
@ -2828,7 +2828,7 @@ void ImageColorContrast(Image *image, float contrast)
float pB = (float)pixels[i].b/255.0f;
pB -= 0.5f;
pB *= contrast;
pB *= factor;
pB += 0.5f;
pB *= 255;
if (pB < 0) pB = 0;
@ -3730,7 +3730,14 @@ void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color)
}
// Draw rectangle lines within an image
void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color)
void ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int height, Color color)
{
Rectangle rec = { posX, posY, width, height };
ImageDrawRectangleLinesEx(dst, rec, 1, color);
}
// Draw rectangle lines within an image with extended parameters
void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color)
{
ImageDrawRectangle(dst, (int)rec.x, (int)rec.y, (int)rec.width, thick, color);
ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + thick), thick, (int)(rec.height - thick*2), color);
@ -3806,7 +3813,7 @@ void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color col
}
// Draw triangle with interpolated colors within an image
void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3)
void ImageDrawTriangleGradient(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3)
{
// Calculate the 2D bounding box of the triangle
// Determine the minimum and maximum x and y coordinates of the triangle vertices
@ -4624,7 +4631,7 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
}
}
// Draws a texture (or part of it) that stretches or shrinks nicely using n-patch info
// Draw a texture (or part of it) that stretches or shrinks nicely using n-patch info
void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint)
{
if (texture.id > 0)

View File

@ -1,4 +1,4 @@
Copyright (c) 2025 Ramon Santamaria (@raysan5)
Copyright (c) 2026 Ramon Santamaria (@raysan5)
This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.

View File

@ -2,7 +2,7 @@
#
# raylib makefile for Desktop platforms, Web (Wasm), Raspberry Pi (DRM mode) and Android
#
# Copyright (c) 2013-2025 Ramon Santamaria (@raysan5)
# Copyright (c) 2013-2026 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.

View File

@ -474,8 +474,8 @@ int main(int argc, char *argv[])
exTextUpdated[1] = TextReplaceAlloc(exTextUpdated[0], "<name>", exName + strlen(exCategory) + 1);
//TextReplaceAlloc(newExample, "<user_name>", "Ray");
//TextReplaceAlloc(newExample, "@<user_github>", "@raysan5");
//TextReplaceAlloc(newExample, "<year_created>", 2025);
//TextReplaceAlloc(newExample, "<year_updated>", 2025);
//TextReplaceAlloc(newExample, "<year_created>", 2026);
//TextReplaceAlloc(newExample, "<year_updated>", 2026);
SaveFileText(TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName), exTextUpdated[1]);
for (int i = 0; i < 6; i++) { MemFree(exTextUpdated[i]); exTextUpdated[i] = NULL; }
@ -1268,8 +1268,7 @@ int main(int argc, char *argv[])
// NOTE: Some examples should be excluded from VS2022 solution because
// they have specific platform/linkage requirements:
if ((strcmp(exInfo->name, "web_basic_window") == 0) ||
(strcmp(exInfo->name, "raylib_opengl_interop") == 0)) continue;
if (strcmp(exInfo->name, "raylib_opengl_interop") == 0) continue;
// Review: Add: raylib/projects/VS2022/examples/<category>_example_name.vcxproj
// Review: Add: raylib/projects/VS2022/raylib.sln
@ -1875,7 +1874,7 @@ int main(int argc, char *argv[])
printf("\n////////////////////////////////////////////////////////////////////////////////////////////\n");
printf("// //\n");
printf("// rexm [raylib examples manager] - A simple command-line tool to manage raylib examples //\n");
printf("// powered by raylib v5.6-dev //\n");
printf("// powered by raylib v6.0 //\n");
printf("// //\n");
printf("// Copyright (c) 2025-2026 Ramon Santamaria (@raysan5) //\n");
printf("// //\n");

View File

@ -13,7 +13,7 @@ BEGIN
VALUE "FileDescription", "rexm | raylib examples manager"
VALUE "FileVersion", "1.0"
VALUE "InternalName", "rexm"
VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria"
VALUE "LegalCopyright", "(c) 2026 Ramon Santamaria"
//VALUE "OriginalFilename", "rexm.exe"
VALUE "rexm", "rexm"
VALUE "ProductVersion", "1.0"

View File

@ -1,6 +1,6 @@
# rlparser - raylib parser
This parser scans [`raylib.h`](../src/raylib.h) to get information about `defines`, `structs`, `enums` and `functions`.
This parser scans [`raylib.h`](../../src/raylib.h) to get information about `defines`, `structs`, `enums` and `functions`.
All data is separated into parts, usually as strings. The following types are used for data:
- `struct DefineInfo`

View File

@ -15,7 +15,7 @@
{
"name": "RAYLIB_VERSION_MINOR",
"type": "INT",
"value": 0,
"value": 1,
"description": ""
},
{
@ -27,7 +27,7 @@
{
"name": "RAYLIB_VERSION",
"type": "STRING",
"value": "6.0",
"value": "6.1-dev",
"description": ""
},
{
@ -3120,7 +3120,7 @@
"name": "fileName"
},
{
"type": "void *",
"type": "const void *",
"name": "data"
},
{
@ -3573,12 +3573,12 @@
},
{
"name": "ShowCursor",
"description": "Shows cursor",
"description": "Show cursor",
"returnType": "void"
},
{
"name": "HideCursor",
"description": "Hides cursor",
"description": "Hide cursor",
"returnType": "void"
},
{
@ -3588,12 +3588,12 @@
},
{
"name": "EnableCursor",
"description": "Enables cursor (unlock cursor)",
"description": "Enable cursor (unlock cursor)",
"returnType": "void"
},
{
"name": "DisableCursor",
"description": "Disables cursor (lock cursor)",
"description": "Disable cursor (lock cursor)",
"returnType": "void"
},
{
@ -3603,7 +3603,7 @@
},
{
"name": "ClearBackground",
"description": "Set background color (framebuffer clear color)",
"description": "Clear background (framebuffer) to color",
"returnType": "void",
"params": [
{
@ -3614,12 +3614,12 @@
},
{
"name": "BeginDrawing",
"description": "Setup canvas (framebuffer) to start drawing",
"description": "Begin canvas (framebuffer) drawing",
"returnType": "void"
},
{
"name": "EndDrawing",
"description": "End canvas drawing and swap buffers (double buffering)",
"description": "End canvas (framebuffer) drawing and swap buffers (double buffering)",
"returnType": "void"
},
{
@ -3635,7 +3635,7 @@
},
{
"name": "EndMode2D",
"description": "Ends 2D mode with custom camera",
"description": "End 2D mode with custom camera",
"returnType": "void"
},
{
@ -3651,7 +3651,7 @@
},
{
"name": "EndMode3D",
"description": "Ends 3D mode and returns to default 2D orthographic mode",
"description": "End 3D mode and returns to default 2D orthographic mode",
"returnType": "void"
},
{
@ -3667,7 +3667,7 @@
},
{
"name": "EndTextureMode",
"description": "Ends drawing to render texture",
"description": "End drawing to render texture",
"returnType": "void"
},
{
@ -3978,7 +3978,7 @@
},
{
"name": "GetWorldToScreen",
"description": "Get the screen space position for a 3d world space position",
"description": "Get screen space position for a 3d world space position",
"returnType": "Vector2",
"params": [
{
@ -3993,7 +3993,7 @@
},
{
"name": "GetWorldToScreenEx",
"description": "Get size position for a 3d world space position",
"description": "Get sized screen space position for a 3d world space position",
"returnType": "Vector2",
"params": [
{
@ -4016,7 +4016,7 @@
},
{
"name": "GetWorldToScreen2D",
"description": "Get the screen space position for a 2d camera world space position",
"description": "Get screen space position for a 2d camera world space position",
"returnType": "Vector2",
"params": [
{
@ -4031,7 +4031,7 @@
},
{
"name": "GetScreenToWorld2D",
"description": "Get the world space position for a 2d camera screen space position",
"description": "Get world space position for a 2d camera screen space position",
"returnType": "Vector2",
"params": [
{
@ -4182,7 +4182,7 @@
},
{
"name": "SetConfigFlags",
"description": "Setup init configuration flags (view FLAGS)",
"description": "Set up init configuration flags (view FLAGS)",
"returnType": "void",
"params": [
{
@ -4316,7 +4316,7 @@
"name": "fileName"
},
{
"type": "void *",
"type": "const void *",
"name": "data"
},
{
@ -4696,7 +4696,7 @@
},
{
"name": "LoadDirectoryFilesEx",
"description": "Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"",
"description": "Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`",
"returnType": "FilePathList",
"params": [
{
@ -4853,7 +4853,7 @@
"returnType": "unsigned int",
"params": [
{
"type": "unsigned char *",
"type": "const unsigned char *",
"name": "data"
},
{
@ -4868,7 +4868,7 @@
"returnType": "unsigned int *",
"params": [
{
"type": "unsigned char *",
"type": "const unsigned char *",
"name": "data"
},
{
@ -4883,7 +4883,7 @@
"returnType": "unsigned int *",
"params": [
{
"type": "unsigned char *",
"type": "const unsigned char *",
"name": "data"
},
{
@ -4898,7 +4898,7 @@
"returnType": "unsigned int *",
"params": [
{
"type": "unsigned char *",
"type": "const unsigned char *",
"name": "data"
},
{
@ -5401,7 +5401,7 @@
},
{
"name": "IsGestureDetected",
"description": "Check if a gesture have been detected",
"description": "Check if a gesture has been detected",
"returnType": "bool",
"params": [
{
@ -5698,6 +5698,48 @@
}
]
},
{
"name": "DrawCircleV",
"description": "Draw a color-filled circle (Vector version)",
"returnType": "void",
"params": [
{
"type": "Vector2",
"name": "center"
},
{
"type": "float",
"name": "radius"
},
{
"type": "Color",
"name": "color"
}
]
},
{
"name": "DrawCircleGradient",
"description": "Draw a gradient-filled circle",
"returnType": "void",
"params": [
{
"type": "Vector2",
"name": "center"
},
{
"type": "float",
"name": "radius"
},
{
"type": "Color",
"name": "inner"
},
{
"type": "Color",
"name": "outer"
}
]
},
{
"name": "DrawCircleSector",
"description": "Draw a piece of a circle",
@ -5760,52 +5802,6 @@
}
]
},
{
"name": "DrawCircleGradient",
"description": "Draw a gradient-filled circle",
"returnType": "void",
"params": [
{
"type": "int",
"name": "centerX"
},
{
"type": "int",
"name": "centerY"
},
{
"type": "float",
"name": "radius"
},
{
"type": "Color",
"name": "inner"
},
{
"type": "Color",
"name": "outer"
}
]
},
{
"name": "DrawCircleV",
"description": "Draw a color-filled circle (Vector version)",
"returnType": "void",
"params": [
{
"type": "Vector2",
"name": "center"
},
{
"type": "float",
"name": "radius"
},
{
"type": "Color",
"name": "color"
}
]
},
{
"name": "DrawCircleLines",
"description": "Draw circle outline",
@ -6285,7 +6281,7 @@
},
{
"name": "DrawRectangleRoundedLinesEx",
"description": "Draw rectangle with rounded edges outline",
"description": "Draw rectangle lines with rounded edges outline",
"returnType": "void",
"params": [
{
@ -6333,6 +6329,37 @@
}
]
},
{
"name": "DrawTriangleGradient",
"description": "Draw triangle with interpolated colors (vertex in counter-clockwise order!)",
"returnType": "void",
"params": [
{
"type": "Vector2",
"name": "v1"
},
{
"type": "Vector2",
"name": "v2"
},
{
"type": "Vector2",
"name": "v3"
},
{
"type": "Color",
"name": "c1"
},
{
"type": "Color",
"name": "c2"
},
{
"type": "Color",
"name": "c3"
}
]
},
{
"name": "DrawTriangleLines",
"description": "Draw triangle outline (vertex in counter-clockwise order!)",
@ -6396,7 +6423,7 @@
},
{
"name": "DrawPoly",
"description": "Draw a regular polygon (Vector version)",
"description": "Draw a polygon of n sides",
"returnType": "void",
"params": [
{
@ -6811,7 +6838,7 @@
]
},
{
"name": "GetSplinePointBezierQuad",
"name": "GetSplinePointBezierQuadratic",
"description": "Get (evaluate) spline point: Quadratic Bezier",
"returnType": "Vector2",
"params": [
@ -6919,7 +6946,7 @@
},
{
"name": "CheckCollisionCircleLine",
"description": "Check if circle collides with a line created betweeen two points [p1] and [p2]",
"description": "Check if circle collides with a line created between two points [p1] and [p2]",
"returnType": "bool",
"params": [
{
@ -7189,7 +7216,7 @@
},
{
"name": "LoadImageFromScreen",
"description": "Load image from screen buffer and (screenshot)",
"description": "Load image from screen buffer (screenshot)",
"returnType": "Image"
},
{
@ -7917,7 +7944,7 @@
"name": "image"
},
{
"type": "float",
"type": "int",
"name": "contrast"
}
]
@ -8357,6 +8384,37 @@
"name": "ImageDrawRectangleLines",
"description": "Draw rectangle lines within an image",
"returnType": "void",
"params": [
{
"type": "Image *",
"name": "dst"
},
{
"type": "int",
"name": "posX"
},
{
"type": "int",
"name": "posY"
},
{
"type": "int",
"name": "width"
},
{
"type": "int",
"name": "height"
},
{
"type": "Color",
"name": "color"
}
]
},
{
"name": "ImageDrawRectangleLinesEx",
"description": "Draw rectangle lines within an image with extended parameters",
"returnType": "void",
"params": [
{
"type": "Image *",
@ -8404,7 +8462,7 @@
]
},
{
"name": "ImageDrawTriangleEx",
"name": "ImageDrawTriangleGradient",
"description": "Draw triangle with interpolated colors within an image",
"returnType": "void",
"params": [
@ -8900,7 +8958,7 @@
},
{
"name": "DrawTextureNPatch",
"description": "Draws a texture (or part of it) that stretches or shrinks nicely",
"description": "Draw a texture (or part of it) that stretches or shrinks nicely",
"returnType": "void",
"params": [
{
@ -9532,7 +9590,7 @@
},
{
"name": "DrawTextCodepoints",
"description": "Draw multiple character (codepoint)",
"description": "Draw multiple characters (codepoint)",
"returnType": "void",
"params": [
{
@ -9856,7 +9914,7 @@
},
{
"name": "TextIsEqual",
"description": "Check if two text string are equal",
"description": "Check if two text strings are equal",
"returnType": "bool",
"params": [
{
@ -10599,7 +10657,7 @@
},
{
"type": "int",
"name": "sides"
"name": "slices"
},
{
"type": "Color",
@ -10626,11 +10684,11 @@
},
{
"type": "int",
"name": "slices"
"name": "rings"
},
{
"type": "int",
"name": "rings"
"name": "slices"
},
{
"type": "Color",
@ -10657,11 +10715,11 @@
},
{
"type": "int",
"name": "slices"
"name": "rings"
},
{
"type": "int",
"name": "rings"
"name": "slices"
},
{
"type": "Color",
@ -11751,7 +11809,7 @@
},
{
"name": "IsWaveValid",
"description": "Checks if wave data is valid (data loaded and parameters)",
"description": "Check if wave data is valid (data loaded and parameters)",
"returnType": "bool",
"params": [
{
@ -11784,7 +11842,7 @@
},
{
"name": "LoadSoundAlias",
"description": "Create a new sound that shares the same sample data as the source sound, does not own the sound data",
"description": "Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data",
"returnType": "Sound",
"params": [
{
@ -11795,7 +11853,7 @@
},
{
"name": "IsSoundValid",
"description": "Checks if a sound is valid (data loaded and buffers initialized)",
"description": "Check if a sound is valid (data loaded and buffers initialized)",
"returnType": "bool",
"params": [
{
@ -11819,7 +11877,7 @@
},
{
"type": "int",
"name": "sampleCount"
"name": "frameCount"
}
]
},
@ -11847,7 +11905,7 @@
},
{
"name": "UnloadSoundAlias",
"description": "Unload a sound alias (does not deallocate sample data)",
"description": "Unload sound alias (does not deallocate sample data)",
"returnType": "void",
"params": [
{
@ -12093,7 +12151,7 @@
},
{
"name": "IsMusicValid",
"description": "Checks if a music stream is valid (context and buffers initialized)",
"description": "Check if a music stream is valid (context and buffers initialized)",
"returnType": "bool",
"params": [
{
@ -12137,7 +12195,7 @@
},
{
"name": "UpdateMusicStream",
"description": "Updates buffers for music streaming",
"description": "Update buffers for music streaming",
"returnType": "void",
"params": [
{
@ -12211,7 +12269,7 @@
},
{
"name": "SetMusicPitch",
"description": "Set pitch for a music (1.0 is base level)",
"description": "Set pitch for music (1.0 is base level)",
"returnType": "void",
"params": [
{
@ -12226,7 +12284,7 @@
},
{
"name": "SetMusicPan",
"description": "Set pan for a music (-1.0 left, 0.0 center, 1.0 right)",
"description": "Set pan for music (-1.0 left, 0.0 center, 1.0 right)",
"returnType": "void",
"params": [
{
@ -12282,7 +12340,7 @@
},
{
"name": "IsAudioStreamValid",
"description": "Checks if an audio stream is valid (buffers initialized)",
"description": "Check if an audio stream is valid (buffers initialized)",
"returnType": "bool",
"params": [
{
@ -12419,7 +12477,7 @@
},
{
"name": "SetAudioStreamPan",
"description": "Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)",
"description": "Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right)",
"returnType": "void",
"params": [
{

View File

@ -15,7 +15,7 @@ return {
{
name = "RAYLIB_VERSION_MINOR",
type = "INT",
value = 0,
value = 1,
description = ""
},
{
@ -27,7 +27,7 @@ return {
{
name = "RAYLIB_VERSION",
type = "STRING",
value = "6.0",
value = "6.1-dev",
description = ""
},
{
@ -3101,7 +3101,7 @@ return {
returnType = "bool",
params = {
{type = "const char *", name = "fileName"},
{type = "void *", name = "data"},
{type = "const void *", name = "data"},
{type = "int", name = "dataSize"}
}
},
@ -3450,12 +3450,12 @@ return {
},
{
name = "ShowCursor",
description = "Shows cursor",
description = "Show cursor",
returnType = "void"
},
{
name = "HideCursor",
description = "Hides cursor",
description = "Hide cursor",
returnType = "void"
},
{
@ -3465,12 +3465,12 @@ return {
},
{
name = "EnableCursor",
description = "Enables cursor (unlock cursor)",
description = "Enable cursor (unlock cursor)",
returnType = "void"
},
{
name = "DisableCursor",
description = "Disables cursor (lock cursor)",
description = "Disable cursor (lock cursor)",
returnType = "void"
},
{
@ -3480,7 +3480,7 @@ return {
},
{
name = "ClearBackground",
description = "Set background color (framebuffer clear color)",
description = "Clear background (framebuffer) to color",
returnType = "void",
params = {
{type = "Color", name = "color"}
@ -3488,12 +3488,12 @@ return {
},
{
name = "BeginDrawing",
description = "Setup canvas (framebuffer) to start drawing",
description = "Begin canvas (framebuffer) drawing",
returnType = "void"
},
{
name = "EndDrawing",
description = "End canvas drawing and swap buffers (double buffering)",
description = "End canvas (framebuffer) drawing and swap buffers (double buffering)",
returnType = "void"
},
{
@ -3506,7 +3506,7 @@ return {
},
{
name = "EndMode2D",
description = "Ends 2D mode with custom camera",
description = "End 2D mode with custom camera",
returnType = "void"
},
{
@ -3519,7 +3519,7 @@ return {
},
{
name = "EndMode3D",
description = "Ends 3D mode and returns to default 2D orthographic mode",
description = "End 3D mode and returns to default 2D orthographic mode",
returnType = "void"
},
{
@ -3532,7 +3532,7 @@ return {
},
{
name = "EndTextureMode",
description = "Ends drawing to render texture",
description = "End drawing to render texture",
returnType = "void"
},
{
@ -3723,7 +3723,7 @@ return {
},
{
name = "GetWorldToScreen",
description = "Get the screen space position for a 3d world space position",
description = "Get screen space position for a 3d world space position",
returnType = "Vector2",
params = {
{type = "Vector3", name = "position"},
@ -3732,7 +3732,7 @@ return {
},
{
name = "GetWorldToScreenEx",
description = "Get size position for a 3d world space position",
description = "Get sized screen space position for a 3d world space position",
returnType = "Vector2",
params = {
{type = "Vector3", name = "position"},
@ -3743,7 +3743,7 @@ return {
},
{
name = "GetWorldToScreen2D",
description = "Get the screen space position for a 2d camera world space position",
description = "Get screen space position for a 2d camera world space position",
returnType = "Vector2",
params = {
{type = "Vector2", name = "position"},
@ -3752,7 +3752,7 @@ return {
},
{
name = "GetScreenToWorld2D",
description = "Get the world space position for a 2d camera screen space position",
description = "Get world space position for a 2d camera screen space position",
returnType = "Vector2",
params = {
{type = "Vector2", name = "position"},
@ -3861,7 +3861,7 @@ return {
},
{
name = "SetConfigFlags",
description = "Setup init configuration flags (view FLAGS)",
description = "Set up init configuration flags (view FLAGS)",
returnType = "void",
params = {
{type = "unsigned int", name = "flags"}
@ -3949,7 +3949,7 @@ return {
returnType = "bool",
params = {
{type = "const char *", name = "fileName"},
{type = "void *", name = "data"},
{type = "const void *", name = "data"},
{type = "int", name = "dataSize"}
}
},
@ -4207,7 +4207,7 @@ return {
},
{
name = "LoadDirectoryFilesEx",
description = "Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"",
description = "Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`",
returnType = "FilePathList",
params = {
{type = "const char *", name = "basePath"},
@ -4303,7 +4303,7 @@ return {
description = "Compute CRC32 hash code",
returnType = "unsigned int",
params = {
{type = "unsigned char *", name = "data"},
{type = "const unsigned char *", name = "data"},
{type = "int", name = "dataSize"}
}
},
@ -4312,7 +4312,7 @@ return {
description = "Compute MD5 hash code, returns static int[4] (16 bytes)",
returnType = "unsigned int *",
params = {
{type = "unsigned char *", name = "data"},
{type = "const unsigned char *", name = "data"},
{type = "int", name = "dataSize"}
}
},
@ -4321,7 +4321,7 @@ return {
description = "Compute SHA1 hash code, returns static int[5] (20 bytes)",
returnType = "unsigned int *",
params = {
{type = "unsigned char *", name = "data"},
{type = "const unsigned char *", name = "data"},
{type = "int", name = "dataSize"}
}
},
@ -4330,7 +4330,7 @@ return {
description = "Compute SHA256 hash code, returns static int[8] (32 bytes)",
returnType = "unsigned int *",
params = {
{type = "unsigned char *", name = "data"},
{type = "const unsigned char *", name = "data"},
{type = "int", name = "dataSize"}
}
},
@ -4690,7 +4690,7 @@ return {
},
{
name = "IsGestureDetected",
description = "Check if a gesture have been detected",
description = "Check if a gesture has been detected",
returnType = "bool",
params = {
{type = "unsigned int", name = "gesture"}
@ -4861,6 +4861,27 @@ return {
{type = "Color", name = "color"}
}
},
{
name = "DrawCircleV",
description = "Draw a color-filled circle (Vector version)",
returnType = "void",
params = {
{type = "Vector2", name = "center"},
{type = "float", name = "radius"},
{type = "Color", name = "color"}
}
},
{
name = "DrawCircleGradient",
description = "Draw a gradient-filled circle",
returnType = "void",
params = {
{type = "Vector2", name = "center"},
{type = "float", name = "radius"},
{type = "Color", name = "inner"},
{type = "Color", name = "outer"}
}
},
{
name = "DrawCircleSector",
description = "Draw a piece of a circle",
@ -4887,28 +4908,6 @@ return {
{type = "Color", name = "color"}
}
},
{
name = "DrawCircleGradient",
description = "Draw a gradient-filled circle",
returnType = "void",
params = {
{type = "int", name = "centerX"},
{type = "int", name = "centerY"},
{type = "float", name = "radius"},
{type = "Color", name = "inner"},
{type = "Color", name = "outer"}
}
},
{
name = "DrawCircleV",
description = "Draw a color-filled circle (Vector version)",
returnType = "void",
params = {
{type = "Vector2", name = "center"},
{type = "float", name = "radius"},
{type = "Color", name = "color"}
}
},
{
name = "DrawCircleLines",
description = "Draw circle outline",
@ -5130,7 +5129,7 @@ return {
},
{
name = "DrawRectangleRoundedLinesEx",
description = "Draw rectangle with rounded edges outline",
description = "Draw rectangle lines with rounded edges outline",
returnType = "void",
params = {
{type = "Rectangle", name = "rec"},
@ -5151,6 +5150,19 @@ return {
{type = "Color", name = "color"}
}
},
{
name = "DrawTriangleGradient",
description = "Draw triangle with interpolated colors (vertex in counter-clockwise order!)",
returnType = "void",
params = {
{type = "Vector2", name = "v1"},
{type = "Vector2", name = "v2"},
{type = "Vector2", name = "v3"},
{type = "Color", name = "c1"},
{type = "Color", name = "c2"},
{type = "Color", name = "c3"}
}
},
{
name = "DrawTriangleLines",
description = "Draw triangle outline (vertex in counter-clockwise order!)",
@ -5184,7 +5196,7 @@ return {
},
{
name = "DrawPoly",
description = "Draw a regular polygon (Vector version)",
description = "Draw a polygon of n sides",
returnType = "void",
params = {
{type = "Vector2", name = "center"},
@ -5371,7 +5383,7 @@ return {
}
},
{
name = "GetSplinePointBezierQuad",
name = "GetSplinePointBezierQuadratic",
description = "Get (evaluate) spline point: Quadratic Bezier",
returnType = "Vector2",
params = {
@ -5425,7 +5437,7 @@ return {
},
{
name = "CheckCollisionCircleLine",
description = "Check if circle collides with a line created betweeen two points [p1] and [p2]",
description = "Check if circle collides with a line created between two points [p1] and [p2]",
returnType = "bool",
params = {
{type = "Vector2", name = "center"},
@ -5566,7 +5578,7 @@ return {
},
{
name = "LoadImageFromScreen",
description = "Load image from screen buffer and (screenshot)",
description = "Load image from screen buffer (screenshot)",
returnType = "Image"
},
{
@ -5969,7 +5981,7 @@ return {
returnType = "void",
params = {
{type = "Image *", name = "image"},
{type = "float", name = "contrast"}
{type = "int", name = "contrast"}
}
},
{
@ -6194,6 +6206,19 @@ return {
name = "ImageDrawRectangleLines",
description = "Draw rectangle lines within an image",
returnType = "void",
params = {
{type = "Image *", name = "dst"},
{type = "int", name = "posX"},
{type = "int", name = "posY"},
{type = "int", name = "width"},
{type = "int", name = "height"},
{type = "Color", name = "color"}
}
},
{
name = "ImageDrawRectangleLinesEx",
description = "Draw rectangle lines within an image with extended parameters",
returnType = "void",
params = {
{type = "Image *", name = "dst"},
{type = "Rectangle", name = "rec"},
@ -6214,7 +6239,7 @@ return {
}
},
{
name = "ImageDrawTriangleEx",
name = "ImageDrawTriangleGradient",
description = "Draw triangle with interpolated colors within an image",
returnType = "void",
params = {
@ -6470,7 +6495,7 @@ return {
},
{
name = "DrawTextureNPatch",
description = "Draws a texture (or part of it) that stretches or shrinks nicely",
description = "Draw a texture (or part of it) that stretches or shrinks nicely",
returnType = "void",
params = {
{type = "Texture2D", name = "texture"},
@ -6805,7 +6830,7 @@ return {
},
{
name = "DrawTextCodepoints",
description = "Draw multiple character (codepoint)",
description = "Draw multiple characters (codepoint)",
returnType = "void",
params = {
{type = "Font", name = "font"},
@ -6991,7 +7016,7 @@ return {
},
{
name = "TextIsEqual",
description = "Check if two text string are equal",
description = "Check if two text strings are equal",
returnType = "bool",
params = {
{type = "const char *", name = "text1"},
@ -7378,7 +7403,7 @@ return {
{type = "Vector3", name = "endPos"},
{type = "float", name = "startRadius"},
{type = "float", name = "endRadius"},
{type = "int", name = "sides"},
{type = "int", name = "slices"},
{type = "Color", name = "color"}
}
},
@ -7390,8 +7415,8 @@ return {
{type = "Vector3", name = "startPos"},
{type = "Vector3", name = "endPos"},
{type = "float", name = "radius"},
{type = "int", name = "slices"},
{type = "int", name = "rings"},
{type = "int", name = "slices"},
{type = "Color", name = "color"}
}
},
@ -7403,8 +7428,8 @@ return {
{type = "Vector3", name = "startPos"},
{type = "Vector3", name = "endPos"},
{type = "float", name = "radius"},
{type = "int", name = "slices"},
{type = "int", name = "rings"},
{type = "int", name = "slices"},
{type = "Color", name = "color"}
}
},
@ -7998,7 +8023,7 @@ return {
},
{
name = "IsWaveValid",
description = "Checks if wave data is valid (data loaded and parameters)",
description = "Check if wave data is valid (data loaded and parameters)",
returnType = "bool",
params = {
{type = "Wave", name = "wave"}
@ -8022,7 +8047,7 @@ return {
},
{
name = "LoadSoundAlias",
description = "Create a new sound that shares the same sample data as the source sound, does not own the sound data",
description = "Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data",
returnType = "Sound",
params = {
{type = "Sound", name = "source"}
@ -8030,7 +8055,7 @@ return {
},
{
name = "IsSoundValid",
description = "Checks if a sound is valid (data loaded and buffers initialized)",
description = "Check if a sound is valid (data loaded and buffers initialized)",
returnType = "bool",
params = {
{type = "Sound", name = "sound"}
@ -8043,7 +8068,7 @@ return {
params = {
{type = "Sound", name = "sound"},
{type = "const void *", name = "data"},
{type = "int", name = "sampleCount"}
{type = "int", name = "frameCount"}
}
},
{
@ -8064,7 +8089,7 @@ return {
},
{
name = "UnloadSoundAlias",
description = "Unload a sound alias (does not deallocate sample data)",
description = "Unload sound alias (does not deallocate sample data)",
returnType = "void",
params = {
{type = "Sound", name = "alias"}
@ -8220,7 +8245,7 @@ return {
},
{
name = "IsMusicValid",
description = "Checks if a music stream is valid (context and buffers initialized)",
description = "Check if a music stream is valid (context and buffers initialized)",
returnType = "bool",
params = {
{type = "Music", name = "music"}
@ -8252,7 +8277,7 @@ return {
},
{
name = "UpdateMusicStream",
description = "Updates buffers for music streaming",
description = "Update buffers for music streaming",
returnType = "void",
params = {
{type = "Music", name = "music"}
@ -8302,7 +8327,7 @@ return {
},
{
name = "SetMusicPitch",
description = "Set pitch for a music (1.0 is base level)",
description = "Set pitch for music (1.0 is base level)",
returnType = "void",
params = {
{type = "Music", name = "music"},
@ -8311,7 +8336,7 @@ return {
},
{
name = "SetMusicPan",
description = "Set pan for a music (-1.0 left, 0.0 center, 1.0 right)",
description = "Set pan for music (-1.0 left, 0.0 center, 1.0 right)",
returnType = "void",
params = {
{type = "Music", name = "music"},
@ -8346,7 +8371,7 @@ return {
},
{
name = "IsAudioStreamValid",
description = "Checks if an audio stream is valid (buffers initialized)",
description = "Check if an audio stream is valid (buffers initialized)",
returnType = "bool",
params = {
{type = "AudioStream", name = "stream"}
@ -8438,7 +8463,7 @@ return {
},
{
name = "SetAudioStreamPan",
description = "Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)",
description = "Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right)",
returnType = "void",
params = {
{type = "AudioStream", name = "stream"},

File diff suppressed because it is too large Load Diff

View File

@ -3,9 +3,9 @@
<Defines count="57">
<Define name="RAYLIB_H" type="GUARD" value="" desc="" />
<Define name="RAYLIB_VERSION_MAJOR" type="INT" value="6" desc="" />
<Define name="RAYLIB_VERSION_MINOR" type="INT" value="0" desc="" />
<Define name="RAYLIB_VERSION_MINOR" type="INT" value="1" desc="" />
<Define name="RAYLIB_VERSION_PATCH" type="INT" value="0" desc="" />
<Define name="RAYLIB_VERSION" type="STRING" value="6.0" desc="" />
<Define name="RAYLIB_VERSION" type="STRING" value="6.1-dev" desc="" />
<Define name="__declspec(x)" type="MACRO" value="__attribute__((x))" desc="" />
<Define name="RLAPI" type="UNKNOWN" value="__declspec(dllexport)" desc="Building the library as a Win32 shared library (.dll)" />
<Define name="PI" type="FLOAT" value="3.14159265358979323846" desc="" />
@ -667,7 +667,7 @@
</Callback>
<Callback name="SaveFileDataCallback" retType="bool" paramCount="3" desc="FileIO: Save binary data">
<Param type="const char *" name="fileName" desc="" />
<Param type="void *" name="data" desc="" />
<Param type="const void *" name="data" desc="" />
<Param type="int" name="dataSize" desc="" />
</Callback>
<Callback name="LoadFileTextCallback" retType="char *" paramCount="1" desc="FileIO: Load text data">
@ -682,7 +682,7 @@
<Param type="unsigned int" name="frames" desc="" />
</Callback>
</Callbacks>
<Functions count="600">
<Functions count="602">
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
@ -809,39 +809,39 @@
</Function>
<Function name="DisableEventWaiting" retType="void" paramCount="0" desc="Disable waiting for events on EndDrawing(), automatic events polling">
</Function>
<Function name="ShowCursor" retType="void" paramCount="0" desc="Shows cursor">
<Function name="ShowCursor" retType="void" paramCount="0" desc="Show cursor">
</Function>
<Function name="HideCursor" retType="void" paramCount="0" desc="Hides cursor">
<Function name="HideCursor" retType="void" paramCount="0" desc="Hide cursor">
</Function>
<Function name="IsCursorHidden" retType="bool" paramCount="0" desc="Check if cursor is not visible">
</Function>
<Function name="EnableCursor" retType="void" paramCount="0" desc="Enables cursor (unlock cursor)">
<Function name="EnableCursor" retType="void" paramCount="0" desc="Enable cursor (unlock cursor)">
</Function>
<Function name="DisableCursor" retType="void" paramCount="0" desc="Disables cursor (lock cursor)">
<Function name="DisableCursor" retType="void" paramCount="0" desc="Disable cursor (lock cursor)">
</Function>
<Function name="IsCursorOnScreen" retType="bool" paramCount="0" desc="Check if cursor is on the screen">
</Function>
<Function name="ClearBackground" retType="void" paramCount="1" desc="Set background color (framebuffer clear color)">
<Function name="ClearBackground" retType="void" paramCount="1" desc="Clear background (framebuffer) to color">
<Param type="Color" name="color" desc="" />
</Function>
<Function name="BeginDrawing" retType="void" paramCount="0" desc="Setup canvas (framebuffer) to start drawing">
<Function name="BeginDrawing" retType="void" paramCount="0" desc="Begin canvas (framebuffer) drawing">
</Function>
<Function name="EndDrawing" retType="void" paramCount="0" desc="End canvas drawing and swap buffers (double buffering)">
<Function name="EndDrawing" retType="void" paramCount="0" desc="End canvas (framebuffer) drawing and swap buffers (double buffering)">
</Function>
<Function name="BeginMode2D" retType="void" paramCount="1" desc="Begin 2D mode with custom camera (2D)">
<Param type="Camera2D" name="camera" desc="" />
</Function>
<Function name="EndMode2D" retType="void" paramCount="0" desc="Ends 2D mode with custom camera">
<Function name="EndMode2D" retType="void" paramCount="0" desc="End 2D mode with custom camera">
</Function>
<Function name="BeginMode3D" retType="void" paramCount="1" desc="Begin 3D mode with custom camera (3D)">
<Param type="Camera3D" name="camera" desc="" />
</Function>
<Function name="EndMode3D" retType="void" paramCount="0" desc="Ends 3D mode and returns to default 2D orthographic mode">
<Function name="EndMode3D" retType="void" paramCount="0" desc="End 3D mode and returns to default 2D orthographic mode">
</Function>
<Function name="BeginTextureMode" retType="void" paramCount="1" desc="Begin drawing to render texture">
<Param type="RenderTexture2D" name="target" desc="" />
</Function>
<Function name="EndTextureMode" retType="void" paramCount="0" desc="Ends drawing to render texture">
<Function name="EndTextureMode" retType="void" paramCount="0" desc="End drawing to render texture">
</Function>
<Function name="BeginShaderMode" retType="void" paramCount="1" desc="Begin custom shader drawing">
<Param type="Shader" name="shader" desc="" />
@ -927,21 +927,21 @@
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
</Function>
<Function name="GetWorldToScreen" retType="Vector2" paramCount="2" desc="Get the screen space position for a 3d world space position">
<Function name="GetWorldToScreen" retType="Vector2" paramCount="2" desc="Get screen space position for a 3d world space position">
<Param type="Vector3" name="position" desc="" />
<Param type="Camera" name="camera" desc="" />
</Function>
<Function name="GetWorldToScreenEx" retType="Vector2" paramCount="4" desc="Get size position for a 3d world space position">
<Function name="GetWorldToScreenEx" retType="Vector2" paramCount="4" desc="Get sized screen space position for a 3d world space position">
<Param type="Vector3" name="position" desc="" />
<Param type="Camera" name="camera" desc="" />
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
</Function>
<Function name="GetWorldToScreen2D" retType="Vector2" paramCount="2" desc="Get the screen space position for a 2d camera world space position">
<Function name="GetWorldToScreen2D" retType="Vector2" paramCount="2" desc="Get screen space position for a 2d camera world space position">
<Param type="Vector2" name="position" desc="" />
<Param type="Camera2D" name="camera" desc="" />
</Function>
<Function name="GetScreenToWorld2D" retType="Vector2" paramCount="2" desc="Get the world space position for a 2d camera screen space position">
<Function name="GetScreenToWorld2D" retType="Vector2" paramCount="2" desc="Get world space position for a 2d camera screen space position">
<Param type="Vector2" name="position" desc="" />
<Param type="Camera2D" name="camera" desc="" />
</Function>
@ -985,7 +985,7 @@
<Function name="TakeScreenshot" retType="void" paramCount="1" desc="Takes a screenshot of current screen (filename extension defines format)">
<Param type="const char *" name="fileName" desc="" />
</Function>
<Function name="SetConfigFlags" retType="void" paramCount="1" desc="Setup init configuration flags (view FLAGS)">
<Function name="SetConfigFlags" retType="void" paramCount="1" desc="Set up init configuration flags (view FLAGS)">
<Param type="unsigned int" name="flags" desc="" />
</Function>
<Function name="OpenURL" retType="void" paramCount="1" desc="Open URL with default system browser (if available)">
@ -1021,7 +1021,7 @@
</Function>
<Function name="SaveFileData" retType="bool" paramCount="3" desc="Save data to file from byte array (write), returns true on success">
<Param type="const char *" name="fileName" desc="" />
<Param type="void *" name="data" desc="" />
<Param type="const void *" name="data" desc="" />
<Param type="int" name="dataSize" desc="" />
</Function>
<Function name="ExportDataAsCode" retType="bool" paramCount="3" desc="Export data to code (.h), returns true on success">
@ -1125,7 +1125,7 @@
<Function name="LoadDirectoryFiles" retType="FilePathList" paramCount="1" desc="Load directory filepaths, files and directories, no subdirs scan">
<Param type="const char *" name="dirPath" desc="" />
</Function>
<Function name="LoadDirectoryFilesEx" retType="FilePathList" paramCount="3" desc="Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"">
<Function name="LoadDirectoryFilesEx" retType="FilePathList" paramCount="3" desc="Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`">
<Param type="const char *" name="basePath" desc="" />
<Param type="const char *" name="filter" desc="" />
<Param type="bool" name="scanSubdirs" desc="" />
@ -1168,19 +1168,19 @@
<Param type="int *" name="outputSize" desc="" />
</Function>
<Function name="ComputeCRC32" retType="unsigned int" paramCount="2" desc="Compute CRC32 hash code">
<Param type="unsigned char *" name="data" desc="" />
<Param type="const unsigned char *" name="data" desc="" />
<Param type="int" name="dataSize" desc="" />
</Function>
<Function name="ComputeMD5" retType="unsigned int *" paramCount="2" desc="Compute MD5 hash code, returns static int[4] (16 bytes)">
<Param type="unsigned char *" name="data" desc="" />
<Param type="const unsigned char *" name="data" desc="" />
<Param type="int" name="dataSize" desc="" />
</Function>
<Function name="ComputeSHA1" retType="unsigned int *" paramCount="2" desc="Compute SHA1 hash code, returns static int[5] (20 bytes)">
<Param type="unsigned char *" name="data" desc="" />
<Param type="const unsigned char *" name="data" desc="" />
<Param type="int" name="dataSize" desc="" />
</Function>
<Function name="ComputeSHA256" retType="unsigned int *" paramCount="2" desc="Compute SHA256 hash code, returns static int[8] (32 bytes)">
<Param type="unsigned char *" name="data" desc="" />
<Param type="const unsigned char *" name="data" desc="" />
<Param type="int" name="dataSize" desc="" />
</Function>
<Function name="LoadAutomationEventList" retType="AutomationEventList" paramCount="1" desc="Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS">
@ -1325,7 +1325,7 @@
<Function name="SetGesturesEnabled" retType="void" paramCount="1" desc="Enable a set of gestures using flags">
<Param type="unsigned int" name="flags" desc="" />
</Function>
<Function name="IsGestureDetected" retType="bool" paramCount="1" desc="Check if a gesture have been detected">
<Function name="IsGestureDetected" retType="bool" paramCount="1" desc="Check if a gesture has been detected">
<Param type="unsigned int" name="gesture" desc="" />
</Function>
<Function name="GetGestureDetected" retType="int" paramCount="0" desc="Get latest detected gesture">
@ -1409,6 +1409,17 @@
<Param type="float" name="radius" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawCircleV" retType="void" paramCount="3" desc="Draw a color-filled circle (Vector version)">
<Param type="Vector2" name="center" desc="" />
<Param type="float" name="radius" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawCircleGradient" retType="void" paramCount="4" desc="Draw a gradient-filled circle">
<Param type="Vector2" name="center" desc="" />
<Param type="float" name="radius" desc="" />
<Param type="Color" name="inner" desc="" />
<Param type="Color" name="outer" desc="" />
</Function>
<Function name="DrawCircleSector" retType="void" paramCount="6" desc="Draw a piece of a circle">
<Param type="Vector2" name="center" desc="" />
<Param type="float" name="radius" desc="" />
@ -1425,18 +1436,6 @@
<Param type="int" name="segments" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawCircleGradient" retType="void" paramCount="5" desc="Draw a gradient-filled circle">
<Param type="int" name="centerX" desc="" />
<Param type="int" name="centerY" desc="" />
<Param type="float" name="radius" desc="" />
<Param type="Color" name="inner" desc="" />
<Param type="Color" name="outer" desc="" />
</Function>
<Function name="DrawCircleV" retType="void" paramCount="3" desc="Draw a color-filled circle (Vector version)">
<Param type="Vector2" name="center" desc="" />
<Param type="float" name="radius" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawCircleLines" retType="void" paramCount="4" desc="Draw circle outline">
<Param type="int" name="centerX" desc="" />
<Param type="int" name="centerY" desc="" />
@ -1561,7 +1560,7 @@
<Param type="int" name="segments" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawRectangleRoundedLinesEx" retType="void" paramCount="5" desc="Draw rectangle with rounded edges outline">
<Function name="DrawRectangleRoundedLinesEx" retType="void" paramCount="5" desc="Draw rectangle lines with rounded edges outline">
<Param type="Rectangle" name="rec" desc="" />
<Param type="float" name="roundness" desc="" />
<Param type="int" name="segments" desc="" />
@ -1574,6 +1573,14 @@
<Param type="Vector2" name="v3" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawTriangleGradient" retType="void" paramCount="6" desc="Draw triangle with interpolated colors (vertex in counter-clockwise order!)">
<Param type="Vector2" name="v1" desc="" />
<Param type="Vector2" name="v2" desc="" />
<Param type="Vector2" name="v3" desc="" />
<Param type="Color" name="c1" desc="" />
<Param type="Color" name="c2" desc="" />
<Param type="Color" name="c3" desc="" />
</Function>
<Function name="DrawTriangleLines" retType="void" paramCount="4" desc="Draw triangle outline (vertex in counter-clockwise order!)">
<Param type="Vector2" name="v1" desc="" />
<Param type="Vector2" name="v2" desc="" />
@ -1590,7 +1597,7 @@
<Param type="int" name="pointCount" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawPoly" retType="void" paramCount="5" desc="Draw a regular polygon (Vector version)">
<Function name="DrawPoly" retType="void" paramCount="5" desc="Draw a polygon of n sides">
<Param type="Vector2" name="center" desc="" />
<Param type="int" name="sides" desc="" />
<Param type="float" name="radius" desc="" />
@ -1698,7 +1705,7 @@
<Param type="Vector2" name="p4" desc="" />
<Param type="float" name="t" desc="" />
</Function>
<Function name="GetSplinePointBezierQuad" retType="Vector2" paramCount="4" desc="Get (evaluate) spline point: Quadratic Bezier">
<Function name="GetSplinePointBezierQuadratic" retType="Vector2" paramCount="4" desc="Get (evaluate) spline point: Quadratic Bezier">
<Param type="Vector2" name="p1" desc="" />
<Param type="Vector2" name="c2" desc="" />
<Param type="Vector2" name="p3" desc="" />
@ -1726,7 +1733,7 @@
<Param type="float" name="radius" desc="" />
<Param type="Rectangle" name="rec" desc="" />
</Function>
<Function name="CheckCollisionCircleLine" retType="bool" paramCount="4" desc="Check if circle collides with a line created betweeen two points [p1] and [p2]">
<Function name="CheckCollisionCircleLine" retType="bool" paramCount="4" desc="Check if circle collides with a line created between two points [p1] and [p2]">
<Param type="Vector2" name="center" desc="" />
<Param type="float" name="radius" desc="" />
<Param type="Vector2" name="p1" desc="" />
@ -1797,7 +1804,7 @@
<Function name="LoadImageFromTexture" retType="Image" paramCount="1" desc="Load image from GPU texture data">
<Param type="Texture2D" name="texture" desc="" />
</Function>
<Function name="LoadImageFromScreen" retType="Image" paramCount="0" desc="Load image from screen buffer and (screenshot)">
<Function name="LoadImageFromScreen" retType="Image" paramCount="0" desc="Load image from screen buffer (screenshot)">
</Function>
<Function name="IsImageValid" retType="bool" paramCount="1" desc="Check if an image is valid (data and parameters)">
<Param type="Image" name="image" desc="" />
@ -1990,7 +1997,7 @@
</Function>
<Function name="ImageColorContrast" retType="void" paramCount="2" desc="Modify image color: contrast (-100 to 100)">
<Param type="Image *" name="image" desc="" />
<Param type="float" name="contrast" desc="" />
<Param type="int" name="contrast" desc="" />
</Function>
<Function name="ImageColorBrightness" retType="void" paramCount="2" desc="Modify image color: brightness (-255 to 255)">
<Param type="Image *" name="image" desc="" />
@ -2105,7 +2112,15 @@
<Param type="Rectangle" name="rec" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="ImageDrawRectangleLines" retType="void" paramCount="4" desc="Draw rectangle lines within an image">
<Function name="ImageDrawRectangleLines" retType="void" paramCount="6" desc="Draw rectangle lines within an image">
<Param type="Image *" name="dst" desc="" />
<Param type="int" name="posX" desc="" />
<Param type="int" name="posY" desc="" />
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="ImageDrawRectangleLinesEx" retType="void" paramCount="4" desc="Draw rectangle lines within an image with extended parameters">
<Param type="Image *" name="dst" desc="" />
<Param type="Rectangle" name="rec" desc="" />
<Param type="int" name="thick" desc="" />
@ -2118,7 +2133,7 @@
<Param type="Vector2" name="v3" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="ImageDrawTriangleEx" retType="void" paramCount="7" desc="Draw triangle with interpolated colors within an image">
<Function name="ImageDrawTriangleGradient" retType="void" paramCount="7" desc="Draw triangle with interpolated colors within an image">
<Param type="Image *" name="dst" desc="" />
<Param type="Vector2" name="v1" desc="" />
<Param type="Vector2" name="v2" desc="" />
@ -2248,7 +2263,7 @@
<Param type="float" name="rotation" desc="" />
<Param type="Color" name="tint" desc="" />
</Function>
<Function name="DrawTextureNPatch" retType="void" paramCount="6" desc="Draws a texture (or part of it) that stretches or shrinks nicely">
<Function name="DrawTextureNPatch" retType="void" paramCount="6" desc="Draw a texture (or part of it) that stretches or shrinks nicely">
<Param type="Texture2D" name="texture" desc="" />
<Param type="NPatchInfo" name="nPatchInfo" desc="" />
<Param type="Rectangle" name="dest" desc="" />
@ -2415,7 +2430,7 @@
<Param type="float" name="fontSize" desc="" />
<Param type="Color" name="tint" desc="" />
</Function>
<Function name="DrawTextCodepoints" retType="void" paramCount="7" desc="Draw multiple character (codepoint)">
<Function name="DrawTextCodepoints" retType="void" paramCount="7" desc="Draw multiple characters (codepoint)">
<Param type="Font" name="font" desc="" />
<Param type="const int *" name="codepoints" desc="" />
<Param type="int" name="codepointCount" desc="" />
@ -2501,7 +2516,7 @@
<Param type="char *" name="dst" desc="" />
<Param type="const char *" name="src" desc="" />
</Function>
<Function name="TextIsEqual" retType="bool" paramCount="2" desc="Check if two text string are equal">
<Function name="TextIsEqual" retType="bool" paramCount="2" desc="Check if two text strings are equal">
<Param type="const char *" name="text1" desc="" />
<Param type="const char *" name="text2" desc="" />
</Function>
@ -2696,23 +2711,23 @@
<Param type="Vector3" name="endPos" desc="" />
<Param type="float" name="startRadius" desc="" />
<Param type="float" name="endRadius" desc="" />
<Param type="int" name="sides" desc="" />
<Param type="int" name="slices" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawCapsule" retType="void" paramCount="6" desc="Draw a capsule with the center of its sphere caps at startPos and endPos">
<Param type="Vector3" name="startPos" desc="" />
<Param type="Vector3" name="endPos" desc="" />
<Param type="float" name="radius" desc="" />
<Param type="int" name="slices" desc="" />
<Param type="int" name="rings" desc="" />
<Param type="int" name="slices" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawCapsuleWires" retType="void" paramCount="6" desc="Draw capsule wireframe with the center of its sphere caps at startPos and endPos">
<Param type="Vector3" name="startPos" desc="" />
<Param type="Vector3" name="endPos" desc="" />
<Param type="float" name="radius" desc="" />
<Param type="int" name="slices" desc="" />
<Param type="int" name="rings" desc="" />
<Param type="int" name="slices" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="DrawPlane" retType="void" paramCount="3" desc="Draw a plane XZ">
@ -3003,7 +3018,7 @@
<Param type="const unsigned char *" name="fileData" desc="" />
<Param type="int" name="dataSize" desc="" />
</Function>
<Function name="IsWaveValid" retType="bool" paramCount="1" desc="Checks if wave data is valid (data loaded and parameters)">
<Function name="IsWaveValid" retType="bool" paramCount="1" desc="Check if wave data is valid (data loaded and parameters)">
<Param type="Wave" name="wave" desc="" />
</Function>
<Function name="LoadSound" retType="Sound" paramCount="1" desc="Load sound from file">
@ -3012,16 +3027,16 @@
<Function name="LoadSoundFromWave" retType="Sound" paramCount="1" desc="Load sound from wave data">
<Param type="Wave" name="wave" desc="" />
</Function>
<Function name="LoadSoundAlias" retType="Sound" paramCount="1" desc="Create a new sound that shares the same sample data as the source sound, does not own the sound data">
<Function name="LoadSoundAlias" retType="Sound" paramCount="1" desc="Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data">
<Param type="Sound" name="source" desc="" />
</Function>
<Function name="IsSoundValid" retType="bool" paramCount="1" desc="Checks if a sound is valid (data loaded and buffers initialized)">
<Function name="IsSoundValid" retType="bool" paramCount="1" desc="Check if a sound is valid (data loaded and buffers initialized)">
<Param type="Sound" name="sound" desc="" />
</Function>
<Function name="UpdateSound" retType="void" paramCount="3" desc="Update sound buffer with new data (default data format: 32 bit float, stereo)">
<Param type="Sound" name="sound" desc="" />
<Param type="const void *" name="data" desc="" />
<Param type="int" name="sampleCount" desc="" />
<Param type="int" name="frameCount" desc="" />
</Function>
<Function name="UnloadWave" retType="void" paramCount="1" desc="Unload wave data">
<Param type="Wave" name="wave" desc="" />
@ -3029,7 +3044,7 @@
<Function name="UnloadSound" retType="void" paramCount="1" desc="Unload sound">
<Param type="Sound" name="sound" desc="" />
</Function>
<Function name="UnloadSoundAlias" retType="void" paramCount="1" desc="Unload a sound alias (does not deallocate sample data)">
<Function name="UnloadSoundAlias" retType="void" paramCount="1" desc="Unload sound alias (does not deallocate sample data)">
<Param type="Sound" name="alias" desc="" />
</Function>
<Function name="ExportWave" retType="bool" paramCount="2" desc="Export wave data to file, returns true on success">
@ -3095,7 +3110,7 @@
<Param type="const unsigned char *" name="data" desc="" />
<Param type="int" name="dataSize" desc="" />
</Function>
<Function name="IsMusicValid" retType="bool" paramCount="1" desc="Checks if a music stream is valid (context and buffers initialized)">
<Function name="IsMusicValid" retType="bool" paramCount="1" desc="Check if a music stream is valid (context and buffers initialized)">
<Param type="Music" name="music" desc="" />
</Function>
<Function name="UnloadMusicStream" retType="void" paramCount="1" desc="Unload music stream">
@ -3107,7 +3122,7 @@
<Function name="IsMusicStreamPlaying" retType="bool" paramCount="1" desc="Check if music is playing">
<Param type="Music" name="music" desc="" />
</Function>
<Function name="UpdateMusicStream" retType="void" paramCount="1" desc="Updates buffers for music streaming">
<Function name="UpdateMusicStream" retType="void" paramCount="1" desc="Update buffers for music streaming">
<Param type="Music" name="music" desc="" />
</Function>
<Function name="StopMusicStream" retType="void" paramCount="1" desc="Stop music playing">
@ -3127,11 +3142,11 @@
<Param type="Music" name="music" desc="" />
<Param type="float" name="volume" desc="" />
</Function>
<Function name="SetMusicPitch" retType="void" paramCount="2" desc="Set pitch for a music (1.0 is base level)">
<Function name="SetMusicPitch" retType="void" paramCount="2" desc="Set pitch for music (1.0 is base level)">
<Param type="Music" name="music" desc="" />
<Param type="float" name="pitch" desc="" />
</Function>
<Function name="SetMusicPan" retType="void" paramCount="2" desc="Set pan for a music (-1.0 left, 0.0 center, 1.0 right)">
<Function name="SetMusicPan" retType="void" paramCount="2" desc="Set pan for music (-1.0 left, 0.0 center, 1.0 right)">
<Param type="Music" name="music" desc="" />
<Param type="float" name="pan" desc="" />
</Function>
@ -3146,7 +3161,7 @@
<Param type="unsigned int" name="sampleSize" desc="" />
<Param type="unsigned int" name="channels" desc="" />
</Function>
<Function name="IsAudioStreamValid" retType="bool" paramCount="1" desc="Checks if an audio stream is valid (buffers initialized)">
<Function name="IsAudioStreamValid" retType="bool" paramCount="1" desc="Check if an audio stream is valid (buffers initialized)">
<Param type="AudioStream" name="stream" desc="" />
</Function>
<Function name="UnloadAudioStream" retType="void" paramCount="1" desc="Unload audio stream and free memory">
@ -3183,7 +3198,7 @@
<Param type="AudioStream" name="stream" desc="" />
<Param type="float" name="pitch" desc="" />
</Function>
<Function name="SetAudioStreamPan" retType="void" paramCount="2" desc="Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)">
<Function name="SetAudioStreamPan" retType="void" paramCount="2" desc="Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right)">
<Param type="AudioStream" name="stream" desc="" />
<Param type="float" name="pan" desc="" />
</Function>

View File

@ -202,7 +202,7 @@ int main(int argc, char *argv[])
{
if (argc > 1) ProcessCommandLine(argc, argv);
const char *raylibhPath = "../src/raylib.h\0";
const char *raylibhPath = "../../src/raylib.h\0";
const char *raylibapiPath = "raylib_api.txt\0";
const char *rlapiPath = "RLAPI\0";
if (inFileName[0] == '\0') MemoryCopy(inFileName, raylibhPath, TextLength(raylibhPath) + 1);
@ -1154,7 +1154,7 @@ static void ProcessCommandLine(int argc, char *argv[])
else if (IsTextEqual(argv[i + 1], "JSON\0", 5)) outputFormat = JSON;
else if (IsTextEqual(argv[i + 1], "XML\0", 4)) outputFormat = XML;
else if (IsTextEqual(argv[i + 1], "LUA\0", 4)) outputFormat = LUA;
else if (IsTextEqual(argv[i + 1], "CODE\0", 4)) outputFormat = CODE;
else if (IsTextEqual(argv[i + 1], "CODE\0", 5)) outputFormat = CODE;
}
else printf("WARNING: No format parameters provided\n");
}

View File

@ -1,7 +1,7 @@
IDI_APP_ICON ICON "rlparser.ico"
1 VERSIONINFO
FILEVERSION 5,5,0,0
PRODUCTVERSION 5,5,0,0
FILEVERSION 6,0,0,0
PRODUCTVERSION 6,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
@ -11,7 +11,7 @@ BEGIN
VALUE "FileDescription", "rlparser | raylib header API parser"
VALUE "FileVersion", "1.0"
VALUE "InternalName", "rlparser"
VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria (@raysan5)"
VALUE "LegalCopyright", "(c) 2026 Ramon Santamaria (@raysan5)"
VALUE "OriginalFilename", "rlparser"
VALUE "ProductName", "rlparser"
VALUE "ProductVersion", "1.0"