The open source C based cross platform game library/framework raylib just released version 4. This is the first major update since the 3.7 release in April, raylib 4 is a major update and should be considered a LTS or Long Term Stable release. One of the great things about raylib is the large number of programming language bindings available and with raylib 4, Odin and Zig have joined the party. Another strength of the raylib framework is it is very modular and decoupled in nature and that aspect has improved even more with the 4.0 release.
Other highlights of the raylib 4 release include:
- Naming consistency and coherency:
raylibAPI has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e.
struct GlyphInfo). Output log messages have been also improved to show more info to the users. Several articles have been written in this process: raylib_syntax analysis and raylib API usage analysis. In general, a big polishing of the library to make it more consistent and coherent.
- Event Automation System: This new experimental feature has been added for future usage, it allows to record input events and re-play them automatically. This feature could be very useful to automatize examples testing but also for tutorials with assisted game playing, in-game cinematics, speed-runs, AI playing and more! Note this feature is still experimental.
- Custom game-loop control: As requested by some advance users, the game-loop control can be exposed compiling raylib with the config flag:
SUPPORT_CUSTOM_FRAME_CONTROL. It’s intended for advance users that want to control the events polling and also the timing mechanisms of their games.
rlgl 4.0: This module has been completely decoupled from platform layer and raylib, now
rlglsingle-file header-only library only depends on the multiple OpenGL backends supported, even the dependency on
raymathhas been removed. Additionally, support for OpenGL 4.3 has been added, supporting compute shaders and Shader Storage Buffer Objects (SSBO). Now
rlglcan be used as a complete standalone portable library to wrap several OpenGL version and providing a simple and easy-to-use pseudo-OpenGL immediate-mode API.
raymath 1.5: This module has been reviewed and some new conventions have been adopted to make it more portable and self-contained:
- Functions are self-contained, no function use other raymath function inside, required code is directly re-implemented
- Functions input parameters are always received by value
- Functions use always a “result” variable for return
- Angles are always in radians (
RAD2DEGmacros provided for convenience)
raygui 3.0: The official raylib immediate-mode gui library (included in
raylib/src/extras) has been updated to a new version, embedding the icons collection and adding mulstiple improvements. It has been simplified and constrained for a better focus on its task: provide a simple and easy-to-use immediate-mode-gui library for small tools development.
raylib_parser: Added new tool to parse
raylib.hand tokenize its enums, structs and functions, extracting all required info (name, params, descriptions…) into custom output formats (TXT, XML, JSON…) for further processing. This tool is specially useful to automatize bindings generation. Hopefully, this tool will make life easier to binding creators to update their bindings for raylib 4.0 or adding new ones!
- Zig and Odin official support for raylib: Those two new amazing programming languages are officially supporting raylib,
Ziglists raylib as an official example for C interoperatibility and Odin officially supports raylib as a vendor library. Both languages also have several bingings to raylib. Additionally, Zig build system supported has been added to compile raylib library and examples.
You can learn more about the raylib 4 release in the video below.