Raylib

Raylib#

raylib is a simple library for video game programming.

Installation#

  1. Download the latest raylib-*_win64_mingw-w64.zip (not *msvc*) from the releases.

  2. Unpack it to the directory where you store your projects and rename it, so you can reach the directory using ../raylib from your projects.

brew install raylib

Available as raylib, e.g.,

pacman -S raylib

Running#

  1. Create a new project and paste the basic window example in your main.c.

  2. 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 brew installs the library, explicitly providing library path using -L .. may be required.

    Include -lraylib as follows:

     "args": [
      "'@compile_flags.txt'",
      "-lraylib",
    
  3. Only on Windows (and maybe MacOS):

    Add the include path to your compile_flags.txt, for example for Windows:

    -I../raylib/include
    
  4. On Windows, the CodeLLDB debugger cannot start the program. Workaround: Use build and run tasks.

    A game window should open up as shown on the examples page.

Troubleshooting

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.