Raylib
Raylib (stylized as raylib) is a cross-platform open-source software development library. The library was made to create graphical applications and games.[3][4] The library is designed to be suited for prototyping, tooling, graphical applications, embedded systems, and education. The source code is written in the C programming language (specifically using C99), which is distributed under a zlib/libpng OSI certified open-source license. It supports compilation to several target platforms, including Windows, Linux, macOS, FreeBSD, Android, Raspberry Pi and HTML5. raylib has been ported to more than 70 programming languages in the form of bindings,[5] but many of these ports are not stable.[6] History
raylib development was started in August 2013 by Ramon Santamaria to support a game development course, focused on students with no previous coding experience and artistic profile. During the course, raylib was further developed based on the feedback of the students and by June 2014, the library was starting to be showcased in several game development events in Barcelona. raylib 1.0 was released in November 2013 and it featured around 80 functions for window and inputs management, basic 2D and 3D shape drawing, texture loading and drawing, font loading, text drawing, audio system management and audio file loading and playback. The first raylib version had eight subsequent minor releases (from raylib 1.1 to raylib 1.8), over the course of five years, which each introduced some new features. Some of the most notable improvements were Android, WebAssembly and Raspberry Pi support, multiple OpenGL backends, VR support and ten examples. raylib 2.0 was released in July 2018 and removed all external dependencies from the build system. It also exposed a number of configuration options in the build system, to minimize size and increase support, supporting various continuous integration systems. Along the following two years, parts of the library were reviewed updated, and the ecosystem was built out. During this period, a single minor release, raylib 2.5, was launched. raylib 3.0 was released in April 2020, refactoring many parts of the code to improve portability and bindings. It involved moving global variables to contexts, added support for custom memory allocators, a filesystem for loading assets and over 115 code examples. It received a minor update, raylib 3.5, in December 2020. raylib 4.0 was released in November 2021, featuring a complete naming review for library consistency and coherency: function names, parameters, descriptions, comments and log output messages were reviewed. It added an internal Events Automation System and exposed game-loop control for the user. It also features some of its internal libraries to be used as standalone modules: rlgl and raymath. raylib 4.2 was released in August 2022.[7] raylib 4.5 was released in March 2023, 7 months after the last release. This update brought ANGLE support on Desktop platforms, a brand new camera module, support for M3D models and M3D/GLTF animations, compatibility with the QOA audio file format, a brand new module for compressed textures loading (rl_gputex), reviews in the rlgl and the rshapes modules, data structures validation ( raylib 5.0 was released in November 2023, improving support for future platform ports.[8] raylib 5.5 was released in November 2024. Featuresraylib offers the following features:[9][10]
ExampleThis is a simple example that creates a window with text, given on the GitHub page of Raylib. #include "raylib.h"
int main(void) {
InitWindow(800, 450, "raylib [core] example - basic window");
while (!WindowShouldClose()) {
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
}
CloseWindow();
return 0;
}
Reception and adoptionAs of January 2024,[update] GitHub lists around 900 projects matching the Software architectureModules![]() raylib consists of several modules that are exposed to the programmer through the API.
Bindingsraylib has bindings for more than 70 different programming languages, created by various language communities. Computer programming languages that are updated to the latest version include: C#, Crystal, D (Dlang), Fortran, Go, Jai, Java, Lua, Nim, Python, Rust, V (Vlang), and Zig. There is also a C++ wrapper for users of C++ who prefer a less C-like, more C++-idiomatic usage, and also can be imported as a C++ module.[13] A list of bindings is available in the BINDINGS.md file[5] in the raylib GitHub repository. Example using raylib-cppThe following is the same as the earlier example, using the C++ bindings from raylib-cpp. import raylib;
using raylib::Texture;
using raylib::Window;
using namespace raylib::Colors;
int main(int argc, char* argv[]) {
constexpr int SCREEN_WIDTH = 800;
constexpr int SCREEN_HEIGHT = 450;
Window window(SCREEN_WIDTH, SCREEN_HEIGHT, "raylib [core] example - basic window");
Texture logo("raylib_logo.png");
window.SetTargetFPS(60);
while (!window.ShouldClose()) {
window.BeginDrawing();
window.ClearBackground(RAYWHITE);
raylib::DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
logo.Draw(
SCREEN_WIDTH / 2 - logo.GetWidth() / 2,
SCREEN_HEIGHT / 2 - logo.GetHeight() / 2
);
window.EndDrawing();
}
return 0;
}
Add-onsThe raylib community has contributed several add-ons to extend the features and connection of raylib with other libraries. Some of the modules are:
Awards
See alsoReferences
External links
|