Rendering on-screen graphs with ImGui and ImPlot
In the previous recipe, we learned how to create immediate mode drawing facilities in Vulkan with basic drawing functionality. That 3D canvas was rendered on top of a 3D scene sharing a view-projection matrix with it. In this recipe, we will continue adding useful debugging features to our framework and learn how to implement pure 2D line drawing functionality. It is possible to implement such a class in a way similar to LineCanvas3D
. However, we already use the ImGui library in our apps as described in the Rendering ImGui user interface recipe. Let’s put it to use to render our 2D lines.
Getting ready
We recommend revisiting the Rendering ImGui user interfaces and Implementing an immediate-mode 3D drawing canvas recipes to get a better grasp of how a simple Vulkan drawing canvas can be implemented.
How to do it...
What we need at this point essentially boils down to decomposing a 2D chart or graph into a set of lines and rendering...