Raylib#
raylib is a simple library for video game programming.
Installation#
Download the latest
raylib-*_win64_mingw-w64.zip(not*msvc*) from the releases.Unpack it to the directory where you store your projects and rename it, so you can reach the directory using
../raylibfrom your projects.
brew install raylib
Available as raylib, e.g.,
pacman -S raylib
Running#
Create a new project and paste the basic window example in your
main.c.Include the following arguments in your
.vscode/tasks.json:"args": [ "'@compile_flags.txt'", "-lmsvcrt", "-lraylib", "-lgdi32", "-lwinmm", "-L../raylib/lib",
Warning
Was not tested on MacOS. Dependent on where
brewinstalls the library, explicitly providing library path using-L ..may be required.Include
-lraylibas follows:"args": [ "'@compile_flags.txt'", "-lraylib",
Only on Windows (and maybe MacOS):
Add the include path to your
compile_flags.txt, for example for Windows:-I../raylib/include
On Windows, the CodeLLDB debugger cannot start the program. Workaround: Use
buildandruntasks.A game window should open up as shown on the examples page.
Symptom: Compilation errors on Windows Solution: You may have to add additional libraries to link against. Refer to raysan5/raylib#4846
Symptom: The game window does not open. Solution: Your graphics card drivers may not have 3D acceleration support.