Pong built using C++ and raylib.
- C++ Compiler (GCC, Clang, or MSVC)
- CMake 3.24 or higher (for CMake build)
- GNU Make (for Makefile build)
- VSCode (optional, for VSCode integration)
There are two ways to build this project:
- Install raylib in an
includesfolder in the parent directory:
cd ..
mkdir -p includes
cd includes
git clone https://github.com/raysan5/raylib.git
cd raylib/src
make PLATFORM=PLATFORM_DESKTOP- Open the project in VSCode
- The project includes preconfigured tasks for building:
- Press
Cmd/Ctrl + Shift + Bto build in debug mode - Or use the VSCode command palette to select:
build debug: Builds with debug symbolsbuild release: Builds with optimizationsclean: Removes build artifacts
- Press
The executable will be created in the build directory.
- Configure and build the project:
# Configure
cmake -S . -B build
# Build
cmake --build buildThe executable will be created in build/raylib-game-template/.
- Requires Xcode Command Line Tools
- Additional frameworks are automatically linked (IOKit, Cocoa, OpenGL)
- Requires MinGW or Visual Studio
- Required libraries are automatically linked
- Requires development packages:
# Ubuntu/Debian sudo apt-get install build-essential libgl1-mesa-dev # For X11 sudo apt-get install libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
├── src/ # Source files
│ ├── resources/ # Game resources (images, sounds, etc.)
│ └── main.cpp # Main game file
├── build/ # Build output directory
└── .vscode/ # VSCode configuration
├── tasks.json # Build tasks
└── launch.json # Debug configuration
The project includes VSCode debug configurations for both debug and release builds. To debug:
- Build the project in debug mode
- Press F5 or use the Run and Debug panel in VSCode
- Choose either "Debug" or "Release" configuration
cmake -DPLATFORM=Web -S . -B build
cmake --build build- Compile raylib for web
cd ../includes/raylib/src
make PLATFORM=PLATFORM_WEB- In root of the project
cd src
make PLATFORM=PLATFORM_WEBThis project is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check LICENSE for further details.
