From 7a8f40a1b742957c150cb50fe9321cf3c48ba72c Mon Sep 17 00:00:00 2001 From: austin Date: Wed, 6 Mar 2024 21:35:42 -0500 Subject: [PATCH] imgui documentation --- docs/src/architecture/ui/imgui.md | 30 ++++++++++++++++++++++++++++++ docs/src/architecture/ui/uiarch.md | 3 ++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 docs/src/architecture/ui/imgui.md diff --git a/docs/src/architecture/ui/imgui.md b/docs/src/architecture/ui/imgui.md new file mode 100644 index 00000000..8c2ec1cb --- /dev/null +++ b/docs/src/architecture/ui/imgui.md @@ -0,0 +1,30 @@ +@page imgui ImGUI + +ImGui is a library for drawing immediate mode debug ui elements that are extremely pretty and quick to work with. +It has been included with this engine to facilitate faster debugging of all parts of the engine. + + +# Architecture +## Library Structure +Almost all functions called from the library are static calls from specific classes like ImPlot. + +## Engine Structure +The principle class is ImGuiWindow which acts as a container for other ui elements. +These windows are registered to the RenderingEngine via addImGuiWindow(). +The RenderingEngine loops through every window it has registered and renders them one after another. + +## Initialization +The imgui library is initialized at the same time as the glfw window and is attached to it by the window pointer. + +## Main Loop +The main logic for imgui is at the tail and of the main render function in RenderEngine. +It loops through every in-engine top level imgui container and calls immediate mode functions to construct the ui. + + +# Usage Examples +## Creating a window +As soon as you call this, it should immediately start rendering this window. +``` +ImGuiWindow imGuiWindow = new ImGuiWindow("Frametime Graph"); +RenderingEngine.addImGuiWindow(imGuiWindow); +``` diff --git a/docs/src/architecture/ui/uiarch.md b/docs/src/architecture/ui/uiarch.md index 72f99366..7fdf4350 100644 --- a/docs/src/architecture/ui/uiarch.md +++ b/docs/src/architecture/ui/uiarch.md @@ -1,3 +1,4 @@ @page uiarch UI Architecture -TODO \ No newline at end of file +[TOC] + - @subpage imgui \ No newline at end of file