Rendering ImGui user interfaces
ImGui is a popular bloat-free graphical user interface library for C++ and is essential to the interactive debugging of graphics apps. ImGui integration comes as a part of the LightweightVK library. In this recipe, we go step by step through the code and show how to create an example app with ImGui rendering.
Getting ready
It is recommended to revisit the Using Vulkan descriptor indexing recipe from Chapter 3, and also recall the Vulkan basics described in the other recipes of that chapter.
This recipe covers the source code of lightweight/lvk/HelpersImGui.cpp
. The demo code for this recipe is in Chapter04/01_ImGui
.
How to do it...
Let us start with a minimalistic ImGui demo application and take a look at how to use the ImGui Vulkan wrapper provided by LightweightVK:
- First, we create an
lvk::ImGuiRenderer
object. It takes in a pointer to ourlvk::IContext
, the name of the default font, and the default font size in pixels...