First version of the engine was written using OpenGL. However I decided to move to Vulkan due to two reasons. Developing on macOS is very limited - currently it supports only up to version 4.1 of OpenGL. Second reason is that I like to have more control over what is happening, therefore Vulkan suits my needs more.
To build and run this project correctly, you need to install the Vulkan SDK and configure the environment variables on your system.
First, install the Vulkan SDK from LunarG Vulkan SDK.
-
Set the environment variables:
-
VULKAN_SDK→ path to your Vulkan SDK installation, e.g.:C:\VulkanSDK\1.4.321.0 -
Add the Vulkan
bindirectory to yourPATH:C:\VulkanSDK\1.4.321.0\bin
-
-
Restart your terminal to apply the changes.
-
Set the environment variables in your shell configuration file (
~/.zshrcor~/.bash_profile):export VULKAN_SDK=PATH_TO_VULKAN_SDK export DYLD_LIBRARY_PATH=$VULKAN_SDK/lib:$DYLD_LIBRARY_PATH export VK_ICD_FILENAMES=$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json export VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d export PATH=$VULKAN_SDK/bin:$PATH -
Apply the changes:
source ~/.zshrc # or source ~/.bash_profile
On Windows the project includes a setup.bat script that prepares a build folder and generates a Visual Studio solution.
-
Open PowerShell or Command Prompt.
-
Change into the project root if necessary:
cd path\to\project
-
Run the setup script:
.\setup.bat- The script will generate a
builddirectory and create a.slnfile (Visual Studio solution) insidebuild. - Wait for the script to finish. If it fails, check the console output for missing tools or permissions.
- The script will generate a
-
Open the solution:
- In File Explorer, navigate to
build\and double-click the generated*.slnfile. - Or from the command line:
start build\YourSolution.sln
- In File Explorer, navigate to
-
Build and run inside Visual Studio:
- Select the configuration (Debug/Release) and platform (x86/x64) as appropriate.
- Build the solution (Build → Build Solution) and run (Debug → Start Debugging or Start Without Debugging).
Notes:
- If you need a clean rebuild, delete the
buildfolder and re-runsetup.bat.
On macOS the repository provides build.sh and run.sh.
- Open Terminal and change to the project root:
cd /path/to/project - Make sure the scripts are executable (first time only):
chmod +x ./build.sh ./run.sh
- Build:
- Normal build:
./build.sh
- Clean:
The
./build.sh --clean
--cleanflag performs a full clean.
- Normal build:
- Release build:
The
./build.sh --release
--releaseflag instructs the build script to produce optimized/release artifacts (instead of debug builds).
- Run:
./run.sh
./run.sh --release
run.shwill execute the produced binary (or start the app) using the artifacts in thebuilddirectory. Pass--releaseto run the artifacts produced by a--releasebuild.