Kemena3D
Loading...
Searching...
No Matches
kemena::kGuiManager Class Reference

Wraps Dear ImGui initialisation, event forwarding, and widget calls. More...

#include <kguimanager.h>

Public Member Functions

 kGuiManager ()
 Constructs an uninitialised GUI manager; call init() before use.
virtual ~kGuiManager ()
 Destroys the GUI manager, releasing any held ImGui resources.
void init (kRenderer *newRenderer)
 Initialises ImGui with the given renderer's context and window.
void processEvent (kSystemEvent event)
 Forwards a system event to ImGui for input processing.
void loadDefaultFontFromResource (kString resourceName)
 Loads and sets the default ImGui font from a Windows resource.
void canvasStart ()
 Begins a new ImGui frame (call once per render frame).
void canvasEnd ()
 Renders all ImGui draw data and ends the frame.
void windowStart (kString title, bool *open=nullptr, ImGuiWindowFlags flags=0)
 Begins an ImGui window.
void windowEnd ()
 Ends the current ImGui window.
kVec2 getWindowSize ()
 Returns the inner size of the current window in pixels.
kVec2 getWindowPos ()
 Returns the screen-space position of the current window.
void setNextWindowSize (kVec2 size, ImGuiCond cond=0)
 Sets the size of the next window before it is created.
void setNextWindowPos (kVec2 pos, ImGuiCond cond=0, kVec2 pivot=kVec2(0, 0))
 Sets the position of the next window before it is created.
void setNextWindowContentSize (kVec2 size)
 Sets the content size of the next window.
void setNextWindowCollapsed (bool collapsed, ImGuiCond cond=0)
 Sets the collapsed state of the next window.
void setNextWindowFocus ()
 Gives input focus to the next window.
void setNextWindowBgAlpha (float alpha)
 Sets the background transparency of the next window.
bool isWindowFocused (ImGuiFocusedFlags flags=0)
 Returns whether the current window has keyboard focus.
bool isWindowHovered (ImGuiHoveredFlags flags=0)
 Returns whether the mouse is hovering over the current window.
kVec2 getWindowContentRegionMin ()
 Returns the content region minimum bound in window-local coordinates.
kVec2 getWindowContentRegionMax ()
 Returns the content region maximum bound in window-local coordinates.
kVec2 getMainViewportCenter ()
 Returns the center of the main viewport in screen coordinates.
bool childStart (kString id, kVec2 size=kVec2(0, 0), ImGuiChildFlags childFlags=0, ImGuiWindowFlags windowFlags=0)
 Begins a scrollable child region.
void childEnd ()
 Ends the current child region. Always call this after childStart().
void dockSpaceStart (kString name)
 Begins a full-window docking area.
void dockSpaceEnd ()
 Ends the current dockspace (no-op; kept for symmetry).
bool menuBar ()
 Begins the main menu bar.
void menuBarEnd ()
 Ends the main menu bar.
bool menu (kString text)
 Begins a named menu.
void menuEnd ()
 Ends the current menu.
bool menuItem (kString text, kString shortcut="", bool selected=false, bool enabled=true)
 Adds a clickable menu item.
bool menuItem (kString text, kString shortcut, bool *selected, bool enabled=true)
 Adds a toggleable menu item backed by a bool.
void groupStart ()
 Begins a layout group.
void groupEnd ()
 Ends a layout group.
void beginDisabled (bool disabled=true)
 Disables all user interaction and dims widgets.
void endDisabled ()
 Ends a disabled section opened with beginDisabled().
void sameLine (float offsetFromStartX=0.0f, float spacing=-1.0f)
 Places the next widget on the same line as the previous one.
void spacing ()
 Inserts a small vertical space.
void separator ()
 Draws a horizontal separator line.
void separatorText (kString text)
 Draws a horizontal separator with a centred text label.
void newLine ()
 Inserts a blank line in the layout.
void indent (float indentW=0.0f)
 Moves the cursor right by indentW pixels.
void unindent (float indentW=0.0f)
 Moves the cursor left by indentW pixels.
void dummy (kVec2 size)
 Inserts an invisible widget of a given size for layout spacing.
void setCursorPos (kVec2 pos)
 Moves the cursor to an absolute position within the window.
void setCursorPosX (float x)
 Sets the cursor X position.
void setCursorPosY (float y)
 Sets the cursor Y position.
kVec2 getCursorPos ()
 Returns the cursor position relative to the window.
float getCursorPosX ()
 Returns the cursor X position.
float getCursorPosY ()
 Returns the cursor Y position.
kVec2 getCursorScreenPos ()
 Returns the cursor position in screen coordinates.
void setCursorScreenPos (kVec2 pos)
 Moves the cursor to an absolute screen-space position.
kVec2 getContentRegionAvail ()
 Returns the available content region size in the current window.
void setNextItemWidth (float itemWidth)
 Sets the width of the next widget.
void pushItemWidth (float itemWidth)
 Pushes a width onto the item-width stack.
void popItemWidth ()
 Pops the last item width from the stack.
float calcItemWidth ()
 Returns the current item width calculated by ImGui.
void pushTextWrapPos (float wrapLocalPosX=0.0f)
 Pushes a text wrap position onto the stack.
void popTextWrapPos ()
 Pops the last text wrap position.
float getFrameHeight ()
 Returns the height of a typical framed widget in pixels (FontSize + FramePadding * 2).
float getFrameHeightWithSpacing ()
 Returns the height of a framed widget plus item spacing (distance between two consecutive widget rows).
void pushId (kString id)
 Pushes a kString ID onto the ID stack.
void pushId (int id)
 Pushes an integer ID onto the ID stack.
void pushId (const void *ptr)
 Pushes a pointer ID onto the ID stack.
void popId ()
 Pops the last ID from the ID stack.
void pushStyleColor (ImGuiCol idx, kVec4 color)
 Pushes a colour override for an ImGui style element.
void pushStyleColor (ImGuiCol idx, ImU32 color)
 Pushes a packed colour override.
void popStyleColor (int count=1)
 Pops colour overrides from the style stack.
void pushStyleVar (ImGuiStyleVar idx, float val)
 Pushes a float style variable override.
void pushStyleVar (ImGuiStyleVar idx, kVec2 val)
 Pushes a kVec2 style variable override.
void popStyleVar (int count=1)
 Pops style variable overrides from the stack.
void pushFont (ImFont *font)
 Pushes a font onto the font stack.
void popFont ()
 Pops the last font from the font stack.
float getFontSize ()
 Returns the current scaled font size in pixels.
void text (kString text)
 Renders a plain text kString.
void textColored (kVec4 color, kString text)
 Renders coloured text.
void textDisabled (kString text)
 Renders greyed-out (disabled) text.
void alignTextToFramePadding ()
 Vertically aligns the next widget so its baseline lines up with text.
void textWrapped (kString text)
 Renders text that wraps at the wrap position.
void labelText (kString label, kString text)
 Renders a label/value pair aligned to the value column.
void bulletText (kString text)
 Renders text preceded by a bullet point.
void bullet ()
 Renders a bullet point without text.
kVec2 calcTextSize (kString text, bool hideTextAfterDoubleHash=false, float wrapWidth=-1.0f)
 Returns the rendered size of a text kString.
bool button (kString text, kIvec2 size=kIvec2(0, 0))
 Renders a push-button.
bool smallButton (kString text)
 Renders a small inline push-button.
bool invisibleButton (kString id, kVec2 size, ImGuiButtonFlags flags=0)
 Renders an invisible hit-area button.
bool arrowButton (kString id, ImGuiDir dir)
 Renders an arrow-shaped button.
bool radioButton (kString label, bool active)
 Renders a radio button.
bool radioButton (kString label, int *v, int vButton)
 Renders a radio button linked to an integer variable.
bool checkbox (kString text, bool *output)
 Renders a checkbox.
bool checkboxFlags (kString label, int *flags, int flagsValue)
 Renders a checkbox backed by integer flags (signed).
bool checkboxFlags (kString label, unsigned int *flags, unsigned int flagsValue)
 Renders a checkbox backed by integer flags (unsigned).
bool inputText (kString label, kString &value, size_t maxLength=256, ImGuiInputTextFlags flags=0)
 Renders a single-line text input field.
bool inputTextMultiline (kString label, kString &value, size_t maxLength=1024, kVec2 size=kVec2(0, 0), ImGuiInputTextFlags flags=0)
 Renders a multi-line text input field.
bool inputTextWithHint (kString label, kString hint, kString &value, size_t maxLength=256, ImGuiInputTextFlags flags=0)
 Renders a single-line text input with a placeholder hint.
bool inputFloat (kString label, float *v, float step=0.0f, float stepFast=0.0f, kString format="%.3f", ImGuiInputTextFlags flags=0)
 Single float input.
bool inputFloat2 (kString label, float v[2], kString format="%.3f", ImGuiInputTextFlags flags=0)
 Two-component float input.
bool inputFloat3 (kString label, float v[3], kString format="%.3f", ImGuiInputTextFlags flags=0)
 Three-component float input.
bool inputFloat4 (kString label, float v[4], kString format="%.3f", ImGuiInputTextFlags flags=0)
 Four-component float input.
bool inputInt (kString label, int *v, int step=1, int stepFast=100, ImGuiInputTextFlags flags=0)
 Single integer input.
bool inputInt2 (kString label, int v[2], ImGuiInputTextFlags flags=0)
 Two-component integer input.
bool inputInt3 (kString label, int v[3], ImGuiInputTextFlags flags=0)
 Three-component integer input.
bool inputInt4 (kString label, int v[4], ImGuiInputTextFlags flags=0)
 Four-component integer input.
bool inputDouble (kString label, double *v, double step=0.0, double stepFast=0.0, kString format="%.6f", ImGuiInputTextFlags flags=0)
 Double-precision float input.
bool dragFloat (kString label, float *v, float speed=1.0f, float min=0.0f, float max=0.0f, kString format="%.3f", ImGuiSliderFlags flags=0)
 Drag widget for a single float.
bool dragFloat2 (kString label, float v[2], float speed=1.0f, float min=0.0f, float max=0.0f, kString format="%.3f", ImGuiSliderFlags flags=0)
 Drag widget for two floats.
bool dragFloat3 (kString label, float v[3], float speed=1.0f, float min=0.0f, float max=0.0f, kString format="%.3f", ImGuiSliderFlags flags=0)
 Drag widget for three floats.
bool dragFloat4 (kString label, float v[4], float speed=1.0f, float min=0.0f, float max=0.0f, kString format="%.3f", ImGuiSliderFlags flags=0)
 Drag widget for four floats.
bool dragInt (kString label, int *v, float speed=1.0f, int min=0, int max=0, kString format="%d", ImGuiSliderFlags flags=0)
 Drag widget for a single integer.
bool dragInt2 (kString label, int v[2], float speed=1.0f, int min=0, int max=0, kString format="%d", ImGuiSliderFlags flags=0)
 Drag widget for two integers.
bool dragInt3 (kString label, int v[3], float speed=1.0f, int min=0, int max=0, kString format="%d", ImGuiSliderFlags flags=0)
 Drag widget for three integers.
bool dragInt4 (kString label, int v[4], float speed=1.0f, int min=0, int max=0, kString format="%d", ImGuiSliderFlags flags=0)
 Drag widget for four integers.
bool dragFloatRange2 (kString label, float *vCurrentMin, float *vCurrentMax, float speed=1.0f, float min=0.0f, float max=0.0f, kString format="%.3f", kString formatMax="", ImGuiSliderFlags flags=0)
 Drag widget for a float range (min + max pair).
bool dragIntRange2 (kString label, int *vCurrentMin, int *vCurrentMax, float speed=1.0f, int min=0, int max=0, kString format="%d", kString formatMax="", ImGuiSliderFlags flags=0)
 Drag widget for an integer range (min + max pair).
bool sliderFloat (kString label, float *v, float min, float max, kString format="%.3f", ImGuiSliderFlags flags=0)
 Horizontal slider for a single float.
bool sliderFloat2 (kString label, float v[2], float min, float max, kString format="%.3f", ImGuiSliderFlags flags=0)
 Horizontal slider for two floats.
bool sliderFloat3 (kString label, float v[3], float min, float max, kString format="%.3f", ImGuiSliderFlags flags=0)
 Horizontal slider for three floats.
bool sliderFloat4 (kString label, float v[4], float min, float max, kString format="%.3f", ImGuiSliderFlags flags=0)
 Horizontal slider for four floats.
bool sliderAngle (kString label, float *vRad, float vDegreesMin=-360.0f, float vDegreesMax=360.0f, kString format="%.0f deg", ImGuiSliderFlags flags=0)
 Horizontal slider that displays and edits an angle in degrees.
bool sliderInt (kString label, int *v, int min, int max, kString format="%d", ImGuiSliderFlags flags=0)
 Horizontal slider for a single integer.
bool sliderInt2 (kString label, int v[2], int min, int max, kString format="%d", ImGuiSliderFlags flags=0)
 Horizontal slider for two integers.
bool sliderInt3 (kString label, int v[3], int min, int max, kString format="%d", ImGuiSliderFlags flags=0)
 Horizontal slider for three integers.
bool sliderInt4 (kString label, int v[4], int min, int max, kString format="%d", ImGuiSliderFlags flags=0)
 Horizontal slider for four integers.
bool colorEdit3 (kString label, float col[3], ImGuiColorEditFlags flags=0)
 RGB colour editor widget.
bool colorEdit4 (kString label, float col[4], ImGuiColorEditFlags flags=0)
 RGBA colour editor widget.
bool colorPicker3 (kString label, float col[3], ImGuiColorEditFlags flags=0)
 RGB colour picker widget.
bool colorPicker4 (kString label, float col[4], ImGuiColorEditFlags flags=0)
 RGBA colour picker widget.
bool colorButton (kString descId, kVec4 col, ImGuiColorEditFlags flags=0, kVec2 size=kVec2(0, 0))
 Renders a small coloured square button.
void setColorEditOptions (ImGuiColorEditFlags flags)
 Sets global colour edit display options.
bool combo (kString label, int *currentItem, std::vector< kString > items, int popupMaxHeightInItems=-1)
 Drop-down combo box.
bool listBox (kString label, int *currentItem, std::vector< kString > items, int heightInItems=-1)
 Scrollable list box.
bool selectable (kString label, bool selected=false, ImGuiSelectableFlags flags=0, kVec2 size=kVec2(0, 0))
 Selectable row (state passed by value).
bool selectable (kString label, bool *pSelected, ImGuiSelectableFlags flags=0, kVec2 size=kVec2(0, 0))
 Selectable row (state passed by pointer).
bool treeStart (kString label)
 Begins a tree node (uses label as ID).
bool treeStartEx (kString id, kString label="", ImGuiTreeNodeFlags flags=0)
 Begins a tree node with explicit ID and label.
void treeEnd ()
 Ends the current tree node (use when treeStart returned true).
void treePop ()
 Pops the tree indent regardless of whether the node is open.
bool collapsingHeader (kString label, ImGuiTreeNodeFlags flags=0)
 Collapsible section header.
bool collapsingHeader (kString label, bool *visible, ImGuiTreeNodeFlags flags=0)
 Collapsible section header with a close button.
void setNextItemOpen (bool isOpen, ImGuiCond cond=0)
 Sets the open state of the next tree node.
void image (GLuint textureId, kVec2 size, kVec2 uv0=kVec2(0, 0), kVec2 uv1=kVec2(1, 1))
 Renders a GPU texture as an image widget.
bool imageButton (kString id, GLuint textureId, kVec2 size, kVec2 uv0=kVec2(0, 0), kVec2 uv1=kVec2(1, 1), kVec4 tint=kVec4(1, 1, 1, 1))
 Renders a GPU texture as a clickable image button.
void progressBar (float fraction, kVec2 size=kVec2(-FLT_MIN, 0), kString overlay="")
 Renders a horizontal progress bar.
void setItemTooltip (kString text)
 Sets a tooltip shown when the last item is hovered.
void beginTooltip ()
 Begins a custom tooltip popup.
void endTooltip ()
 Ends the current tooltip popup.
void openPopup (kString id, ImGuiPopupFlags flags=0)
 Opens a named popup on the next frame.
bool popupStart (kString id, ImGuiWindowFlags flags=0)
 Begins rendering a named popup.
void popupEnd ()
 Ends the current popup.
bool popupModal (kString name, bool *open=nullptr, ImGuiWindowFlags flags=0)
 Begins a modal popup dialog.
bool popupContextItemStart (kString id="", ImGuiPopupFlags flags=ImGuiPopupFlags_MouseButtonRight)
 Begins a context menu popup on right-click of the last item.
bool popupContextWindowStart (kString id="", ImGuiPopupFlags flags=ImGuiPopupFlags_MouseButtonRight)
 Begins a context menu popup on right-click of the current window.
bool isPopupOpen (kString id, ImGuiPopupFlags flags=0)
 Returns whether a named popup is currently open.
void closeCurrentPopup ()
 Closes the currently open popup.
bool tabBarStart (kString id, ImGuiTabBarFlags flags=0)
 Begins a tab bar container.
void tabBarEnd ()
 Ends the current tab bar.
bool tabItemStart (kString label, bool *open=nullptr, ImGuiTabItemFlags flags=0)
 Begins a tab item inside a tab bar.
void tabItemEnd ()
 Ends the current tab item.
void setTabItemClosed (kString tabOrDockedWindowLabel)
 Marks a tab (or docked window) as closed programmatically.
bool tableStart (kString id, int columns, ImGuiTableFlags flags=0, kVec2 outerSize=kVec2(0, 0), float innerWidth=0.0f)
 Begins a table layout.
void tableEnd ()
 Ends the current table.
bool tableNextColumn ()
 Advances to the next column in the current row.
bool tableSetColumnIndex (int columnN)
 Sets the current column index explicitly.
void tableNextRow (ImGuiTableRowFlags rowFlags=0, float minRowHeight=0.0f)
 Begins a new table row.
void tableSetupColumn (kString label, ImGuiTableColumnFlags flags=0, float initWidthOrWeight=0.0f)
 Sets up a table column with optional flags and initial width.
void tableSetupScrollFreeze (int cols, int rows)
 Freezes leading columns/rows so they remain visible while scrolling.
void tableHeadersRow ()
 Renders the header row using labels set by tableSetupColumn().
void tableHeader (kString label)
 Renders a single header cell.
void columnsStart (int count=1, kString id="", bool borders=true)
 Begins a legacy multi-column layout.
void columnsEnd ()
 Resets to a single-column layout, ending the columns region.
void nextColumn ()
 Advances to the next column (wraps to the next row when needed).
float getColumnWidth (int columnIndex=-1)
 Returns the width of a column in pixels.
float getScrollX ()
 Returns the current horizontal scroll position.
float getScrollY ()
 Returns the current vertical scroll position.
void setScrollX (float scrollX)
 Sets the horizontal scroll position.
void setScrollY (float scrollY)
 Sets the vertical scroll position.
float getScrollMaxX ()
 Returns the maximum horizontal scroll position.
float getScrollMaxY ()
 Returns the maximum vertical scroll position.
void setScrollHereX (float centerXRatio=0.5f)
 Scrolls so the current item is visible horizontally.
void setScrollHereY (float centerYRatio=0.5f)
 Scrolls so the current item is visible vertically.
bool isItemHovered (ImGuiHoveredFlags flags=0)
 Returns whether the last widget is hovered.
bool isItemActive ()
 Returns whether the last widget is active (e.g. being dragged).
bool isItemFocused ()
 Returns whether the last widget has keyboard focus.
bool isItemClicked (ImGuiMouseButton mouseButton=0)
 Returns whether the last widget was clicked.
bool isItemVisible ()
 Returns whether the last widget is visible in the clipping rectangle.
bool isItemEdited ()
 Returns whether the last widget's value was edited this frame.
bool isItemActivated ()
 Returns whether the last widget became active this frame.
bool isItemDeactivated ()
 Returns whether the last widget became inactive this frame.
bool isItemDeactivatedAfterEdit ()
 Returns whether the last widget became inactive after being edited.
bool isItemToggledOpen ()
 Returns whether the last tree node was toggled open.
bool isAnyItemHovered ()
 Returns whether any widget is currently hovered.
bool isAnyItemActive ()
 Returns whether any widget is currently active.
bool isAnyItemFocused ()
 Returns whether any widget currently has focus.
kVec2 getItemRectMin ()
 Returns the bounding box minimum of the last item (screen space).
kVec2 getItemRectMax ()
 Returns the bounding box maximum of the last item (screen space).
kVec2 getItemRectSize ()
 Returns the bounding box size of the last item.
void setNextItemAllowOverlap ()
 Allows the next item to overlap previously drawn items. Call this before the item that should allow overlap.
bool isMouseDown (ImGuiMouseButton button)
 Returns whether a mouse button is held down.
bool isMouseClicked (ImGuiMouseButton button, bool repeat=false)
 Returns whether a mouse button was clicked this frame.
bool isMouseReleased (ImGuiMouseButton button)
 Returns whether a mouse button was released this frame.
bool isMouseDoubleClicked (ImGuiMouseButton button)
 Returns whether a mouse button was double-clicked this frame.
bool isMouseHoveringRect (kVec2 rMin, kVec2 rMax, bool clip=true)
 Returns whether the mouse is inside the given screen-space rectangle.
kVec2 getMousePos ()
 Returns the current mouse position in screen coordinates.
kVec2 getMouseDelta ()
 Returns the mouse position delta since the last frame.
float getMouseWheel ()
 Returns the vertical mouse wheel delta.
bool isKeyShift ()
 Returns true if the Shift modifier key is currently held.
bool isKeyCtrl ()
 Returns true if the Ctrl modifier key is currently held.
bool getWantTextInput ()
 Returns true if any ImGui widget currently wants text input.
float getDeltaTime ()
 Returns the time in seconds elapsed since the last frame.
void drawListAddImage (GLuint textureId, kVec2 pMin, kVec2 pMax, kVec2 uvMin=kVec2(0, 0), kVec2 uvMax=kVec2(1, 1), kVec4 tint=kVec4(1, 1, 1, 1))
 Draws a textured rectangle directly onto the window draw list.
float getTextLineHeight ()
 Returns the height of a single text line in pixels.
void textUnformatted (kString text)
 Renders a raw string without label formatting.
void setClipboardText (kString text)
 Sets the OS clipboard text.
void saveIniSettingsToDisk (kString filename)
 Saves the current ImGui layout state to a .ini file.
void loadIniSettingsFromDisk (kString filename)
 Loads ImGui layout state from a .ini file.
void loadIniSettingsFromMemory (const char *data, size_t size)
 Loads ImGui layout state from an in-memory .ini blob.
void addSettingsHandler (ImGuiSettingsHandler handler)
 Registers a custom .ini settings handler.
void destroy ()
 Shuts down ImGui and releases backend resources.

Detailed Description

Wraps Dear ImGui initialisation, event forwarding, and widget calls.

Call init() once after the renderer is ready, then each frame:

  1. Forward input events with processEvent().
  2. Open a frame with canvasStart().
  3. Build UI using the widget methods.
  4. Close the frame with canvasEnd().
gui.init(&renderer);
// per-frame:
gui.windowStart("My Window");
gui.text("Hello, world!");
gui.windowEnd();
gui.canvasEnd();
void text(kString text)
Renders a plain text kString.
void windowStart(kString title, bool *open=nullptr, ImGuiWindowFlags flags=0)
Begins an ImGui window.
void init(kRenderer *newRenderer)
Initialises ImGui with the given renderer's context and window.
kGuiManager()
Constructs an uninitialised GUI manager; call init() before use.
void windowEnd()
Ends the current ImGui window.
void canvasEnd()
Renders all ImGui draw data and ends the frame.
void canvasStart()
Begins a new ImGui frame (call once per render frame).

Constructor & Destructor Documentation

◆ kGuiManager()

kemena::kGuiManager::kGuiManager ( )

Constructs an uninitialised GUI manager; call init() before use.

◆ ~kGuiManager()

virtual kemena::kGuiManager::~kGuiManager ( )
virtual

Destroys the GUI manager, releasing any held ImGui resources.

Member Function Documentation

◆ addSettingsHandler()

void kemena::kGuiManager::addSettingsHandler ( ImGuiSettingsHandler handler)

Registers a custom .ini settings handler.

Parameters
handlerFully configured ImGuiSettingsHandler struct.

◆ alignTextToFramePadding()

void kemena::kGuiManager::alignTextToFramePadding ( )

Vertically aligns the next widget so its baseline lines up with text.

◆ arrowButton()

bool kemena::kGuiManager::arrowButton ( kString id,
ImGuiDir dir )

Renders an arrow-shaped button.

Parameters
idUnique identifier.
dirArrow direction (ImGuiDir).
Returns
true if clicked.

◆ beginDisabled()

void kemena::kGuiManager::beginDisabled ( bool disabled = true)

Disables all user interaction and dims widgets.

Parameters
disabledPass true to enter disabled state (default).

◆ beginTooltip()

void kemena::kGuiManager::beginTooltip ( )

Begins a custom tooltip popup.

◆ bullet()

void kemena::kGuiManager::bullet ( )

Renders a bullet point without text.

◆ bulletText()

void kemena::kGuiManager::bulletText ( kString text)

Renders text preceded by a bullet point.

Parameters
textText.
Here is the call graph for this function:

◆ button()

bool kemena::kGuiManager::button ( kString text,
kIvec2 size = kIvec2(0, 0) )

Renders a push-button.

Parameters
textLabel text.
sizeButton size in pixels (0 = auto).
Returns
true if the button was clicked.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcItemWidth()

float kemena::kGuiManager::calcItemWidth ( )

Returns the current item width calculated by ImGui.

◆ calcTextSize()

kVec2 kemena::kGuiManager::calcTextSize ( kString text,
bool hideTextAfterDoubleHash = false,
float wrapWidth = -1.0f )

Returns the rendered size of a text kString.

Parameters
textText to measure.
hideTextAfterDoubleHashIf true, text after "##" is not measured.
wrapWidthWrap width (-1 = no wrap).
Returns
Bounding size in pixels.
Here is the call graph for this function:

◆ canvasEnd()

void kemena::kGuiManager::canvasEnd ( )

Renders all ImGui draw data and ends the frame.

◆ canvasStart()

void kemena::kGuiManager::canvasStart ( )

Begins a new ImGui frame (call once per render frame).

◆ checkbox()

bool kemena::kGuiManager::checkbox ( kString text,
bool * output )

Renders a checkbox.

Parameters
textCheckbox label.
outputPointer to the bool state.
Returns
true if the state changed.
Here is the call graph for this function:

◆ checkboxFlags() [1/2]

bool kemena::kGuiManager::checkboxFlags ( kString label,
int * flags,
int flagsValue )

Renders a checkbox backed by integer flags (signed).

Parameters
labelCheckbox label.
flagsPointer to the flags integer.
flagsValueBit mask this checkbox controls.
Returns
true if the state changed.

◆ checkboxFlags() [2/2]

bool kemena::kGuiManager::checkboxFlags ( kString label,
unsigned int * flags,
unsigned int flagsValue )

Renders a checkbox backed by integer flags (unsigned).

Parameters
labelCheckbox label.
flagsPointer to the flags integer.
flagsValueBit mask this checkbox controls.
Returns
true if the state changed.

◆ childEnd()

void kemena::kGuiManager::childEnd ( )

Ends the current child region. Always call this after childStart().

◆ childStart()

bool kemena::kGuiManager::childStart ( kString id,
kVec2 size = kVec2(0, 0),
ImGuiChildFlags childFlags = 0,
ImGuiWindowFlags windowFlags = 0 )

Begins a scrollable child region.

Parameters
idUnique identifier.
sizeSize in pixels (0 = fill remaining; negative = remaining minus value).
childFlagsImGuiChildFlags (e.g. ImGuiChildFlags_Borders).
windowFlagsImGuiWindowFlags.
Returns
true if the child region is visible; always call childEnd() regardless.

◆ closeCurrentPopup()

void kemena::kGuiManager::closeCurrentPopup ( )

Closes the currently open popup.

◆ collapsingHeader() [1/2]

bool kemena::kGuiManager::collapsingHeader ( kString label,
bool * visible,
ImGuiTreeNodeFlags flags = 0 )

Collapsible section header with a close button.

Parameters
labelLabel text.
visiblePointer to the visibility bool.
flagsImGuiTreeNodeFlags.
Returns
true if the section is expanded.

◆ collapsingHeader() [2/2]

bool kemena::kGuiManager::collapsingHeader ( kString label,
ImGuiTreeNodeFlags flags = 0 )

Collapsible section header.

Parameters
labelLabel text.
flagsImGuiTreeNodeFlags.
Returns
true if the section is expanded.

◆ colorButton()

bool kemena::kGuiManager::colorButton ( kString descId,
kVec4 col,
ImGuiColorEditFlags flags = 0,
kVec2 size = kVec2(0, 0) )

Renders a small coloured square button.

Parameters
descIdUnique identifier / tooltip.
colButton colour.
flagsImGuiColorEditFlags.
sizeButton size (0 = default).
Returns
true if clicked.

◆ colorEdit3()

bool kemena::kGuiManager::colorEdit3 ( kString label,
float col[3],
ImGuiColorEditFlags flags = 0 )

RGB colour editor widget.

Returns
true if changed.

◆ colorEdit4()

bool kemena::kGuiManager::colorEdit4 ( kString label,
float col[4],
ImGuiColorEditFlags flags = 0 )

RGBA colour editor widget.

Returns
true if changed.

◆ colorPicker3()

bool kemena::kGuiManager::colorPicker3 ( kString label,
float col[3],
ImGuiColorEditFlags flags = 0 )

RGB colour picker widget.

Returns
true if changed.

◆ colorPicker4()

bool kemena::kGuiManager::colorPicker4 ( kString label,
float col[4],
ImGuiColorEditFlags flags = 0 )

RGBA colour picker widget.

Returns
true if changed.

◆ columnsEnd()

void kemena::kGuiManager::columnsEnd ( )

Resets to a single-column layout, ending the columns region.

◆ columnsStart()

void kemena::kGuiManager::columnsStart ( int count = 1,
kString id = "",
bool borders = true )

Begins a legacy multi-column layout.

Parameters
countNumber of columns (1 = resets to single-column).
idOptional unique identifier.
bordersWhether to draw column border lines.
Note
Prefer the Tables API for new code.

◆ combo()

bool kemena::kGuiManager::combo ( kString label,
int * currentItem,
std::vector< kString > items,
int popupMaxHeightInItems = -1 )

Drop-down combo box.

Parameters
labelWidget label.
currentItemPointer to the selected index.
itemsList of option strings.
popupMaxHeightInItemsMaximum visible items in the popup (-1 = auto).
Returns
true if the selection changed.

◆ destroy()

void kemena::kGuiManager::destroy ( )

Shuts down ImGui and releases backend resources.

◆ dockSpaceEnd()

void kemena::kGuiManager::dockSpaceEnd ( )

Ends the current dockspace (no-op; kept for symmetry).

◆ dockSpaceStart()

void kemena::kGuiManager::dockSpaceStart ( kString name)

Begins a full-window docking area.

Parameters
nameUnique dockspace identifier.

◆ dragFloat()

bool kemena::kGuiManager::dragFloat ( kString label,
float * v,
float speed = 1.0f,
float min = 0.0f,
float max = 0.0f,
kString format = "%.3f",
ImGuiSliderFlags flags = 0 )

Drag widget for a single float.

Returns
true if changed.

◆ dragFloat2()

bool kemena::kGuiManager::dragFloat2 ( kString label,
float v[2],
float speed = 1.0f,
float min = 0.0f,
float max = 0.0f,
kString format = "%.3f",
ImGuiSliderFlags flags = 0 )

Drag widget for two floats.

Returns
true if changed.

◆ dragFloat3()

bool kemena::kGuiManager::dragFloat3 ( kString label,
float v[3],
float speed = 1.0f,
float min = 0.0f,
float max = 0.0f,
kString format = "%.3f",
ImGuiSliderFlags flags = 0 )

Drag widget for three floats.

Returns
true if changed.

◆ dragFloat4()

bool kemena::kGuiManager::dragFloat4 ( kString label,
float v[4],
float speed = 1.0f,
float min = 0.0f,
float max = 0.0f,
kString format = "%.3f",
ImGuiSliderFlags flags = 0 )

Drag widget for four floats.

Returns
true if changed.

◆ dragFloatRange2()

bool kemena::kGuiManager::dragFloatRange2 ( kString label,
float * vCurrentMin,
float * vCurrentMax,
float speed = 1.0f,
float min = 0.0f,
float max = 0.0f,
kString format = "%.3f",
kString formatMax = "",
ImGuiSliderFlags flags = 0 )

Drag widget for a float range (min + max pair).

Returns
true if either value changed.

◆ dragInt()

bool kemena::kGuiManager::dragInt ( kString label,
int * v,
float speed = 1.0f,
int min = 0,
int max = 0,
kString format = "%d",
ImGuiSliderFlags flags = 0 )

Drag widget for a single integer.

Returns
true if changed.

◆ dragInt2()

bool kemena::kGuiManager::dragInt2 ( kString label,
int v[2],
float speed = 1.0f,
int min = 0,
int max = 0,
kString format = "%d",
ImGuiSliderFlags flags = 0 )

Drag widget for two integers.

Returns
true if changed.

◆ dragInt3()

bool kemena::kGuiManager::dragInt3 ( kString label,
int v[3],
float speed = 1.0f,
int min = 0,
int max = 0,
kString format = "%d",
ImGuiSliderFlags flags = 0 )

Drag widget for three integers.

Returns
true if changed.

◆ dragInt4()

bool kemena::kGuiManager::dragInt4 ( kString label,
int v[4],
float speed = 1.0f,
int min = 0,
int max = 0,
kString format = "%d",
ImGuiSliderFlags flags = 0 )

Drag widget for four integers.

Returns
true if changed.

◆ dragIntRange2()

bool kemena::kGuiManager::dragIntRange2 ( kString label,
int * vCurrentMin,
int * vCurrentMax,
float speed = 1.0f,
int min = 0,
int max = 0,
kString format = "%d",
kString formatMax = "",
ImGuiSliderFlags flags = 0 )

Drag widget for an integer range (min + max pair).

Returns
true if either value changed.

◆ drawListAddImage()

void kemena::kGuiManager::drawListAddImage ( GLuint textureId,
kVec2 pMin,
kVec2 pMax,
kVec2 uvMin = kVec2(0, 0),
kVec2 uvMax = kVec2(1, 1),
kVec4 tint = kVec4(1, 1, 1, 1) )

Draws a textured rectangle directly onto the window draw list.

Parameters
textureIdGPU texture handle.
pMinTop-left corner in screen coordinates.
pMaxBottom-right corner in screen coordinates.
uvMinTop-left UV coordinate.
uvMaxBottom-right UV coordinate.
tintTint color (default white = no tint).

◆ dummy()

void kemena::kGuiManager::dummy ( kVec2 size)

Inserts an invisible widget of a given size for layout spacing.

Parameters
sizeSize in pixels.

◆ endDisabled()

void kemena::kGuiManager::endDisabled ( )

Ends a disabled section opened with beginDisabled().

◆ endTooltip()

void kemena::kGuiManager::endTooltip ( )

Ends the current tooltip popup.

◆ getColumnWidth()

float kemena::kGuiManager::getColumnWidth ( int columnIndex = -1)

Returns the width of a column in pixels.

Parameters
columnIndexColumn index (-1 = current column).

◆ getContentRegionAvail()

kVec2 kemena::kGuiManager::getContentRegionAvail ( )

Returns the available content region size in the current window.

◆ getCursorPos()

kVec2 kemena::kGuiManager::getCursorPos ( )

Returns the cursor position relative to the window.

◆ getCursorPosX()

float kemena::kGuiManager::getCursorPosX ( )

Returns the cursor X position.

◆ getCursorPosY()

float kemena::kGuiManager::getCursorPosY ( )

Returns the cursor Y position.

◆ getCursorScreenPos()

kVec2 kemena::kGuiManager::getCursorScreenPos ( )

Returns the cursor position in screen coordinates.

◆ getDeltaTime()

float kemena::kGuiManager::getDeltaTime ( )

Returns the time in seconds elapsed since the last frame.

◆ getFontSize()

float kemena::kGuiManager::getFontSize ( )

Returns the current scaled font size in pixels.

◆ getFrameHeight()

float kemena::kGuiManager::getFrameHeight ( )

Returns the height of a typical framed widget in pixels (FontSize + FramePadding * 2).

◆ getFrameHeightWithSpacing()

float kemena::kGuiManager::getFrameHeightWithSpacing ( )

Returns the height of a framed widget plus item spacing (distance between two consecutive widget rows).

◆ getItemRectMax()

kVec2 kemena::kGuiManager::getItemRectMax ( )

Returns the bounding box maximum of the last item (screen space).

◆ getItemRectMin()

kVec2 kemena::kGuiManager::getItemRectMin ( )

Returns the bounding box minimum of the last item (screen space).

◆ getItemRectSize()

kVec2 kemena::kGuiManager::getItemRectSize ( )

Returns the bounding box size of the last item.

◆ getMainViewportCenter()

kVec2 kemena::kGuiManager::getMainViewportCenter ( )

Returns the center of the main viewport in screen coordinates.

◆ getMouseDelta()

kVec2 kemena::kGuiManager::getMouseDelta ( )

Returns the mouse position delta since the last frame.

◆ getMousePos()

kVec2 kemena::kGuiManager::getMousePos ( )

Returns the current mouse position in screen coordinates.

◆ getMouseWheel()

float kemena::kGuiManager::getMouseWheel ( )

Returns the vertical mouse wheel delta.

◆ getScrollMaxX()

float kemena::kGuiManager::getScrollMaxX ( )

Returns the maximum horizontal scroll position.

◆ getScrollMaxY()

float kemena::kGuiManager::getScrollMaxY ( )

Returns the maximum vertical scroll position.

◆ getScrollX()

float kemena::kGuiManager::getScrollX ( )

Returns the current horizontal scroll position.

◆ getScrollY()

float kemena::kGuiManager::getScrollY ( )

Returns the current vertical scroll position.

◆ getTextLineHeight()

float kemena::kGuiManager::getTextLineHeight ( )

Returns the height of a single text line in pixels.

◆ getWantTextInput()

bool kemena::kGuiManager::getWantTextInput ( )

Returns true if any ImGui widget currently wants text input.

◆ getWindowContentRegionMax()

kVec2 kemena::kGuiManager::getWindowContentRegionMax ( )

Returns the content region maximum bound in window-local coordinates.

Note
Prefer GetCursorScreenPos() + GetContentRegionAvail() for new code.

◆ getWindowContentRegionMin()

kVec2 kemena::kGuiManager::getWindowContentRegionMin ( )

Returns the content region minimum bound in window-local coordinates.

Note
Prefer GetCursorScreenPos() + GetContentRegionAvail() for new code.

◆ getWindowPos()

kVec2 kemena::kGuiManager::getWindowPos ( )

Returns the screen-space position of the current window.

◆ getWindowSize()

kVec2 kemena::kGuiManager::getWindowSize ( )

Returns the inner size of the current window in pixels.

◆ groupEnd()

void kemena::kGuiManager::groupEnd ( )

Ends a layout group.

◆ groupStart()

void kemena::kGuiManager::groupStart ( )

Begins a layout group.

◆ image()

void kemena::kGuiManager::image ( GLuint textureId,
kVec2 size,
kVec2 uv0 = kVec2(0, 0),
kVec2 uv1 = kVec2(1, 1) )

Renders a GPU texture as an image widget.

Parameters
textureIdGPU texture handle.
sizeDisplay size in pixels.
uv0Top-left UV coordinate.
uv1Bottom-right UV coordinate.

◆ imageButton()

bool kemena::kGuiManager::imageButton ( kString id,
GLuint textureId,
kVec2 size,
kVec2 uv0 = kVec2(0, 0),
kVec2 uv1 = kVec2(1, 1),
kVec4 tint = kVec4(1, 1, 1, 1) )

Renders a GPU texture as a clickable image button.

Parameters
idUnique identifier.
textureIdGPU texture handle.
sizeDisplay size in pixels.
uv0Top-left UV coordinate.
uv1Bottom-right UV coordinate.
tintTint color multiplied over the image (default white = no tint).
Returns
true if the button was clicked.

◆ indent()

void kemena::kGuiManager::indent ( float indentW = 0.0f)

Moves the cursor right by indentW pixels.

Parameters
indentWIndent width (0 = use style default).

◆ init()

void kemena::kGuiManager::init ( kRenderer * newRenderer)

Initialises ImGui with the given renderer's context and window.

Parameters
newRendererRenderer whose SDL window and driver context are used.

◆ inputDouble()

bool kemena::kGuiManager::inputDouble ( kString label,
double * v,
double step = 0.0,
double stepFast = 0.0,
kString format = "%.6f",
ImGuiInputTextFlags flags = 0 )

Double-precision float input.

Returns
true if changed.

◆ inputFloat()

bool kemena::kGuiManager::inputFloat ( kString label,
float * v,
float step = 0.0f,
float stepFast = 0.0f,
kString format = "%.3f",
ImGuiInputTextFlags flags = 0 )

Single float input.

Returns
true if changed.

◆ inputFloat2()

bool kemena::kGuiManager::inputFloat2 ( kString label,
float v[2],
kString format = "%.3f",
ImGuiInputTextFlags flags = 0 )

Two-component float input.

Returns
true if changed.

◆ inputFloat3()

bool kemena::kGuiManager::inputFloat3 ( kString label,
float v[3],
kString format = "%.3f",
ImGuiInputTextFlags flags = 0 )

Three-component float input.

Returns
true if changed.

◆ inputFloat4()

bool kemena::kGuiManager::inputFloat4 ( kString label,
float v[4],
kString format = "%.3f",
ImGuiInputTextFlags flags = 0 )

Four-component float input.

Returns
true if changed.

◆ inputInt()

bool kemena::kGuiManager::inputInt ( kString label,
int * v,
int step = 1,
int stepFast = 100,
ImGuiInputTextFlags flags = 0 )

Single integer input.

Returns
true if changed.

◆ inputInt2()

bool kemena::kGuiManager::inputInt2 ( kString label,
int v[2],
ImGuiInputTextFlags flags = 0 )

Two-component integer input.

Returns
true if changed.

◆ inputInt3()

bool kemena::kGuiManager::inputInt3 ( kString label,
int v[3],
ImGuiInputTextFlags flags = 0 )

Three-component integer input.

Returns
true if changed.

◆ inputInt4()

bool kemena::kGuiManager::inputInt4 ( kString label,
int v[4],
ImGuiInputTextFlags flags = 0 )

Four-component integer input.

Returns
true if changed.

◆ inputText()

bool kemena::kGuiManager::inputText ( kString label,
kString & value,
size_t maxLength = 256,
ImGuiInputTextFlags flags = 0 )

Renders a single-line text input field.

Parameters
labelField label.
valueReference to the kString being edited.
maxLengthMaximum character count (default 256).
flagsImGuiInputTextFlags.
Returns
true if the value changed.

◆ inputTextMultiline()

bool kemena::kGuiManager::inputTextMultiline ( kString label,
kString & value,
size_t maxLength = 1024,
kVec2 size = kVec2(0, 0),
ImGuiInputTextFlags flags = 0 )

Renders a multi-line text input field.

Parameters
labelField label.
valueReference to the kString being edited.
maxLengthMaximum character count.
sizeWidget size (0 = auto).
flagsImGuiInputTextFlags.
Returns
true if the value changed.

◆ inputTextWithHint()

bool kemena::kGuiManager::inputTextWithHint ( kString label,
kString hint,
kString & value,
size_t maxLength = 256,
ImGuiInputTextFlags flags = 0 )

Renders a single-line text input with a placeholder hint.

Parameters
labelField label.
hintGreyed placeholder text shown when empty.
valueReference to the kString being edited.
maxLengthMaximum character count.
flagsImGuiInputTextFlags.
Returns
true if the value changed.

◆ invisibleButton()

bool kemena::kGuiManager::invisibleButton ( kString id,
kVec2 size,
ImGuiButtonFlags flags = 0 )

Renders an invisible hit-area button.

Parameters
idUnique identifier.
sizeButton size.
flagsImGuiButtonFlags.
Returns
true if clicked.

◆ isAnyItemActive()

bool kemena::kGuiManager::isAnyItemActive ( )

Returns whether any widget is currently active.

◆ isAnyItemFocused()

bool kemena::kGuiManager::isAnyItemFocused ( )

Returns whether any widget currently has focus.

◆ isAnyItemHovered()

bool kemena::kGuiManager::isAnyItemHovered ( )

Returns whether any widget is currently hovered.

◆ isItemActivated()

bool kemena::kGuiManager::isItemActivated ( )

Returns whether the last widget became active this frame.

◆ isItemActive()

bool kemena::kGuiManager::isItemActive ( )

Returns whether the last widget is active (e.g. being dragged).

◆ isItemClicked()

bool kemena::kGuiManager::isItemClicked ( ImGuiMouseButton mouseButton = 0)

Returns whether the last widget was clicked.

Parameters
mouseButtonMouse button index.

◆ isItemDeactivated()

bool kemena::kGuiManager::isItemDeactivated ( )

Returns whether the last widget became inactive this frame.

◆ isItemDeactivatedAfterEdit()

bool kemena::kGuiManager::isItemDeactivatedAfterEdit ( )

Returns whether the last widget became inactive after being edited.

◆ isItemEdited()

bool kemena::kGuiManager::isItemEdited ( )

Returns whether the last widget's value was edited this frame.

◆ isItemFocused()

bool kemena::kGuiManager::isItemFocused ( )

Returns whether the last widget has keyboard focus.

◆ isItemHovered()

bool kemena::kGuiManager::isItemHovered ( ImGuiHoveredFlags flags = 0)

Returns whether the last widget is hovered.

Parameters
flagsImGuiHoveredFlags.

◆ isItemToggledOpen()

bool kemena::kGuiManager::isItemToggledOpen ( )

Returns whether the last tree node was toggled open.

◆ isItemVisible()

bool kemena::kGuiManager::isItemVisible ( )

Returns whether the last widget is visible in the clipping rectangle.

◆ isKeyCtrl()

bool kemena::kGuiManager::isKeyCtrl ( )

Returns true if the Ctrl modifier key is currently held.

◆ isKeyShift()

bool kemena::kGuiManager::isKeyShift ( )

Returns true if the Shift modifier key is currently held.

◆ isMouseClicked()

bool kemena::kGuiManager::isMouseClicked ( ImGuiMouseButton button,
bool repeat = false )

Returns whether a mouse button was clicked this frame.

Parameters
buttonButton.
repeatEnable repeat.
Here is the call graph for this function:

◆ isMouseDoubleClicked()

bool kemena::kGuiManager::isMouseDoubleClicked ( ImGuiMouseButton button)

Returns whether a mouse button was double-clicked this frame.

Parameters
buttonButton.
Here is the call graph for this function:

◆ isMouseDown()

bool kemena::kGuiManager::isMouseDown ( ImGuiMouseButton button)

Returns whether a mouse button is held down.

Parameters
buttonImGuiMouseButton.
Here is the call graph for this function:

◆ isMouseHoveringRect()

bool kemena::kGuiManager::isMouseHoveringRect ( kVec2 rMin,
kVec2 rMax,
bool clip = true )

Returns whether the mouse is inside the given screen-space rectangle.

Parameters
rMinTop-left corner.
rMaxBottom-right corner.
clipWhether to clip by the current window's rect.

◆ isMouseReleased()

bool kemena::kGuiManager::isMouseReleased ( ImGuiMouseButton button)

Returns whether a mouse button was released this frame.

Parameters
buttonButton.
Here is the call graph for this function:

◆ isPopupOpen()

bool kemena::kGuiManager::isPopupOpen ( kString id,
ImGuiPopupFlags flags = 0 )

Returns whether a named popup is currently open.

Parameters
idPopup identifier.
flagsImGuiPopupFlags.
Returns
true if open.

◆ isWindowFocused()

bool kemena::kGuiManager::isWindowFocused ( ImGuiFocusedFlags flags = 0)

Returns whether the current window has keyboard focus.

Parameters
flagsImGuiFocusedFlags.
Returns
true if focused.

◆ isWindowHovered()

bool kemena::kGuiManager::isWindowHovered ( ImGuiHoveredFlags flags = 0)

Returns whether the mouse is hovering over the current window.

Parameters
flagsImGuiHoveredFlags.
Returns
true if hovered.

◆ labelText()

void kemena::kGuiManager::labelText ( kString label,
kString text )

Renders a label/value pair aligned to the value column.

Parameters
labelColumn label.
textValue text.
Here is the call graph for this function:

◆ listBox()

bool kemena::kGuiManager::listBox ( kString label,
int * currentItem,
std::vector< kString > items,
int heightInItems = -1 )

Scrollable list box.

Parameters
labelWidget label.
currentItemPointer to the selected index.
itemsList of option strings.
heightInItemsVisible row count (-1 = auto).
Returns
true if the selection changed.

◆ loadDefaultFontFromResource()

void kemena::kGuiManager::loadDefaultFontFromResource ( kString resourceName)

Loads and sets the default ImGui font from a Windows resource.

Parameters
resourceNameResource identifier for the .ttf font data.

◆ loadIniSettingsFromDisk()

void kemena::kGuiManager::loadIniSettingsFromDisk ( kString filename)

Loads ImGui layout state from a .ini file.

Parameters
filenamePath to the .ini file.

◆ loadIniSettingsFromMemory()

void kemena::kGuiManager::loadIniSettingsFromMemory ( const char * data,
size_t size )

Loads ImGui layout state from an in-memory .ini blob.

Parameters
dataPointer to the ini text data.
sizeNumber of bytes to read.

◆ menu()

bool kemena::kGuiManager::menu ( kString text)

Begins a named menu.

Parameters
textMenu label.
Returns
true if the menu is open.
Here is the call graph for this function:

◆ menuBar()

bool kemena::kGuiManager::menuBar ( )

Begins the main menu bar.

Returns
true if the bar is visible.

◆ menuBarEnd()

void kemena::kGuiManager::menuBarEnd ( )

Ends the main menu bar.

◆ menuEnd()

void kemena::kGuiManager::menuEnd ( )

Ends the current menu.

◆ menuItem() [1/2]

bool kemena::kGuiManager::menuItem ( kString text,
kString shortcut,
bool * selected,
bool enabled = true )

Adds a toggleable menu item backed by a bool.

Parameters
textItem label.
shortcutShortcut hint.
selectedPointer to the toggle state.
enabledWhether the item is interactive.
Returns
true if the item was clicked.
Here is the call graph for this function:

◆ menuItem() [2/2]

bool kemena::kGuiManager::menuItem ( kString text,
kString shortcut = "",
bool selected = false,
bool enabled = true )

Adds a clickable menu item.

Parameters
textItem label.
shortcutShortcut hint displayed on the right (display only).
selectedWhether the item appears checked.
enabledWhether the item is interactive.
Returns
true if the item was clicked.
Here is the call graph for this function:

◆ newLine()

void kemena::kGuiManager::newLine ( )

Inserts a blank line in the layout.

◆ nextColumn()

void kemena::kGuiManager::nextColumn ( )

Advances to the next column (wraps to the next row when needed).

◆ openPopup()

void kemena::kGuiManager::openPopup ( kString id,
ImGuiPopupFlags flags = 0 )

Opens a named popup on the next frame.

Parameters
idPopup identifier.
flagsImGuiPopupFlags.

◆ popFont()

void kemena::kGuiManager::popFont ( )

Pops the last font from the font stack.

◆ popId()

void kemena::kGuiManager::popId ( )

Pops the last ID from the ID stack.

◆ popItemWidth()

void kemena::kGuiManager::popItemWidth ( )

Pops the last item width from the stack.

◆ popStyleColor()

void kemena::kGuiManager::popStyleColor ( int count = 1)

Pops colour overrides from the style stack.

Parameters
countNumber of colour entries to pop (default 1).

◆ popStyleVar()

void kemena::kGuiManager::popStyleVar ( int count = 1)

Pops style variable overrides from the stack.

Parameters
countNumber of entries to pop (default 1).

◆ popTextWrapPos()

void kemena::kGuiManager::popTextWrapPos ( )

Pops the last text wrap position.

◆ popupContextItemStart()

bool kemena::kGuiManager::popupContextItemStart ( kString id = "",
ImGuiPopupFlags flags = ImGuiPopupFlags_MouseButtonRight )

Begins a context menu popup on right-click of the last item.

Parameters
idPopup identifier.
flagsImGuiPopupFlags.
Returns
true if the context menu opened.

◆ popupContextWindowStart()

bool kemena::kGuiManager::popupContextWindowStart ( kString id = "",
ImGuiPopupFlags flags = ImGuiPopupFlags_MouseButtonRight )

Begins a context menu popup on right-click of the current window.

Parameters
idPopup identifier.
flagsImGuiPopupFlags.
Returns
true if the context menu opened.

◆ popupEnd()

void kemena::kGuiManager::popupEnd ( )

Ends the current popup.

◆ popupModal()

bool kemena::kGuiManager::popupModal ( kString name,
bool * open = nullptr,
ImGuiWindowFlags flags = 0 )

Begins a modal popup dialog.

Parameters
nameDialog title.
openOptional pointer to the open/close bool.
flagsImGuiWindowFlags.
Returns
true while the modal is open.

◆ popupStart()

bool kemena::kGuiManager::popupStart ( kString id,
ImGuiWindowFlags flags = 0 )

Begins rendering a named popup.

Parameters
idPopup identifier.
flagsImGuiWindowFlags.
Returns
true if the popup is open.

◆ processEvent()

void kemena::kGuiManager::processEvent ( kSystemEvent event)

Forwards a system event to ImGui for input processing.

Parameters
eventEngine event struct wrapping the underlying SDL event.

◆ progressBar()

void kemena::kGuiManager::progressBar ( float fraction,
kVec2 size = kVec2(-FLT_MIN, 0),
kString overlay = "" )

Renders a horizontal progress bar.

Parameters
fractionValue in [0, 1] representing progress.
sizeBar size (-FLT_MIN width = fill available).
overlayOptional text drawn over the bar.

◆ pushFont()

void kemena::kGuiManager::pushFont ( ImFont * font)

Pushes a font onto the font stack.

Parameters
fontImFont pointer loaded via ImGui::GetIO().Fonts.

◆ pushId() [1/3]

void kemena::kGuiManager::pushId ( const void * ptr)

Pushes a pointer ID onto the ID stack.

Parameters
ptrPointer used as ID.

◆ pushId() [2/3]

void kemena::kGuiManager::pushId ( int id)

Pushes an integer ID onto the ID stack.

Parameters
idInteger ID.

◆ pushId() [3/3]

void kemena::kGuiManager::pushId ( kString id)

Pushes a kString ID onto the ID stack.

Parameters
idID kString.

◆ pushItemWidth()

void kemena::kGuiManager::pushItemWidth ( float itemWidth)

Pushes a width onto the item-width stack.

Parameters
itemWidthWidth in pixels.

◆ pushStyleColor() [1/2]

void kemena::kGuiManager::pushStyleColor ( ImGuiCol idx,
ImU32 color )

Pushes a packed colour override.

Parameters
idxImGuiCol element.
colorPacked ABGR colour.

◆ pushStyleColor() [2/2]

void kemena::kGuiManager::pushStyleColor ( ImGuiCol idx,
kVec4 color )

Pushes a colour override for an ImGui style element.

Parameters
idxImGuiCol element to override.
colorRGBA colour.

◆ pushStyleVar() [1/2]

void kemena::kGuiManager::pushStyleVar ( ImGuiStyleVar idx,
float val )

Pushes a float style variable override.

Parameters
idxImGuiStyleVar to override.
valNew value.

◆ pushStyleVar() [2/2]

void kemena::kGuiManager::pushStyleVar ( ImGuiStyleVar idx,
kVec2 val )

Pushes a kVec2 style variable override.

Parameters
idxImGuiStyleVar to override.
valNew value.

◆ pushTextWrapPos()

void kemena::kGuiManager::pushTextWrapPos ( float wrapLocalPosX = 0.0f)

Pushes a text wrap position onto the stack.

Parameters
wrapLocalPosXX position to wrap at (0 = wrap at window right).

◆ radioButton() [1/2]

bool kemena::kGuiManager::radioButton ( kString label,
bool active )

Renders a radio button.

Parameters
labelButton label.
activeWhether this button is currently selected.
Returns
true if clicked.

◆ radioButton() [2/2]

bool kemena::kGuiManager::radioButton ( kString label,
int * v,
int vButton )

Renders a radio button linked to an integer variable.

Parameters
labelButton label.
vPointer to the current selection value.
vButtonValue this button represents.
Returns
true if clicked.

◆ sameLine()

void kemena::kGuiManager::sameLine ( float offsetFromStartX = 0.0f,
float spacing = -1.0f )

Places the next widget on the same line as the previous one.

Parameters
offsetFromStartXHorizontal offset from the left edge (0 = auto).
spacingSpacing override (-1 = default).
Here is the call graph for this function:

◆ saveIniSettingsToDisk()

void kemena::kGuiManager::saveIniSettingsToDisk ( kString filename)

Saves the current ImGui layout state to a .ini file.

Parameters
filenamePath to the .ini file.

◆ selectable() [1/2]

bool kemena::kGuiManager::selectable ( kString label,
bool * pSelected,
ImGuiSelectableFlags flags = 0,
kVec2 size = kVec2(0, 0) )

Selectable row (state passed by pointer).

Parameters
labelRow label.
pSelectedPointer to the selection bool.
flagsImGuiSelectableFlags.
sizeRow size.
Returns
true if clicked.

◆ selectable() [2/2]

bool kemena::kGuiManager::selectable ( kString label,
bool selected = false,
ImGuiSelectableFlags flags = 0,
kVec2 size = kVec2(0, 0) )

Selectable row (state passed by value).

Parameters
labelRow label.
selectedWhether this row is currently selected.
flagsImGuiSelectableFlags.
sizeRow size (0 = fill available).
Returns
true if clicked.

◆ separator()

void kemena::kGuiManager::separator ( )

Draws a horizontal separator line.

◆ separatorText()

void kemena::kGuiManager::separatorText ( kString text)

Draws a horizontal separator with a centred text label.

Parameters
textLabel to display.
Here is the call graph for this function:

◆ setClipboardText()

void kemena::kGuiManager::setClipboardText ( kString text)

Sets the OS clipboard text.

Parameters
textText to place in the clipboard.
Here is the call graph for this function:

◆ setColorEditOptions()

void kemena::kGuiManager::setColorEditOptions ( ImGuiColorEditFlags flags)

Sets global colour edit display options.

Parameters
flagsImGuiColorEditFlags combination.

◆ setCursorPos()

void kemena::kGuiManager::setCursorPos ( kVec2 pos)

Moves the cursor to an absolute position within the window.

Parameters
posPosition relative to the window content region.

◆ setCursorPosX()

void kemena::kGuiManager::setCursorPosX ( float x)

Sets the cursor X position.

Parameters
xX offset in pixels.

◆ setCursorPosY()

void kemena::kGuiManager::setCursorPosY ( float y)

Sets the cursor Y position.

Parameters
yY offset in pixels.

◆ setCursorScreenPos()

void kemena::kGuiManager::setCursorScreenPos ( kVec2 pos)

Moves the cursor to an absolute screen-space position.

Parameters
posAbsolute screen-space coordinates.

◆ setItemTooltip()

void kemena::kGuiManager::setItemTooltip ( kString text)

Sets a tooltip shown when the last item is hovered.

Parameters
textTooltip text.
Here is the call graph for this function:

◆ setNextItemAllowOverlap()

void kemena::kGuiManager::setNextItemAllowOverlap ( )

Allows the next item to overlap previously drawn items. Call this before the item that should allow overlap.

◆ setNextItemOpen()

void kemena::kGuiManager::setNextItemOpen ( bool isOpen,
ImGuiCond cond = 0 )

Sets the open state of the next tree node.

Parameters
isOpenWhether the node should be open.
condCondition flag.

◆ setNextItemWidth()

void kemena::kGuiManager::setNextItemWidth ( float itemWidth)

Sets the width of the next widget.

Parameters
itemWidthWidth in pixels (negative values right-align).

◆ setNextWindowBgAlpha()

void kemena::kGuiManager::setNextWindowBgAlpha ( float alpha)

Sets the background transparency of the next window.

Parameters
alphaAlpha value in [0, 1].

◆ setNextWindowCollapsed()

void kemena::kGuiManager::setNextWindowCollapsed ( bool collapsed,
ImGuiCond cond = 0 )

Sets the collapsed state of the next window.

Parameters
collapsedtrue to start collapsed.
condCondition flag.

◆ setNextWindowContentSize()

void kemena::kGuiManager::setNextWindowContentSize ( kVec2 size)

Sets the content size of the next window.

Parameters
sizeContent region size in pixels.

◆ setNextWindowFocus()

void kemena::kGuiManager::setNextWindowFocus ( )

Gives input focus to the next window.

◆ setNextWindowPos()

void kemena::kGuiManager::setNextWindowPos ( kVec2 pos,
ImGuiCond cond = 0,
kVec2 pivot = kVec2(0, 0) )

Sets the position of the next window before it is created.

Parameters
posDesired screen-space position.
condCondition flag.
pivotNormalised pivot point within the window.

◆ setNextWindowSize()

void kemena::kGuiManager::setNextWindowSize ( kVec2 size,
ImGuiCond cond = 0 )

Sets the size of the next window before it is created.

Parameters
sizeDesired window size in pixels.
condCondition flag (ImGuiCond).

◆ setScrollHereX()

void kemena::kGuiManager::setScrollHereX ( float centerXRatio = 0.5f)

Scrolls so the current item is visible horizontally.

Parameters
centerXRatio0 = left edge, 0.5 = centre, 1 = right edge.

◆ setScrollHereY()

void kemena::kGuiManager::setScrollHereY ( float centerYRatio = 0.5f)

Scrolls so the current item is visible vertically.

Parameters
centerYRatio0 = top edge, 0.5 = centre, 1 = bottom edge.

◆ setScrollX()

void kemena::kGuiManager::setScrollX ( float scrollX)

Sets the horizontal scroll position.

Parameters
scrollXTarget position.

◆ setScrollY()

void kemena::kGuiManager::setScrollY ( float scrollY)

Sets the vertical scroll position.

Parameters
scrollYTarget position.

◆ setTabItemClosed()

void kemena::kGuiManager::setTabItemClosed ( kString tabOrDockedWindowLabel)

Marks a tab (or docked window) as closed programmatically.

Parameters
tabOrDockedWindowLabelLabel of the tab or window to close.

◆ sliderAngle()

bool kemena::kGuiManager::sliderAngle ( kString label,
float * vRad,
float vDegreesMin = -360.0f,
float vDegreesMax = 360.0f,
kString format = "%.0f deg",
ImGuiSliderFlags flags = 0 )

Horizontal slider that displays and edits an angle in degrees.

Returns
true if changed.

◆ sliderFloat()

bool kemena::kGuiManager::sliderFloat ( kString label,
float * v,
float min,
float max,
kString format = "%.3f",
ImGuiSliderFlags flags = 0 )

Horizontal slider for a single float.

Returns
true if changed.

◆ sliderFloat2()

bool kemena::kGuiManager::sliderFloat2 ( kString label,
float v[2],
float min,
float max,
kString format = "%.3f",
ImGuiSliderFlags flags = 0 )

Horizontal slider for two floats.

Returns
true if changed.

◆ sliderFloat3()

bool kemena::kGuiManager::sliderFloat3 ( kString label,
float v[3],
float min,
float max,
kString format = "%.3f",
ImGuiSliderFlags flags = 0 )

Horizontal slider for three floats.

Returns
true if changed.

◆ sliderFloat4()

bool kemena::kGuiManager::sliderFloat4 ( kString label,
float v[4],
float min,
float max,
kString format = "%.3f",
ImGuiSliderFlags flags = 0 )

Horizontal slider for four floats.

Returns
true if changed.

◆ sliderInt()

bool kemena::kGuiManager::sliderInt ( kString label,
int * v,
int min,
int max,
kString format = "%d",
ImGuiSliderFlags flags = 0 )

Horizontal slider for a single integer.

Returns
true if changed.

◆ sliderInt2()

bool kemena::kGuiManager::sliderInt2 ( kString label,
int v[2],
int min,
int max,
kString format = "%d",
ImGuiSliderFlags flags = 0 )

Horizontal slider for two integers.

Returns
true if changed.

◆ sliderInt3()

bool kemena::kGuiManager::sliderInt3 ( kString label,
int v[3],
int min,
int max,
kString format = "%d",
ImGuiSliderFlags flags = 0 )

Horizontal slider for three integers.

Returns
true if changed.

◆ sliderInt4()

bool kemena::kGuiManager::sliderInt4 ( kString label,
int v[4],
int min,
int max,
kString format = "%d",
ImGuiSliderFlags flags = 0 )

Horizontal slider for four integers.

Returns
true if changed.

◆ smallButton()

bool kemena::kGuiManager::smallButton ( kString text)

Renders a small inline push-button.

Parameters
textLabel text.
Returns
true if clicked.
Here is the call graph for this function:

◆ spacing()

void kemena::kGuiManager::spacing ( )

Inserts a small vertical space.

Here is the caller graph for this function:

◆ tabBarEnd()

void kemena::kGuiManager::tabBarEnd ( )

Ends the current tab bar.

◆ tabBarStart()

bool kemena::kGuiManager::tabBarStart ( kString id,
ImGuiTabBarFlags flags = 0 )

Begins a tab bar container.

Parameters
idUnique identifier.
flagsImGuiTabBarFlags.
Returns
true if the tab bar is visible.

◆ tabItemEnd()

void kemena::kGuiManager::tabItemEnd ( )

Ends the current tab item.

◆ tabItemStart()

bool kemena::kGuiManager::tabItemStart ( kString label,
bool * open = nullptr,
ImGuiTabItemFlags flags = 0 )

Begins a tab item inside a tab bar.

Parameters
labelItem label.
openOptional pointer to a bool controlling the close button.
flagsImGuiTabItemFlags.
Returns
true if this tab is active.

◆ tableEnd()

void kemena::kGuiManager::tableEnd ( )

Ends the current table.

◆ tableHeader()

void kemena::kGuiManager::tableHeader ( kString label)

Renders a single header cell.

Parameters
labelHeader cell label.

◆ tableHeadersRow()

void kemena::kGuiManager::tableHeadersRow ( )

Renders the header row using labels set by tableSetupColumn().

◆ tableNextColumn()

bool kemena::kGuiManager::tableNextColumn ( )

Advances to the next column in the current row.

Returns
true if the column is visible.

◆ tableNextRow()

void kemena::kGuiManager::tableNextRow ( ImGuiTableRowFlags rowFlags = 0,
float minRowHeight = 0.0f )

Begins a new table row.

Parameters
rowFlagsImGuiTableRowFlags.
minRowHeightMinimum row height in pixels.

◆ tableSetColumnIndex()

bool kemena::kGuiManager::tableSetColumnIndex ( int columnN)

Sets the current column index explicitly.

Parameters
columnNZero-based column index.
Returns
true if the column is visible.

◆ tableSetupColumn()

void kemena::kGuiManager::tableSetupColumn ( kString label,
ImGuiTableColumnFlags flags = 0,
float initWidthOrWeight = 0.0f )

Sets up a table column with optional flags and initial width.

Parameters
labelColumn header label.
flagsImGuiTableColumnFlags.
initWidthOrWeightInitial width (fixed) or weight (stretch).

◆ tableSetupScrollFreeze()

void kemena::kGuiManager::tableSetupScrollFreeze ( int cols,
int rows )

Freezes leading columns/rows so they remain visible while scrolling.

Parameters
colsNumber of columns to freeze.
rowsNumber of rows to freeze.

◆ tableStart()

bool kemena::kGuiManager::tableStart ( kString id,
int columns,
ImGuiTableFlags flags = 0,
kVec2 outerSize = kVec2(0, 0),
float innerWidth = 0.0f )

Begins a table layout.

Parameters
idUnique identifier.
columnsNumber of columns.
flagsImGuiTableFlags.
outerSizeOuter size constraint (0 = auto).
innerWidthInner horizontal scrolling width.
Returns
true if the table is visible.

◆ text()

void kemena::kGuiManager::text ( kString text)

Renders a plain text kString.

Parameters
textText to display.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ textColored()

void kemena::kGuiManager::textColored ( kVec4 color,
kString text )

Renders coloured text.

Parameters
colorRGBA text colour.
textText to display.
Here is the call graph for this function:

◆ textDisabled()

void kemena::kGuiManager::textDisabled ( kString text)

Renders greyed-out (disabled) text.

Parameters
textText to display.
Here is the call graph for this function:

◆ textUnformatted()

void kemena::kGuiManager::textUnformatted ( kString text)

Renders a raw string without label formatting.

Here is the call graph for this function:

◆ textWrapped()

void kemena::kGuiManager::textWrapped ( kString text)

Renders text that wraps at the wrap position.

Parameters
textText.
Here is the call graph for this function:

◆ treeEnd()

void kemena::kGuiManager::treeEnd ( )

Ends the current tree node (use when treeStart returned true).

◆ treePop()

void kemena::kGuiManager::treePop ( )

Pops the tree indent regardless of whether the node is open.

◆ treeStart()

bool kemena::kGuiManager::treeStart ( kString label)

Begins a tree node (uses label as ID).

Parameters
labelNode label.
Returns
true if the node is expanded.

◆ treeStartEx()

bool kemena::kGuiManager::treeStartEx ( kString id,
kString label = "",
ImGuiTreeNodeFlags flags = 0 )

Begins a tree node with explicit ID and label.

Parameters
idUnique ID kString.
labelDisplay label (empty = use id).
flagsImGuiTreeNodeFlags.
Returns
true if the node is expanded.

◆ unindent()

void kemena::kGuiManager::unindent ( float indentW = 0.0f)

Moves the cursor left by indentW pixels.

Parameters
indentWUnindent width (0 = use style default).

◆ windowEnd()

void kemena::kGuiManager::windowEnd ( )

Ends the current ImGui window.

◆ windowStart()

void kemena::kGuiManager::windowStart ( kString title,
bool * open = nullptr,
ImGuiWindowFlags flags = 0 )

Begins an ImGui window.

Parameters
titleWindow title bar text.
openOptional pointer to a bool controlling visibility; nullptr to ignore.
flagsImGuiWindowFlags combination.

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