imgui-platform-kit 2.0.0
Cross-platform Dear ImGui application framework
Loading...
Searching...
No Matches
imgui_kit::UserInterface Class Reference

Main application object: owns the platform window, the rendering backend and the registered UserInterfaceWindow instances. More...

#include <win32_dx12_user_interface.h>

Public Member Functions

 UserInterface ()
 Constructs the interface with default UserInterfaceParameters.
 
 UserInterface (UserInterfaceParameters parameters)
 Constructs the interface with the given parameters.
 
 ~UserInterface ()=default
 
void initialize ()
 Creates the platform window, sets up the rendering backend and the ImGui/ImPlot/node-editor contexts, and applies the configured style, fonts, icon and background image.
 
void render ()
 Renders one frame: processes platform events and calls render() on every registered window.
 
void shutdown ()
 Destroys the rendering backend, the ImGui contexts and the platform window.
 
bool isShutdownRequested () const
 Returns true once the user has requested to close the window.
 
template<typename T , typename... Args>
void addWindow (Args &&... args)
 Constructs a window of type T and registers it for rendering.
 

Detailed Description

Main application object: owns the platform window, the rendering backend and the registered UserInterfaceWindow instances.

Typical usage:

imgui_kit::UserInterface ui{parameters};
ui.initialize();
ui.addWindow<MyWindow>();
while (!ui.isShutdownRequested())
ui.render();
ui.shutdown();
Main application object: owns the platform window, the rendering backend and the registered UserInter...
Definition win32_dx12_user_interface.h:107
Note
Every platform backend (Win32+DX12 on Windows, GLFW+OpenGL3 on Linux and macOS) exposes this same public API; the generated documentation shows the Windows variant.

Constructor & Destructor Documentation

◆ UserInterface() [1/2]

imgui_kit::UserInterface::UserInterface ( )

Constructs the interface with default UserInterfaceParameters.

◆ UserInterface() [2/2]

imgui_kit::UserInterface::UserInterface ( UserInterfaceParameters  parameters)
explicit

Constructs the interface with the given parameters.

Parameters
parametersWindow, font, style, icon and background image settings.

◆ ~UserInterface()

imgui_kit::UserInterface::~UserInterface ( )
default

Member Function Documentation

◆ addWindow()

template<typename T , typename... Args>
void imgui_kit::UserInterface::addWindow ( Args &&...  args)
inline

Constructs a window of type T and registers it for rendering.

Template Parameters
TA subclass of UserInterfaceWindow.
ArgsTypes of the constructor arguments.
Parameters
argsArguments forwarded to the constructor of T.

◆ initialize()

void imgui_kit::UserInterface::initialize ( )

Creates the platform window, sets up the rendering backend and the ImGui/ImPlot/node-editor contexts, and applies the configured style, fonts, icon and background image.

Must be called once before render().

◆ isShutdownRequested()

bool imgui_kit::UserInterface::isShutdownRequested ( ) const

Returns true once the user has requested to close the window.

Returns
True if the render loop should stop.

◆ render()

void imgui_kit::UserInterface::render ( )

Renders one frame: processes platform events and calls render() on every registered window.

Call repeatedly in a loop until isShutdownRequested() returns true.

◆ shutdown()

void imgui_kit::UserInterface::shutdown ( )

Destroys the rendering backend, the ImGui contexts and the platform window.

Call once after the render loop ends.


The documentation for this class was generated from the following file: