raylib

A simple and easy-to-use library to enjoy videogames programming. No fancy interface, no visual helpers, no auto-complete — just coding in the most pure spartan way.

C99 zlib/libpng v5.5 14 Platforms
22K+
GitHub Stars
140+
Code Examples
60+
Language Bindings
14
Target Platforms
A C Library for Videogames Programming

raylib is a free, open-source C programming library designed for building 2D and 3D games, graphical tools, and multimedia applications. Created by Ramon Santamaria in 2013, it has grown from a simple teaching tool into one of the most-used indie game development libraries in the world.

Unlike engines like Unity or Godot, raylib is not an engine. It's a library — a set of functions you call from your own code. There's no editor, no GUI, no scene tree. You write C (or one of 60+ language bindings), call raylib functions, and compile. That's it.

raylib is inspired by Borland BGI graphics lib and by XNA framework. It was originally intended as a tool for teaching game programming to students, but it has evolved far beyond that into a seriously capable multimedia library used by hobbyists, indie developers, and professionals alike.

Your First raylib Program

raylib is famously simple to get started with. Here's a complete, working program:

// hello_raylib.c — 8 lines of actual code
#include "raylib.h"

int main(void)
{
    InitWindow(800, 450, "raylib — hello world");
    SetTargetFPS(60);

    while (!WindowShouldClose())
    {
        BeginDrawing();
            ClearBackground(RAYWHITE);
            DrawText("Hello, raylib!", 340, 200, 20, DARKGRAY);
        EndDrawing();
    }

    CloseWindow();
    return 0;
}

Compile with gcc hello_raylib.c -lraylib -lm -o hello on Linux. That's a window with text rendering, a game loop, and proper shutdown in under 20 lines. No boilerplate, no class hierarchies, no initialization wizards.

What You Can Build
raylib shapes example
2D Shapes
Rectangles, circles, triangles, lines, polygons
raylib 3D models
3D Models
OBJ/GLTF loading, cameras, lighting
raylib shader effects
Shader Effects
Custom GLSL shaders, post-processing
raylib textures
Textures & Sprites
Image loading, sprite animation, atlases
raylib text rendering
Text & Fonts
TTF/OTF loading, SDF fonts, Unicode
raylib first person camera
First-Person 3D
3D cameras, collision, raycasting
Core Capabilities
🎮
2D & 3D Rendering
Shapes, sprites, models, cameras, lighting, billboard rendering. Full OpenGL 3.3+ or ES 2.0 backend.
🖼️
Textures & Images
PNG, BMP, TGA, JPG, GIF, QOI, DDS, HDR, KTX, ASTC, PKM. GPU compression, mipmaps, render textures.
🔤
Text & Fonts
TTF/OTF loading, SDF fonts, bitmap fonts, Unicode support, measurement, and wrapping.
🔊
Audio
WAV, OGG, MP3, FLAC, XM, MOD. Streaming, multi-channel, audio processing callbacks.
🕹️
Input
Keyboard, mouse, gamepad, touch. Multi-touch gestures: tap, double-tap, hold, drag, swipe, pinch.
Shaders
Custom GLSL vertex and fragment shaders, post-processing pipeline, uniform management.
📦
3D Model Formats
OBJ, IQM, GLTF, VOX, M3D. Skeletal animation, mesh generation, material system.
🌐
Cross-Platform
Windows, Linux, macOS, Android, iOS, Raspberry Pi, Web (Emscripten), and more.
🧩
60+ Language Bindings
Python, Go, Rust, Zig, Lua, C#, Java, Ruby, Nim, Odin, V, and many more.
Dive Deeper