This guide walks you through setting up your development environment and compiling this project on Windows, macOS, and Ubuntu/Debian.
- Git
- CMake (3.14+)
- C++ Compiler (GCC, Clang, or MSVC)
- OpenGL-compatible GPU
1. Download and install the appropriate 64-bit version from the MSYS2 website.
Not
MSYS,UCRT, orCLANG.
pacman -Syu
# Restart terminal if prompted
pacman -Supacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-make gitgit clone https://github.com/BurnCan/OpenGLProjectTemplate
cd OpenGLProjectTemplatemkdir build && cd build
cmake -G "MinGW Makefiles" ..
mingw32-makecd bin
./OpenGLApp.exe1. Install Homebrew using the install script from the Homebrew website
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Post-installation steps When you install Homebrew, it prints some directions for updating your shell’s config. If you don’t follow those directions, Homebrew will not work.
You need to update your shell’s config file (which file exactly depends on your shell, for example ~/.bashrc or ~/.zshrc) to include this:
eval "$(<Homebrew prefix path>/bin/brew shellenv)"Replace with the directory where Homebrew is installed on your system. You can find Homebrew’s default install location in this FAQ entry.
brew install cmake gitgit clone https://github.com/BurnCan/OpenGLProjectTemplate
cd OpenGLProjectTemplate
mkdir build && cd build
cmake ..
makecd bin/OpenGLApp.app/Contents/MacOS
./OpenGLApp
sudo apt update
sudo apt install build-essential cmake git libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-devgit clone https://github.com/BurnCan/OpenGLProjectTemplate
cd OpenGLProjectTemplate
mkdir build && cd build
cmake ..
makecd bin
./YourAppExecutableNamepacman -S mingw-w64-x86_64-glfw mingw-w64-x86_64-glew mingw-w64-x86_64-glm mingw-w64-x86_64-imguiIf you're using FetchContent in CMake, these are not required.
OpenGLProjectTemplate/
├── shaders/
├── src/
├── CMakeLists.txt
├── README.md
└── build/
└── bin/
├── shaders/
└── OpenGLApp.exe
Happy coding! 🎮