https://github.com/itsyakub/raylibgametemplate
This is the general-purpose raylib project template in C++.
https://github.com/itsyakub/raylibgametemplate
game game-development gamedev madewithraylib raylib raylib-game template template-project template-repository
Last synced: 3 months ago
JSON representation
This is the general-purpose raylib project template in C++.
- Host: GitHub
- URL: https://github.com/itsyakub/raylibgametemplate
- Owner: itsYakub
- License: mit
- Created: 2024-04-03T07:13:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-11T07:18:34.000Z (about 1 year ago)
- Last Synced: 2025-01-14T05:48:26.858Z (5 months ago)
- Topics: game, game-development, gamedev, madewithraylib, raylib, raylib-game, template, template-project, template-repository
- Language: CMake
- Homepage:
- Size: 22.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Raylib Game Template 🎮
## Overview:
This is the general-purpose raylib project template in C++.## Prerequesites:
- **[Git;](https://git-scm.com/)**
- **[CMake;](https://cmake.org/)**
- **[Build system of your choosing;](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id7)**## Setup
### 1. Build For Desktop:
- Pull all the necessary **submodules**:
```bash
git submodule update --init
```
- Create a **binary diretory**:
```bash
mkdir bin
cd bin
```
- Use the **following command**:
```cmake
cmake ..
```
### 2. Build For WEB:
- Pull all the necessary **submodules**:
```bash
git submodule update --init
```
- Go to the **emscripten submodule**:
```bash
cd lib/emsdk
```
- **Install and activate** the emsdk following the **[Installation Instruction](https://emscripten.org/docs/getting_started/downloads.html#installation-instructions-using-the-emsdk-recommended)**:
```bash
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ../..
```
- Create a **binary diretory**:
```bash
mkdir bin
cd bin
```
- Use the **following commands**:
```bash
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**:
```bash
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
- **[Raylib CMake project](https://github.com/raysan5/raylib/tree/master/projects/CMake)**
- **[github/gitignore](https://github.com/github/gitignore)**
- **[gitattributes/gitattributes](https://github.com/gitattributes/gitattributes)**
- **[licenses/license-templates](https://github.com/licenses/license-templates)**## Licence
This template is originally under the **[MIT Licence](https://github.com/itsYakub/RaylibGameTemplate/blob/main/LICENCE)**, but you can modify it to suite your needs. You can use **[licenses/license-templates](https://github.com/licenses/license-templates)** to get the free licence template.