Skip to content

IWindow ​

ImGui GUIWindow abstract class. More...

#include "GUI/Elements/IWindow.h"

Inherits from std::enable_shared_from_this< IWindow >

Inherited by AboutWindow, DescriptionDialog, ImportedModelsDialog, LogWindow, ModalWindow, PreferencesWindow, SelectLayoutDialog, StartWindow, StatisticsWindow, TutorialWindow, UI::Console, UI::StyleEditor, UI::ViewportWindow, WorkspaceWindow

Public Functions ​

Name
IWindow(std::string title, bool show =false)
IWindow(std::string title, int instanceIndex, bool show)
virtual~IWindow() =default
virtual const char *getID() const =0
WPtr< InputController >getInput()<br>Returns window input controller.
const char *getName()
bool *getShowPtr()
const std::string &getTitle() const
voidhide()
boolisVisible() const
virtual voidrender() =0
const voidsetTitle(std::string title)
voidshow()

Protected Functions ​

Name
voidupdateWindowInfo()<br>Collect information about the current window.

Public Attributes ​

Name
boolm_autoFocus <br>When true the window will get focus immediately upon hovering over it.
intm_instanceIndex <br>Window instance identifier, for windows with multiple instances of same type, -1 default.
std::stringm_title <br>Visible window title.
boolm_windowInfoUpdated <br>A flag indicating the updateWindowInfo() method was called.
WindowManager *m_windowManager <br>Weak reference to a WindowManager set when this window is added to it.
glm::vec2m_windowMax <br>Bottom right corner of the window.
glm::vec2m_windowMin <br>Top left corner of the window, same as m_windowPos (separate variable for clarity)
glm::vec2m_windowPos <br>Top-left corner of the window in screen coordinates.
glm::ivec2m_windowSize <br>Window width and height dimensions.

Protected Attributes ​

Name
Ptr< InputController >m_input
std::stringm_name <br>Full ImGui window identifier.
boolm_nameNeedsUpdate <br>Workaround to avoid setting the name in the constructor (cannot call getID there)
boolm_show

Friends ​

Name
classWindowManager

Detailed Description ​

cpp
class IWindow;

ImGui GUIWindow abstract class.

See: WindowManager for lifecycle information.

Every window should call its IWindow::updateWindowInfo() method after ImGui::Begin() call.

Public Functions Documentation ​

function IWindow ​

cpp
explicit IWindow(
    std::string title,
    bool show =false
)

function IWindow ​

cpp
IWindow(
    std::string title,
    int instanceIndex,
    bool show
)

function ~IWindow ​

cpp
virtual ~IWindow() =default

Precondition: Window cannot be destroyed at runtime. It may cause crash.

function getID ​

cpp
virtual const char * getID() const =0

Reimplemented by: ModalWindow::getID

function getInput ​

cpp
inline WPtr< InputController > getInput()

Returns window input controller.

function getName ​

cpp
const char * getName()

Return: ImGui window name.

function getShowPtr ​

cpp
inline bool * getShowPtr()

function getTitle ​

cpp
const std::string & getTitle() const

function hide ​

cpp
inline void hide()

function isVisible ​

cpp
inline bool isVisible() const

function render ​

cpp
virtual void render() =0

Reimplemented by: DescriptionDialog::render, ImportedModelsDialog::render, PreferencesWindow::render, SelectLayoutDialog::render, ModalWindow::render, AboutWindow::render, UI::Console::render, LogWindow::render, StartWindow::render, StatisticsWindow::render, UI::StyleEditor::render, TutorialWindow::render, UI::ViewportWindow::render, WorkspaceWindow::render

function setTitle ​

cpp
const void setTitle(
    std::string title
)

function show ​

cpp
inline void show()

Protected Functions Documentation ​

function updateWindowInfo ​

cpp
void updateWindowInfo()

Collect information about the current window.

Should be called right after ImGui's Begin() function to store and supply window's screen position and size to any code being called until another window starts being constructed. If this call is omitted after beginning a window anything querying the WindowManager for window position and dimensions may receive invalid information.

Public Attributes Documentation ​

variable m_autoFocus ​

cpp
bool m_autoFocus {false};

When true the window will get focus immediately upon hovering over it.

It will, however, also immediately give up focus to other windows.

variable m_instanceIndex ​

cpp
int m_instanceIndex {
	    -1};

Window instance identifier, for windows with multiple instances of same type, -1 default.

variable m_title ​

cpp
std::string m_title;

Visible window title.

variable m_windowInfoUpdated ​

cpp
bool m_windowInfoUpdated {false};

A flag indicating the updateWindowInfo() method was called.

variable m_windowManager ​

cpp
WindowManager * m_windowManager {nullptr};

Weak reference to a WindowManager set when this window is added to it.

variable m_windowMax ​

cpp
glm::vec2 m_windowMax;

Bottom right corner of the window.

variable m_windowMin ​

cpp
glm::vec2 m_windowMin;

Top left corner of the window, same as m_windowPos (separate variable for clarity)

variable m_windowPos ​

cpp
glm::vec2 m_windowPos;

Top-left corner of the window in screen coordinates.

variable m_windowSize ​

cpp
glm::ivec2 m_windowSize;

Window width and height dimensions.

Protected Attributes Documentation ​

variable m_input ​

cpp
Ptr< InputController > m_input {std::make_shared<InputController>()};

variable m_name ​

cpp
std::string m_name;

Full ImGui window identifier.

variable m_nameNeedsUpdate ​

cpp
bool m_nameNeedsUpdate {true};

Workaround to avoid setting the name in the constructor (cannot call getID there)

variable m_show ​

cpp
bool m_show {false};

Friends ​

friend WindowManager ​

cpp
friend class WindowManager(
    WindowManager 
);

Updated on 2026-09-11 at 21:24:25 +0000