Vulkan 2D graphics library
See the codevkvg is an open-source 2D graphics library written in C using Vulkan as backend. The API follows the same pattern as Cairo, but new functions and original drawing mechanics may be added.
vkvg is in alpha development stage and the core api is mostly stabilized. All contributions are welcome.
In progress API documentation is available online at http://vkvg.org.
vkvg_load_font_from_path.if glslc or xxd are not present, a precompiled version of the shaders is stored in the git tree.
#fetch sources from github
git clone --recursive https://github.com/jpbruyere/vkvg.git
cd vkvg
# Create build directory
mkdir build
cd build
# Run CMake configuration
cmake ..
If you work on your own fork of vkvg, due to the relative paths in .gitmodules, you may ends with remote not found if you
didn't fork the submodules as well. To overcome the problem, you may set a fallback url for submodules with the following command:
git config submodule.vkh.url https://github.com/jpbruyere/vkhelpers.git
git config submodule.glutess.url https://github.com/jpbruyere/glutess.git
git config submodule.vkvg-svg.url https://github.com/jpbruyere/vkvg-svg.git
-DVKVG_USE_GLUTESS=true: Use embedded glu tesselator to fill polygones in NON-ZERO mode. If false, a simple ear clipping algorithm is used.-DVKVG_SVG=true: Enable experimental svg renderer. If false, use nanoSVG.-DVKVG_RECORDING=true: Enable experimental draw commands recording infrastructure.-DVKVG_BUILD_DOCS=true: Build documentation if doxygen is found.-DVKVG_ENABLE_VK_SCALAR_BLOCK_LAYOUT=true: Enable VK_EXT_scalar_block_layout that reduce structure padding for gpu.-VKVG_ENABLE_VK_TIMELINE_SEMAPHORE=true: Enable experimental work syncing with VK_KHR_timeline_semaphore instead of Fences.Those libraries are enabled by default, but disabled if not found.
-DVKVG_USE_FONTCONFIG=true: enable FontConfig to resolve font's names.-DVKVG_USE_FREETYPE=true: enable FreeType to render glyphs, if false glyphs are rendered with stb_truetype.-DVKVG_USE_HARFBUZZ=true: enable harfbuzz for text shaping.-DVKVG_BUILD_TESTS=true: build all tests in the tests forlder.-DVKVG_TEST_DIRECT_DRAW=true: enable drawing directly on the swapchain images.If vkvg is compiled with CMAKE_BUILD_TYPE=Debug, several additional options are made available to help debugging:
-DENABLE_VALIDATION=true: enable vulkan validation layer.-DENABLE_DBG_UTILS=true: enable various vulkan debug utils extensions features.-DENABLE_RENDERDOC=true: enable renderdoc layer.-DENABLE_WIRED_FILL=true: enable rendering in wired mode, current mode is controled with the global variable vkvg_wired_debug.-DENABLE_PROFILING=true: add -pg to the compile options.-DVKVG_DBG_STATS=true: store various context statistics fetchable with vkvg_device_get_stats()cmake --build .
A detailed tutorial is available for Windows.
Append the -h option to see available command line parameters.
See the contribution guide for more information.
Join us on matrix for any question.
569 followers · starred Sep 2023
326 followers · starred May 2023
161 followers · starred Sep 2020
1,002 followers · starred Oct 2024
Vulkan 2D graphics library
See the codevkvg is an open-source 2D graphics library written in C using Vulkan as backend. The API follows the same pattern as Cairo, but new functions and original drawing mechanics may be added.
vkvg is in alpha development stage and the core api is mostly stabilized. All contributions are welcome.
In progress API documentation is available online at http://vkvg.org.
vkvg_load_font_from_path.if glslc or xxd are not present, a precompiled version of the shaders is stored in the git tree.
#fetch sources from github
git clone --recursive https://github.com/jpbruyere/vkvg.git
cd vkvg
# Create build directory
mkdir build
cd build
# Run CMake configuration
cmake ..
If you work on your own fork of vkvg, due to the relative paths in .gitmodules, you may ends with remote not found if you
didn't fork the submodules as well. To overcome the problem, you may set a fallback url for submodules with the following command:
git config submodule.vkh.url https://github.com/jpbruyere/vkhelpers.git
git config submodule.glutess.url https://github.com/jpbruyere/glutess.git
git config submodule.vkvg-svg.url https://github.com/jpbruyere/vkvg-svg.git
-DVKVG_USE_GLUTESS=true: Use embedded glu tesselator to fill polygones in NON-ZERO mode. If false, a simple ear clipping algorithm is used.-DVKVG_SVG=true: Enable experimental svg renderer. If false, use nanoSVG.-DVKVG_RECORDING=true: Enable experimental draw commands recording infrastructure.-DVKVG_BUILD_DOCS=true: Build documentation if doxygen is found.-DVKVG_ENABLE_VK_SCALAR_BLOCK_LAYOUT=true: Enable VK_EXT_scalar_block_layout that reduce structure padding for gpu.-VKVG_ENABLE_VK_TIMELINE_SEMAPHORE=true: Enable experimental work syncing with VK_KHR_timeline_semaphore instead of Fences.Those libraries are enabled by default, but disabled if not found.
-DVKVG_USE_FONTCONFIG=true: enable FontConfig to resolve font's names.-DVKVG_USE_FREETYPE=true: enable FreeType to render glyphs, if false glyphs are rendered with stb_truetype.-DVKVG_USE_HARFBUZZ=true: enable harfbuzz for text shaping.-DVKVG_BUILD_TESTS=true: build all tests in the tests forlder.-DVKVG_TEST_DIRECT_DRAW=true: enable drawing directly on the swapchain images.If vkvg is compiled with CMAKE_BUILD_TYPE=Debug, several additional options are made available to help debugging:
-DENABLE_VALIDATION=true: enable vulkan validation layer.-DENABLE_DBG_UTILS=true: enable various vulkan debug utils extensions features.-DENABLE_RENDERDOC=true: enable renderdoc layer.-DENABLE_WIRED_FILL=true: enable rendering in wired mode, current mode is controled with the global variable vkvg_wired_debug.-DENABLE_PROFILING=true: add -pg to the compile options.-DVKVG_DBG_STATS=true: store various context statistics fetchable with vkvg_device_get_stats()cmake --build .
A detailed tutorial is available for Windows.
Append the -h option to see available command line parameters.
See the contribution guide for more information.
Join us on matrix for any question.
569 followers · starred Sep 2023
326 followers · starred May 2023
161 followers · starred Sep 2020
1,002 followers · starred Oct 2024