Skip to content
/ RaylibGameTemplate Public template

This is the general-purpose raylib project template in C++.

License

Notifications You must be signed in to change notification settings

itsYakub/RaylibGameTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raylib Game Template 🎮

Overview:

This is the general-purpose raylib project template in C++.

Prerequesites:

Setup

1. Build For Desktop:

  • Pull all the necessary submodules:
git submodule update --init
  • Create a binary diretory:
mkdir bin
cd bin
  • Use the following command:
cmake ..

2. Build For WEB:

  • Pull all the necessary submodules:
git submodule update --init
  • Go to the emscripten submodule:
cd lib/emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ../..
  • Create a binary diretory:
mkdir bin
cd bin
  • Use the following commands:
emcmake cmake .. -DPLATFORM=Web
emmake make

(WARNING: if those commands returns an error, make sure that your project is set correctly: directory relations are correct, path to the shell file is correct, path to the resources is correct, resources directory exists etc.)

  • To test your final executable (*.html, *.json, *.wasm, *.data, *.mem) you can use the following command:
emrun ./{game_title}.html

NOTE: This CMake workflow is managed from the position of the binary directory; if you want to use CMake from the main project's directory, modify the CMake file respectively (mainly: --shell-file and --preload-file).

Credits

Licence

This template is originally under the MIT Licence, but you can modify it to suite your needs. You can use licenses/license-templates to get the free licence template.