danilw / nanovg-vulkan-glfw-integration-demo

Example code from Vulkan-tutorial Depth buffering modified adding NanoVG integration. Using C++ and GLFW.
MIT License
2 stars 0 forks source link
nanovg vulkan

Note 2024:

This is old, before https://github.com/danilw/nanovg_vulkan/pull/7 in nanovg_vulkan repo. Im not going to update this to new.

__

nanovg-vulkan-glfw-integration-demo

What is it - this project show Vulkan NanoVG integration to custom render pass, using glfw.

NanoVG Vulkan port github link - nanovg_vulkan

Remember this is not GUI example, NanoVG is UI rendering library

Contact: Join discord server


To launch - copy builded binary to example folder(or launch when this folder is current as on build example commands below). Because required fonts and images/shaders to load.


Example description:

MAX_FRAMES_IN_FLIGHT - supported and nanovg rendered in multiple frames, screenshot below with 600+fps from 2 frames in flight.

example_vulkan_glfw_integration.cpp - this is example code from Vulkan-tutorial Depth buffering modified adding NanoVG integration.

Look at this commit 5bdb27f to see code changes from original C++ tutorial code.

Hotkey 3 to show/hide nanovg for example.

About RenderPass integration - copy paste code from integration examples above after your vkCmdEndRenderPass (or before vkCmdBeginRenderPass) and everything should work.


Build:

(use cmake to build on Windows, Windows/Linux supported and tested)

git clone https://github.com/danilw/nanovg-vulkan-glfw-integration-demo
cd nanovg-vulkan-glfw-integration-demo/example
mkdir build
cd build
cmake ../
make
cd ../
./build/example-vk_glfw_integration

Screenshot:

nvgvk