Adding ImGui to the OpenGL and Vulkan renderers
To use ImGui in our code, we need a couple of files from the ImGui GitHub repository at https://github.com/ocornut/imgui
Download the following files to a folder named imgui:
imconfig.himgui.cppimgui.himgui_draw.cppimgui_internal.himgui_tables.cppimgui_widgets.cppimstb_rectpack.himstb_textedit.himstb_truetype.h
These downloaded files are the backend-independent code, containing the implementations of the widgets. We have to include them in our project for ImGui to work in general.
For the GLFW input backend, two additional files are required. Download these two files and put them into the imgui folder:
imgui_impl_glfw.cppimgui_impl_glfw.h
To include the GLFW backend, this line will be needed:
#include <imgui_impl_glfw.h>
You can find the code for this section in the chapter05 folder’s 01_opengl_ui subfolder for OpenGL and 05_vulkan_ui...