This repo is ideal for new Raylib projects using C++ and Visual Studio Code.
Raylib is a simple and easy-to-use library to enjoy videogames programming.
Note: Raylib is low level and flexible. Its not a full game engine.
Read the full C++ Gaming — 01 — Overview Medium article about this repo.
Image 1 - Raylib Programming Library
If you enjoy this content or you find it useful, please share it, and please add a Star.
Follow these steps to get started on your computer (e.g. Windows, Mac, Linux).
- Install Prerequisites, all steps, including ...
- Install Visual Studio Code & Extension(s)
- Install C++ Libraries
- Open the command line
- Run each of the following command(s).
- Run
gcc --version - Run
g++ --version - Run
gdb --version - Run
mingw32-make --version
- Run
- Optional: Any failures? Ensure each is in your Windows System Path Variables, watch this video, and repeat previous step(s)
- Done!
- Setup Environment per above
- Download this repo (ZIP or GIT). Unzip as needed
- Open Visual Studio Code & its Terminal Window
- Run each of the following command(s). Any failures? Repeat previous steps
- Run
mingw32-make setup
- Run
- Enjoy!
- Setup Project per above
- Open Visual Studio Code and its Terminal Window
- Run each of the following command(s). Any failures? Repeat previous steps
- Run
mingw32-make bin/app && mingw32-make execute
- Run
- Optional & Recommended: Add keyboard shortcut
- Enjoy!
- Open Visual Studio Code
- Open Visual Studio Code's Explorer Window
- Double-click on the
Main.cppfile - Edit the
Main.cppfile - Repeat Build Project's previous steps
- Enjoy!
This repo demonstrates best practices for combining C++ technologies for game development using Raylib. Use cases for this repo include light-weight prototypes, educational projects, and commercial game development.
It is specifically for use in Visual Studio Code.
Here is the status and roadmap of features.
| Coding Standards | Project Structure | C++ IntelliSense | C++ Compilation | Hot Reloading | Unit Testing | CI/CD | |
|---|---|---|---|---|---|---|---|
| raylib-cpp-project-template | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
Image 2 - Editor Environment (File Explorer, Terminal, Code Editor)
Image 3 - Runtime Environment (Game Window)
Documentation
ReadMe.md- The primary documentation for this repoRaylib/documentation/- More info specific to the project
Configuration
Raylib/Makefile- C++ build configuration file
Structure
Raylib- Main project folderRaylib/src/assets/- User-facing game assetsRaylib/src/scripts/tests/- Add unit testing files hereRaylib/src/scripts/client/- Add runtime files hereRaylib/src/scripts/client/Main.cpp- Main file for game logic. Do your work here :)
Dependencies
Raylib/vendor/- Lists vendor as dependencies...
| Name | Description | In Repo? | In Steps Above? |
|---|---|---|---|
| Visual Studio Code | Source code editor | ❌ | ✅ |
| Visual Studio Code C++ Extension | IntelliSense, debugging, and code browsing | ❌ | ✅ |
| C++ Libraries | Including compilers for C++ | ❌ | ✅ |
| Raylib | Simple and easy-to-use library | ✅ | ❌ |
This Raylib C++ Template Project is focused on Raylib, a simple and easy-to-use library to enjoy videogames programming.
However for more power, checkout rBitrage. rBitrage (aka "Arbitrage" aka "Bit Rage") is a custom C++ 2D/3D game engine built on Raylib.
rBitrage is easy to learn, easy to use, and hard to misuse.
How do they these major options compare?
| Raylib 2D/3D |
Game Editor | Game Engine | Actors | Systems | Lifecycle | Camera | Input Mapping | Loader | |
|---|---|---|---|---|---|---|---|---|---|
| rBitrage | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Raylib | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
Here are some resources which may be helpful with C++ and game development.
- C++ Gaming — 01 — Overview
- C++ Gaming — 02 — Raylib Project Template
- C++ Gaming — 03 — The rBitrage Game Engine
- Raylib
- Raylib Cheatsheet ← Start here :)
- Raylib Documentation
- Raylib Examples & Raylib Games
Created By
- Samuel Asher Rivello
- Over 25 years XP with game development (2024)
- Over 11 years XP with Unity (2024)
Contact
- Twitter - @srivello
- Git - Github.com/SamuelAsherRivello
- Resume & Portfolio - SamuelAsherRivello.com
- LinkedIn - Linkedin.com/in/SamuelAsherRivello <--- Say Hello! :)
License
Provided as-is under MIT License | Copyright ™ & © 2006 - 2024 Rivello Multimedia Consulting, LLC



