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

Built-in window that displays colour-coded log messages. More...

#include <log_window.h>

Inheritance diagram for imgui_kit::LogWindow:
[legend]
Collaboration diagram for imgui_kit::LogWindow:
[legend]

Public Member Functions

 LogWindow ()
 
void render () override
 Renders the log window. Called once per frame by the UserInterface.
 
 ~LogWindow () override=default
 
- Public Member Functions inherited from imgui_kit::UserInterfaceWindow
 UserInterfaceWindow ()=default
 
virtual ~UserInterfaceWindow ()=default
 
 UserInterfaceWindow (const UserInterfaceWindow &)=delete
 
UserInterfaceWindowoperator= (const UserInterfaceWindow &)=delete
 
 UserInterfaceWindow (UserInterfaceWindow &&)=delete
 
UserInterfaceWindowoperator= (UserInterfaceWindow &&)=delete
 

Static Public Member Functions

static void addLog (const ImVec4 &color, const char *fmt,...)
 Appends a printf-style formatted message to the log.
 
static bool isActive ()
 Returns true while the log window is open and being rendered.
 
static size_t getLogCount ()
 Returns the number of stored log entries.
 
static void clearLogs ()
 Removes all stored log entries.
 
static void renderContent ()
 Renders the log contents (toolbar, filter and entries) into the current ImGui window.
 

Detailed Description

Built-in window that displays colour-coded log messages.

The log storage is static and shared: call addLog() from anywhere in the application, before or after a LogWindow instance exists. The window provides a text filter and an auto-scroll option.

Register it with UserInterface::addWindow<LogWindow>(), or embed the log UI inside your own window with renderContent().

Constructor & Destructor Documentation

◆ LogWindow()

imgui_kit::LogWindow::LogWindow ( )

◆ ~LogWindow()

imgui_kit::LogWindow::~LogWindow ( )
overridedefault

Member Function Documentation

◆ addLog()

static void imgui_kit::LogWindow::addLog ( const ImVec4 &  color,
const char *  fmt,
  ... 
)
static

Appends a printf-style formatted message to the log.

Parameters
colorColour used to render the message (see imgui_kit::colours).
fmtprintf-style format string.
...Format arguments.

◆ clearLogs()

static void imgui_kit::LogWindow::clearLogs ( )
inlinestatic

Removes all stored log entries.

◆ getLogCount()

static size_t imgui_kit::LogWindow::getLogCount ( )
inlinestatic

Returns the number of stored log entries.

◆ isActive()

static bool imgui_kit::LogWindow::isActive ( )
inlinestatic

Returns true while the log window is open and being rendered.

◆ render()

void imgui_kit::LogWindow::render ( )
inlineoverridevirtual

Renders the log window. Called once per frame by the UserInterface.

Implements imgui_kit::UserInterfaceWindow.

◆ renderContent()

static void imgui_kit::LogWindow::renderContent ( )
static

Renders the log contents (toolbar, filter and entries) into the current ImGui window.

Use this to embed the log UI inside a custom window instead of registering a standalone LogWindow.


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