shvulkan pre-release
by mrsinho.
|
shvulkan is a lightweight and flexible wrapper around the VulkanĀ® API written completely in C, that makes it easier to work with graphics efficiently without writing thousands of lines of code.
Scene example: alfa blending, instancing and indexed draw calls example.
Headless scene example using vulkan-virtual-outputs: alfa blending, instancing and indexed draw calls also here, but the images are streamed in an http server.
The examples are frequently being tested on Windows 11, NixOS (with Nix flake), Linux Mint (virtual machine and pc) with different compilers (MSVC, gcc), hardware configurations (RX580 4GB GDDR5, Radeon V Carrizo 500MB) and windowing systems (Win32, X11, Wayland).
Open the terminal and run the following commands:
Be sure to have installed the official VulkanĀ® SDK from LunarG, then run the following commands:
On Debian and similar distribution before building the project you first need to install some packages:
Now run these commands to build:
Tested on X11 and Wayland graphics servers. The Nix flake lets the system choose the default windowing system.
CMake Target | Type | Configure Flags |
---|---|---|
shvulkan | library | / |
shvulkan-docs | Doxygen outputs | SH_VULKAN_BUILD_DOCS=ON |
shvulkan-clear-color | executable | SH_VULKAN_BUILD_EXAMPLES=ON |
shvulkan-scene | executable | SH_VULKAN_BUILD_EXAMPLES=ON |
shvulkan-compute-example | executable | SH_VULKAN_BUILD_EXAMPLES=ON |
If the cmake option SH_VULKAN_BUILD_EXAMPLES is enabled, the additional glfw target will be generated as a static library.
CMake Variable | About |
---|---|
SH_VULKAN_VERSION | Version of the shvulkan library |
SH_VULKAN_ROOT_DIR | Absolute path to the root of the repository directory |
SH_VULKAN_LIB_DIR | Absolute path to the output library directory |
SH_VULKAN_BIN_DIR | Absolute path to the output executable directory |
To link to the shvulkan library with CMake:
Then, include the shVulkan.h header file:
shvulkan ships with one compute example, one graphics clear color example, one graphics scene example and a headless scene graphics example, which instead of presenting images to the screen it streams the graphics output with an http server.