A downloadable tool for Windows

Download NowName your own price

raylib is a simple and easy-to-use library to enjoy videogames programming.

NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helper... just coding in the most pure spartan-programmers way.

Are you ready to learn? Jump to code examples!.

NOTE: raylib is being developed and maintained with big effort by Ray (that's me!). If you like the library and you enjoy it, consider contributing to the project through GitHub Sponsorsraylib Patreon or just donating on downloading.


  • NO external dependencies, all required libraries are included in raylib
  • Multiplatform: Windows, Linux, macOS, RPI, Android, HTML5... and more!
  • Written in plain C code (C99) in PascalCase/camelCase notation
  • Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3 or ES 2.0)
  • Unique OpenGL abstraction layer (usable as standalone module): rlgl
  • Multiple Fonts formats supported (XNA fonts, AngelCode fonts, TTF)
  • Outstanding texture formats support (including 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)
  • Shaders support, including Model shaders and Postprocessing shaders
  • Powerful math module for Vector, Matrix and Quaternion operations: raymath
  • Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC...)
  • VR stereo rendering support with configurable HMD device parameters
  • Huge examples collection with +120 code examples!
  • Bindings to +50 programming languages!

Wanna see all functions available in raylib? Check Cheatsheet

Looking for binaries for a different platform? Check GitHub official release page for precompiled library binaries for multiple platforms and compilers!

raylib is open-source and free to use. View license.


Download NowName your own price

Click download now to get access to the following files:

raylib 4.0 Windows Installer (with TCC compiler) 34 MB
raylib 4.0 Windows Installer (with Zig compiler) 69 MB
raylib 4.0 Windows Installer (with MinGW compiler) 69 MB

Development log


Log in with itch.io to leave a comment.

Viewing most recent comments 1 to 40 of 56 · Next page · Last page

Massive kudos, raysan. This framework is amazing and I'm extremely impressed with how much it can do. You're awesome, keep up the good work!


Thank you very much Zed! Glad you like it! :D

Hello, for my new game I want to use new things for me, rayLib and zig. Have you got a basic example written in zig with build.zig ? I am trying same way as SDL but I always an error at first rayLib command "initWindow". build.zig in zip package don't seem to help :)  (sorry for my poor english)

hey i'm very new to coder/programing games could this tool help me get better or should i find another tools to help me get better then come back to this

This tool is a C programming library, there is no visual interface, just coding in a text editor, it's recommended that you have some previous C language knowledge to use it.

does it support tiled maps


Tile maps is up to the user, raylib is a low level library, it supports textures drawing and also drawing a part of a texture, it could be used to draw tilemaps.

Seriously one of the best small game frameworks ever released. Simple, fast, and pretty damn elegant.

Well done raysan!


Thank you very much! Glad you like it! 😄

Hi Ray,

I've found an issue with the audio system. If an application uses audio and there is no audio device plugged into the computer, the application will crash. I've tried this on multiple devices and it always occurs. I also tried fixing this by using a try-catch block but this didn't work.

Raylib Version: Raylib 3.5.

Language: C++ 

Pleease, could you open an issue on raylib github repo for review?

While opening an issue on the Github page, I tested the newest version of Raylib and it seems this problem does not happen anymore, so I haven't submitted the issue. 

Oh, nice! raylib usually improves from version to version.


"improves from version to version"
wow I had no ideas that tihgns cen impov, uneleik me grammaer

When I install raylib 4.0 with tcc, I get raylib 2.0-dev instead.

I verified the file and it's actually raylib 4.0, how did you notice it was raylib 2.0-dev?

(1 edit)

It says so in the logging when I start up my game plus TextFormat and mp3 files were suddenly unsupported (I upgraded from 3.0).

I wanted to upgrade, because I made a small game that is basically done, but I suddenly noticed that the game crashes, when I play a sound that is loaded as number 11 or above (I have tried switching around and removing sounds). I recall it working before, but I must be wrong.

(1 edit)

I don't know where could be the problem. Did you had a previous raylib version installed? I recommend you remove previous raylib version and try installing it again. Idouble verified the TCC installer and it is raylib 4.0, it installs the library and it compiles the examples as expected with raylib 4.0. You can also join raylib Discord and ask there, in case anyone has found a similar issue.

I now have tried to remove the old installation before installing the new. The same has happened, but honestly, I would rather use another compiler, so I can debug and get better error messages. It was just the first install option that would actually work for me.


Hi Ray, I am having trouble setting up raylib for vscode. I have tried to do many things to solve this by myself but had no luck. im on windows 10


i downloaded raylib_4.0.0_win64_mingw-win64

my compiler is mingw32 with gcc

i want to use raylib with c++17

Here are some of the things i tried:

- I added the include and lib directory of raylib4.0 to my system path (PATH)

- I also added them to the include directory of my compiler.

-the compiler picked up the raylib.h file but when compiled, it just returns many undefined references to raylib's functions such as InitWindow()

Thanks in advance Ray

i could send a sample code.

You can check raylib Wiki for instructions: https://github.com/raysan5/raylib/wiki/Using-raylib-in-VSCode 

You can also join raylib Discord for some help, there is a specific channel (raylib-setup) for problems with setup configurations.

Hi! Can you show me an example of how to use functions SaveFileData and LoadFileData to store something on the hard drive? Or is there example for that already? I couldn't find...

How powerful/fast is Raylib? Is it possible to have more complex 3d scenes as the examples show ? The framework looks very nice and simple, but is that at the expense of performance


raylib is a thin layer over OpenGL, it should be quite performant but I recommend profiling it first to see if it fits your needs.

(1 edit)

Ok thanks for your fast reply. I'll have a look at it :D

I've seen a library release on a platform other than GitHub for the first time. Hehe

Hola ray.

Ya se que me dijistes que entrara en discord,pero ya entre hace tiempo y todo el mundo habla ingles y es demasiado dificil entenderse,tambien me dijistes que usara visual studio pero pide demasiados requisitos para mi ordenar.

Yo suelo usar zinjai pero ni idea de como usarlo con raylib,tal vez podrias crear una plantilla para este ide en una proxima actualizacion.


Tambien probe la plantilla que viene de codeblock y segui las instrucciones de la imagen pero no me funciona,¿alguna solucion?


Hola, pues la mejor solucion es que uses directamente el instalador que te preconfigura un entorno con Notepad++ y MinGW, justamente esta pensado para evitar este tipo de problemas configurando otros entornos. Respecto zinjai, no lo conozco, tendria que aprender como funciona y no tengo tiempo para ponerme con ello.

Es que es lo que llevo usando desde el principio,pero como te comente mas abajo no me deja crear multiples archivos.c con sus archivos de cabecera,me da error a la hora de compilar.

Se ve que la configuracion que trae de serie no enlaza automaticamente varios archivos y solo me deja trabajar con uno solo.

Entonces no se si me he explicado bien,pero quiero trabajar con multiples archivos de c y sus archivos de cabecera y ahora mismo el notepad++ solo me deje trabajar con uno solo.

¿Alguna forma de configurar las opciones de f6 para que compile multiples archivos? 

Hola Ray.

He estado intentando usar c++ con raylib pero me da algun problema,si instancio una clase sin puntero no hay problema pero si hago esto.

Jugador *jugador = new Jugador;

Me da error.

cc1plus.exe: warning: command line option '-std=c99' is valid for C/ObjC but not for C++

basicos22-imagenes-clases.cpp: In function 'int main()':

basicos22-imagenes-clases.cpp:39:14: warning: unused variable 'jugador2' [-Wunused-variable]

     Jugador *jugador2 = new Jugador;

C:\Users\usuario\AppData\Local\Temp\cc42TACp.o:basicos22-imagenes-clases.cpp:(.text.startup+0x68): undefined reference to `operator new(unsigned int)'

C:\Users\usuario\AppData\Local\Temp\cc42TACp.o:basicos22-imagenes-clases.cpp:(.text.startup+0xfe): undefined reference to `operator delete(void*, unsigned int)'

C:\Users\usuario\AppData\Local\Temp\cc42TACp.o:basicos22-imagenes-clases.cpp:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'

collect2.exe: error: ld returned 1 exit status

Supongo que sera porque habra que configurar el compilador para c++,en realidad no lo se pero me gustaria saber que se puede hacer para usar c++,sobre todo c++11,14 y 17.


Tienes que usar un compilador de C++. Yo te recomiendo utilizar Visual Studio.


Tengo otra pregunta,he estado haciendo una prueba separando el codigo en un archivo.c y otro.h,pero como no lo he hecho nunca con c pues estoy teniendo problemas.

El archivo.h tiene esto:

//prototipo de programacion de jugador

#ifndef JUGADOR_H

#define JUGADOR_H

#include "raylib.h"

typedef struct Jugador{

    int x,y;

    Color color;

    Texture2D imagen;


void cargarTextura();

void actualizar();

void pintar();

void descargarTextura();


Y el archivo.c tiene esto:

//programacion de jugador

#include "jugador.h"


Jugador jugador;

jugador.x = 280;

jugador.y = 380;

jugador.color = WHITE;

void cargarTextura(){

    jugador.imagen = LoadTexture("jugador.png");


void actualizar(){


        jugador.x -= 5;

    }else if(IsKeyDown(KEY_RIGHT)){

        jugador.x += 5;



void pintar(){



void descargarTextura(){



En el archivo del main incluyo el .h y intento llamar a alguna funcion pero me da error.

C:\Users\usuario\AppData\Local\Temp\ccgfCdVf.o:basico27-objeto.c:(.text.startup+0x37): undefined reference to `cargarTextura'

collect2.exe: error: ld returned 1 exit status

¿Que es lo que estoy haciendo mal?

Pues asi a primera vista no lo se... Para este tipo de consultas te recomiendo que entres al Discord de raylib.


Hello Ray! I love raylib and decided to checkout its design. But I am having a hard time understanding the architecture of rlgl. In my understanding, rlgl allocate a big vertex buffer, after every rlVertex call, it will be add to the vertex buffer and render to the screen. Is that correct ?

Hi Fakeley! Glad you like raylib! :D

About rlgl, it's an abstraction layer over several OpenGL versions, actually, it tries to implement an pseudo-OpenGL 1.1 immediate mode over other OpenGL versions (2.1, 3.3, ES 2.0). rlgl initializes a set of vertex buffers to accumulate vertex on every rlVertex*() call, once there is an internal state change request (texture change, shader change...), buffers are flushed, launching all registered draw calls, and the process starts again.

Ahh, I see. Thank you !

Hello Ray! I want to asked that if raylib limited to 1 window per game only?

Yes, by default it's limited to one window but I think there is some closed GitHub Issue with sample code to support multiple windows.

Thank you! I will check it out!

Is RFXR included with this? I was gonna redownload it today but couldn't find it anymore. Thanks!

Sorry, what do you mean? I don't know what is RFXR...

(1 edit)

Oh ok, I thought you made RFXR. I thought I remember it used Raylib. It was like BFXR sound effect generator but better imo.

Oh, do you mean rFXGen?

Yes! Thank you! It's been a while so I couldn't remember the name exactly.

Hello Rayson,

I just want to say that I really admire your work. I'm yet to be accepted to a university, but my dream is to become a software engineer. Looking at raylib's source and documentation really inspired me. In my future professional career I wish to be able to design software as sound as raylib. 

Thank you very much! Glad you like raylib! A lot of work has been put on it! :D

Hello Raysan,

A quick question. What is the generally used approach to importing a 2D tile map into Raylib? Is a .png file the usual approach where everything is hard coded in or can software like tiles be used and if so, how?

You can use Tiled TMX format: https://github.com/OnACoffeeBreak/raylib_tiled_import_with_tmx

Thanks Ray! Really helpful and thanks for the quick reply!

Hi ray, i'm doing some 3D modelling and i'm looking at the examples on the raylib home page. most of them include this line 

model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture;

but MATERIAL_MAP_DIFFUSE does not seem to be existing in raylib 3.5, what should i use instead?

It was changed for upcoming raylib 3.7, you can just use MAP_DIFFUSE.

Hi ray, every time I compile my raylib project it just logs too much stuff to my terminal, is there a way I could disable that?

I think you can use: SetTraceLogLevel(LOG_NONE)

Thanks! It worked

Hola Ray.

¿Para cuando estara el soporte para software?,la version 3.5 no lo trae asi que sigo sin poder usarla en condiciones.

Yo lo que hago es usar este archivo "opengl32.dll",que creo que emula el soporte por opengl ,pero me va muy lento raylib.

Estara listo para la proxima version o todavia queda mucho.Saludos y a cuidarse en estos momentos complicados.

Antes de que se me olvide,lei algo sobre que estabas preguntando si la gente queria que hicieras tutoriales.A mi si me gustaria que los hicieras,pero seria mejor escritos,de esta manera los puedo traducir con el traductor de google.

En realidad el soporte de render por software ya esta disponible, solo para 2d, usando las funciones `ImageDraw*()` para dibujar sobre imagenes. De momento esta asi. Sobre los tutoriales, me gustaria hacerlo pero prefiero invertir mi tiempo libre en otras cosas.

Vale,pues he estado probando la version 3.5 y he probado el ejemplo mas basico que trae,el core_basic_window y no me funciona.

Luego he ido a raylib_source_compile para ver si hay alguna opcion para compilar por software y no he visto nada,solo he visto:

SET GRAPHIC_API=GRAPHICS_API_OPENGL_33,aqui puedo pone 11 o 21 o 33 pero... para software no veo nada,me puedes decir que hay que hacer para compilar para software porque no tengo ni idea.

Solo usa funciones ImageDraw*() en vez de las otras.

Siento ser tan pesado pero no he conseguido nada.

ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); 

No entiendo los paramentros de esta funcion,puedes poner un pequeño codigo donde cargas la imagen y la muestras,despues lo pruebo y veo si funciona.

El objetivo de estas funciones es dibujar sobre una imagen, el sistema de visionado depende del usuario, raylib no tiene esa funcionalidad. Este ejemplo utiliza estas funciones: https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_d...

Si esperas activar render por software y que se haga un blit automatico a una window, esa funcionalidad no esta en raylib ni creo que se añada.

Deleted 1 year ago

raylib already works with C++ but you can also use raylib-cpp.

Has anyone a good tutorial series about making a plattformer

I don't know any tutorial but probably a good start could be checking raylib core_2d_camera_platformer example


It helped a lot

In raylib.h, the comment after the definition of BLEND_CUSTOM says “Belnd textures using custom src/dst factors (use SetBlendModeCustom())”. However, I could not find the definition of the function SetBlendModeCustom(). Where is SetBlendModeCustom() defined? I am using raylib 3.5.0 installed with vcpkg.

Hi! I'm afraid that comment was wrong, I already reviewed it. The function to use is rlSetBlendMode(), that is not exposed by raylib but internal to rlgl, you can use it just including rlgl.h.

I’ll try to use rlSetBlendMode(). Thank you for your prompt reply.

Hola Ray,no se podria hacer raylib compatible con direct3d 9 o software.

Mi ordenador es viejo y trae una grafica integrada que no soporta opengl y no puedo usar raylib.

raylib soporta OpenGL 1.1, si tu ordenador es posterior a 1992, raylib deberia funcionar pero debes recompilar la libreria: https://github.com/raysan5/raylib/wiki/Working-on-Windows#build-raylib-using-mak...

Añadir soporte para Direct3D no esta planeado pero la opcion de software rendering esta en proceso (solo para 2d).

Estuve probando lo que comenta el enlace que me pasastes,sobre lo de hacerlo desde la linea de comandos es algo que no suelo usar nunca y no me manejo muy bien pero lo intente y no consegui nada.

Luego lo intente hacer desde el script raylib_source_compile en el archivo raylib.h pero me daba errores al compilar,pero igualmente luego fui al ejemplo que se abre con el notepad++ al principio y lo volvi a compilar con raylib_source_compile y raylib_compile_execute y me da errores.

Estube buscando la forma de ver que opengl soporta mi ordenador y probe el programa GPU_Caps_Viewer,me diice que soporta OpenGL 1.1 (2 ext) - GDI Generic,la tarjeta es Mobile Intel(R) 965 Express Chipset Family,GMA X3100 (rev:  C).

El contralador que uso es la ultima version que salio,por lo que no se puede actualizar.

Hi can someone guide me on how to get raylib working on Visual Studio 2019

please help me

you can use provided project in raylib/projects/VS2017, it should work ok with VS2019

Is there a guide I can use to set this up with Clion? Clion uses cmake if it helps.

raylib Wiki has several IDE configuration guides: https://github.com/raysan5/raylib/wiki Unfortunately not for CLion... feel free to add it.


Does anyone have any good tutorials for setting this up with Visual Studio Code?

You can check raylib Wiki: https://github.com/raysan5/raylib/wiki

Awesome, thanks!

(1 edit)

After downloading and following the Android build steps for template/simple_game mingw32-make PLATFORM=PLATFORM_ANDROID is failing.  Here is the full error.

Any help would be greatly appreciated.  I started work on a mobile game in raylib and would love to get it building on android. 


Hi btrap! I answered in the reddit post! 😄

you are my hero

Hey i sent you a message on reddit.  Which is the best place to send questions?

Actually, best place is raylib Discord, there is a big community that can help.

Deleted 1 year ago

you probably need to use string.c_str()

Deleted 1 year ago

Hi Ray

Been trying to compile raylib on Linux (using gcc compiler) for 3 weeks now and I'm totally frustrated at not being to do it because of the undefined references related to glfw even though my compile command line links in library  libglfw.so.

It sure would be great if RayLib fans could download the library file raylib.so and avoid all the frustration of trying to compile raylib from source code

Would really like to get raylib up and running but I need file raylib.so file



You can download the release version of the library for most platform from raylib GitHub release page: https://github.com/raysan5/raylib/releases

Many thanks Ray.. I followed your lead and downloaded libraylib.so

Then did :

gcc EX.c -fmax-errors=1000 -lGL -L./libraylib -L./libglfw -o a.exe

where libraylib.so and libglfw.so are in same folder as EX.c and

EX.c is identical to  your website example file for:

raylib [shapes] example - draw circle sector (with gui options)
*   This example has been created using raylib 2.5 (www.raylib.com

BUT I still get tons of 'undefined references' 

 ...What am I doing wrong ??

I recommend you ask on raylib Discord forum, it's easier to track the issue than here.

(1 edit)

idk if you still have this issue but how it have it set up is:
libraylib.a is lib/
raylib.h in include/
and i have the main.c file in the source/ folder

and from the build/ bolder i run this
gcc -static -static-libgcc -static-libstdc++ ../source/** -o game.exe -O2 -Wall -Wno-missing-braces -I ../include/ -L ../lib/ -lraylib -lopengl32 -lgdi32 -lwinmm -mwindows
(the same thing works on c++ just replace gcc with g++)

Deleted 1 year ago

i recommend MinGW but it doesn't really matter to my knowledge

Hi Ray, i got a problem running core_basic_window.c. After reserching, i define the support busy wait loop and then build the file core.h with opengl 1.1.When i excute the core-basic-window.c, It gives me these errors:

C:\Users\ADMIN\AppData\Local\Temp\ccseYXAl.o:core_basic_window.c:(.text.startup+0x26): undefined reference to `InitWindow'
C:\Users\ADMIN\AppData\Local\Temp\ccseYXAl.o:core_basic_window.c:(.text.startup+0x32): undefined reference to `SetTargetFPS'
C:\Users\ADMIN\AppData\Local\Temp\ccseYXAl.o:core_basic_window.c:(.text.startup+0x37): undefined reference to `WindowShouldClose'
C:\Users\ADMIN\AppData\Local\Temp\ccseYXAl.o:core_basic_window.c:(.text.startup+0x40): undefined reference to `BeginDrawing'
C:\Users\ADMIN\AppData\Local\Temp\ccseYXAl.o:core_basic_window.c:(.text.startup+0x4c): undefined reference to `ClearBackground'
C:\Users\ADMIN\AppData\Local\Temp\ccseYXAl.o:core_basic_window.c:(.text.startup+0x78): undefined reference to `DrawText'
C:\Users\ADMIN\AppData\Local\Temp\ccseYXAl.o:core_basic_window.c:(.text.startup+0x7d): undefined reference to `EndDrawing'
C:\Users\ADMIN\AppData\Local\Temp\ccseYXAl.o:core_basic_window.c:(.text.startup+0x84): undefined reference to `CloseWindow'
collect2.exe: error: ld returned 1 exit status

Any ideas ?

It seems you are not linking with libraylib.a, was the library successfully compiled and libraylib.a generated in raylib/src directory?

Yes, librarylib.a is generated in raylib/src directory

It's a bit difficult to know your specific issue, try asking in raylib Discord forum, there is a lot of friendly people that could help tracking the issue.

Thank you !

When i try it with raylib 2.5.0, it works fine

how do i install it to a drive other than C: ? i don't have a C: drive on my computer. is there an argument i can give to the executable or something?

I'm afraid it's not possible at this moment. You can just grab raylib from github: https://github.com/raysan5/raylib or install to a computer with C: drive and copy [raylib] directory (it's portable) to yours.

Hi! I am having a problem running core_basic_window.c.When i execute the file, it keep saying that raylib has stop working.Can you help me?

Does it compile correctly? It could be related to the GPU, are you using an old computer?

Hi Ray!Thank you for answer!I got that problem because my OpenGL is 1.4, I fixed that.Now i wonder how can i setup on Visual Studio ?Thank you!

Here you have some ready-to-use projects. Also, raylib Wiki contains instructions for setting up raylib with multiple platforms/IDEs.

Thanks alot!

Deleted 2 years ago
(2 edits)

Hi Ray,You’re great one I used Raylib,And it’s really awesome,But can i ask you?

Q1: My laptop using Windows,But with OpenGL 4.5,With Vulkan support(If i’m not wrong)

Can i recompile Raylib,To use OpenGL 4? Or even older versions of OpenGL,For some compatibility?

Q2: Is recompiling Raylib,To use OpenGL 4 can cause problems?

Best Wishes,Rabia


Hi! Glad you like raylib!

A1-A2: raylib uses by default OpenGL 3.3 on desktop platforms, it can be recompiled to OpenGL 2.1 or even OpenGL 1.1 for older platforms (+20 years old platforms). raylib does not support OpenGL 4+ specific features but if you need some of them, you should implement them.

Thank you!!!

When I Try Downloading Mingw it says - Trojan:Win32/Fuery.C!cl

Just downloaded and scanned with Window Defender, no threats found. It could be a false positive from the Antivirus... in any case, you can download source code from github directly and compile raylib yourself: https://github.com/raysan5/raylib

Just packaged the installer again and re-uploaded to avoid that false positive...

Thank You

Hi! how to recompile raylib 3.0 using opengl 2.1

check raylib_source_compile script on Notepad++, line 4

Hi, thank you for fast reply, It seems like I cannot find the directory where "raylib_source_compile" is that on npp directory or raylib directory. sorry I'm complete beginner

that's a compile script in Notepad++, when you press F6, look at the bottom-left dropdown box to select compilation script

Thank you! I found it

Hi! i'm trying to run an older project in the new 3.0 version but i get an error: "fatal error: rlgl.h: No such file or directory" I don't know what te problem is, cause i tried the exact same project in the 2.5 version and it works just fine.

Similar issue with any example that uses another file besides raylib.h.  For example, trying out physics_demo.c gives:

physics_demo.c:22:10: fatal error: physac.h: No such file or directory

I have tried on two separate windows computers.  Ray, any workaround to this?

Okay, reading the header for the physics file it makes more sense.  However, everything with raymath.h isn't working either.


In raylib 3.0 auxiliar libraries are not copied in compiler include path. If you need some auxiliar library just copy them from raylib/src to your user code path. All the used libraries are single-file header-only.


Viewing most recent comments 1 to 40 of 56 · Next page · Last page