Skip to content

A base setup raylib game with a slimmed raylib submodule (my own). Basically a boilerplate for raylib games

Notifications You must be signed in to change notification settings

lishacodesgames/Raylib-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raylib-CMake-Template

Minimal game template using raylib as a git submodule and CMake.
This repository is intended to be used as a starting point for a new raylib project

How to Clone

git clone --recursive to get the raylib submodule local

If you forgot:
git submodule update --init --recursive after regular git clone

Project Structure

What your project architecture should ideally look like for the CMakeLists.txt I've included (Can change accordingly, otherwise)

‖
‖——CMakeLists.txt
‖——src/
‖  ‖——main.cpp
‖  ‖——*.cpp  → all other source files
‖——raylib/   → your raylib engine (submodule)

Build (MinGW Example)

mkdir build cd build
cmake --preset Debug OR cmake --preset Release -- (configuration of cmake)
cmake --build --preset Debug OR cmake --build --preset Release -- (compilation + build of your files, only what has changed since last build)

Executable will appear in build/ under preset name

Add New Source Files

Put any new .cpp or .c files in src/
Update CMakeLists.txt as needed, example:

add_executable(YourProjectName
  src/main.cpp
  src/other_file.cpp
)

Updating raylib (the submodule)

cd raylib
git pull
cd ..
git commit -a -m "Update raylib"

Requirements

  • CMake 3.20+
  • C++17 compiler
  • MinGW / MSVC / Clang
  • Ninja (not required, but it's what the presets use)

About

A base setup raylib game with a slimmed raylib submodule (my own). Basically a boilerplate for raylib games

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published