This a very simple and basic Vulkan rendering framework / library that abstracts some of the Vulkan objects and functions using C++14 in one project without any unecessary submodules / libraries. It was supposed to make my life developing simple Vulkan applications easier, but don't expect too much from it. Use as you like according to the MIT LICENSE.
- A C++14-capable compiler.
- CMake for building.
- GLFW for OS window and surface handling.
- Vulkan SDK for Vulkan.
- glslangValidator for compiling GLSL shaders to SPIR-V.
- Navigate to the vsvr folder, then:
mkdir build && cd build
cmake ..
make -j $(grep -c '^processor' /proc/cpuinfo 2>/dev/null)
- Must: Install the "C/C++ extension" by Microsoft.
- Recommended: If you want intellisense functionality install the "C++ intellisense" extension by austin.
- Must: Install the "CMake Tools" extension by vector-of-bool.
- Restart / Reload Visual Studio Code if you have installed extensions.
- Open the vsvr folder using "Open folder...".
- Choose "Unspecified" as your active CMake kit if asked. It then should be autodetected correctly.
- You should be able to build now using F7 and build + run using F5.
-
Clone the library as a submodule to your project:
git submodule add https://github.com/HorstBaerbel/vsvr vsvr
-
Adjust your CMakeLists.txt:
- Include the library subdirectory in your project:
add_subdirectory(vsvr)
- Add shader compilation:
set(SHADER_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/shaders")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/vsvr")
include(compile_shaders REQUIRED)
(here your shaders will be read and written to "./shaders") - Add a dependency to shader compilation to your project:
add_dependencies(<YOUR_PROJECT> shaders)
- Add the library to your projects include paths:
target_include_directories(<YOUR_PROJECT> PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/vsvr")
- Make sure the library is linked to your project:
target_link_libraries(<YOUR_PROJECT> vsvr)
- Include the library subdirectory in your project: