Summary here.
- C++17 compiler. I used the
Ubuntu clang version 17.0.5 (++20231114093837+98bfdac5ce82-1~exp1~20231114093938.66)but 16 should work fine. - CMake 3.22 or higher. I used
3.26.4. - A build system. I'm using Ninja, but you can use Unix Makefiles if you want.
The original tutorial installs dependencies using development library packages. This is a quick start, but you lose control over your dependency versions. I decided to manage the dependencies explicitly, but automatically, using CMake.
To set up your development environment, follow these steps:
- Download and extract the Vulkan SDK. I used version
1.3.268.0. - Follow the SDK installation steps.
git clone https://github.com/Pacheco95/khronos-vulkan-tutorial-cppcd khronos-vulkan-tutorial-cpp- (Optional)
bun installor npm, pnpm, yarn, etc. This will configure git hooks to automatically format the source code before commits. - Build the project:
# Generate build files
mkdir build && cd build
# This will download all dependencies to build/_deps directory
cmake -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_CXX_COMPILER=clang++-17 -G "Ninja Multi-Config" -S .. -B .
# Build
cmake --build . --target KhronosVulkanTutorialHpp --config Debug -j 4 # Replace 4 with your CPU core count
# Run
./Debug/KhronosVulkanTutorialHppIf you did set up the SDK correctly, you'll see a message:
VULKAN_SDK found at <your install location>
-
Moved
GLM_FORCE_RADIANSandGLM_FORCE_DEPTH_ZERO_TO_ONEincludes to -
Deleted
#define GLFW_INCLUDE_VULKANsince it imports thevulkan.hand we are now usingvulkan.hpp