Skip to content

GUI ​

Classes ​

Name
structGUI::InputTextCallback_UserData

Functions ​

Name
boolButton(const char * id, bool disabled, const ImVec2 & size)
boolButtonWithCorners(const char * label, ImDrawFlags corners, const ImVec2 & size_arg)
boolButtonWithCornersEx(const char * label, ImDrawFlags corners, const ImVec2 & size_arg, ImGuiButtonFlags flags)
floatcalculateDataItemsWidth(float fontSize, int maxCharacters, float zoom =1.0f)<br>Works out pixel width of data items based on the provided parameters.
glm::vec2convertCoordinates(glm::vec2 position, glm::vec2 newOrigin)
boolDimButton(const char * label, const ImVec2 & size)
boolDimButtonDark(const char * label, const ImVec2 & size)
voiddockTabStylePop()
voiddockTabStylePush()<br>Sets style for the tab of a dockable window.
voiddrawCross(glm::vec2 pos, ImDrawList * drawList, float thickness, float size, ImColor color)
voiddrawEllipse(float cx, float cy, float rx, float ry, int num_segments, ImDrawList * drawList, ImColor color, float thickness)
boolDrawFloat(const std::string & label, float & value, int numberOfVisibleDecimals, Core::EValueState const & valueState, bool & valueChanged)
boolDrawMatrix(const char * label, const glm::mat4 & data, int numberOfVisibleDecimals)
boolDrawMatrix(const char * label, const glm::mat4 & data, int numberOfVisibleDecimals, const std::array< std::array< Core::EValueState, 4 > const, 4 > & dataState, bool & valueChanged, int & rowOfChange, int & columnOfChange, float & valueOfChange)
boolDrawMatrix(const char * label, const glm::mat4 & data, int numberOfVisibleDecimals, Core::EValueState valState, bool & valueChanged, int & rowOfChange, int & columnOfChange, float & valueOfChange)
boolequalsRect(const ImRect & a, const ImRect & b)
boolequalsVec(const ImVec2 & a, const ImVec2 & b)
boolFloatingButton(const char * label, const ImVec2 & size)
boolFloatingButtonDark(const char * label, const ImVec2 & size, float rounding)
boolFloatingToggleButton(const char * label, bool & toggled, bool invert, const ImVec2 & size)
ImVec2floorImVec2(const ImVec2 & v)
ImVec2glmToIm(const glm::vec2 & v)
ImVec4glmToIm(const glm::vec4 & v)
glm::vec2imToGlm(const ImVec2 & v)
glm::vec4imToGlm(const ImVec4 & v)
boolInputText(const char * label, std::string * str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void * user_data)
intInputTextCallback(ImGuiInputTextCallbackData * data)
boolItemTooltip(const char * header, const char * description =nullptr, ImGuiHoveredFlags hoverFlags =ImGuiHoveredFlags_ForTooltip)<br>Makes the last submitted ImGui item have a tooltip.
intmaxLengthOfData4x4(const glm::mat4 & data, int numberOfVisibleDecimal)
intnumberOfCharWithDecimalPoint(float value, int numberOfVisibleDecimal)
voidPopFontScale(float oldScale)
floatPushFontScale(float newScale)
voidRenderFrameWithCorners(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding, ImDrawFlags corners)
boolSliderFloatStepped(const char * label, float * v, float step, float v_min, float v_max, const std::string & format)<br>A float slider that is limited to individual steps ImGui doesn't support this by default so this is actually an IntSlider that recalculates back into a float.
voidText(const char * text, EFont font)
voidText(const char * text, ImFont * font)
voidTextCentered(const char * text, ImRect rect, ImU32 col)
voidTextColoredShadow(const char * text, const ImVec4 & color)
voidTextColoredShadowCentered(const char * text, const ImVec4 & color, float width)
voidTextShadow(const char * text)
boolToggleButton(const char * label, bool & toggled, bool invert, ImVec2 size)
voidTooltip(const char * header, const char * description =nullptr)
std::stringTruncateText(const std::string & p_text, float p_truncated_width)<br>Sourced from https://github.com/ocornut/imgui/issues/5267, credit to Gl1tchs.

Functions Documentation ​

function Button ​

cpp
bool Button(
    const char * id,
    bool disabled,
    const ImVec2 & size
)

function ButtonWithCorners ​

cpp
bool ButtonWithCorners(
    const char * label,
    ImDrawFlags corners,
    const ImVec2 & size_arg
)

function ButtonWithCornersEx ​

cpp
bool ButtonWithCornersEx(
    const char * label,
    ImDrawFlags corners,
    const ImVec2 & size_arg,
    ImGuiButtonFlags flags
)

function calculateDataItemsWidth ​

cpp
float calculateDataItemsWidth(
    float fontSize,
    int maxCharacters,
    float zoom =1.0f
)

Works out pixel width of data items based on the provided parameters.

Parameters:

  • fontSize Current font size in pixels
  • maxCharacters Max number of characters/numerals any data item value has
  • zoom Zoom/scaling level

Return: The desired data item width in pixels

function convertCoordinates ​

cpp
inline glm::vec2 convertCoordinates(
    glm::vec2 position,
    glm::vec2 newOrigin
)

function DimButton ​

cpp
bool DimButton(
    const char * label,
    const ImVec2 & size
)

function DimButtonDark ​

cpp
bool DimButtonDark(
    const char * label,
    const ImVec2 & size
)

function dockTabStylePop ​

cpp
void dockTabStylePop()

function dockTabStylePush ​

cpp
void dockTabStylePush()

Sets style for the tab of a dockable window.

This method should be called after the ImGui::Begin call of a dockable window. Style needs to be popped afterwards with dockTabStylePop() Note that this style affects regular ImGui tabs, the style needs to be popped before using those in the dockable window.

function drawCross ​

cpp
void drawCross(
    glm::vec2 pos,
    ImDrawList * drawList,
    float thickness,
    float size,
    ImColor color
)

function drawEllipse ​

cpp
void drawEllipse(
    float cx,
    float cy,
    float rx,
    float ry,
    int num_segments,
    ImDrawList * drawList,
    ImColor color,
    float thickness
)

function DrawFloat ​

cpp
bool DrawFloat(
    const std::string & label,
    float & value,
    int numberOfVisibleDecimals,
    Core::EValueState const & valueState,
    bool & valueChanged
)

function DrawMatrix ​

cpp
bool DrawMatrix(
    const char * label,
    const glm::mat4 & data,
    int numberOfVisibleDecimals
)

function DrawMatrix ​

cpp
bool DrawMatrix(
    const char * label,
    const glm::mat4 & data,
    int numberOfVisibleDecimals,
    const std::array< std::array< Core::EValueState, 4 > const, 4 > & dataState,
    bool & valueChanged,
    int & rowOfChange,
    int & columnOfChange,
    float & valueOfChange
)

function DrawMatrix ​

cpp
bool DrawMatrix(
    const char * label,
    const glm::mat4 & data,
    int numberOfVisibleDecimals,
    Core::EValueState valState,
    bool & valueChanged,
    int & rowOfChange,
    int & columnOfChange,
    float & valueOfChange
)

function equalsRect ​

cpp
inline bool equalsRect(
    const ImRect & a,
    const ImRect & b
)

function equalsVec ​

cpp
inline bool equalsVec(
    const ImVec2 & a,
    const ImVec2 & b
)

function FloatingButton ​

cpp
bool FloatingButton(
    const char * label,
    const ImVec2 & size
)

function FloatingButtonDark ​

cpp
bool FloatingButtonDark(
    const char * label,
    const ImVec2 & size,
    float rounding
)

function FloatingToggleButton ​

cpp
bool FloatingToggleButton(
    const char * label,
    bool & toggled,
    bool invert,
    const ImVec2 & size
)

function floorImVec2 ​

cpp
inline ImVec2 floorImVec2(
    const ImVec2 & v
)

function glmToIm ​

cpp
inline ImVec2 glmToIm(
    const glm::vec2 & v
)

function glmToIm ​

cpp
inline ImVec4 glmToIm(
    const glm::vec4 & v
)

function imToGlm ​

cpp
inline glm::vec2 imToGlm(
    const ImVec2 & v
)

function imToGlm ​

cpp
inline glm::vec4 imToGlm(
    const ImVec4 & v
)

function InputText ​

cpp
bool InputText(
    const char * label,
    std::string * str,
    ImGuiInputTextFlags flags,
    ImGuiInputTextCallback callback,
    void * user_data
)

function InputTextCallback ​

cpp
static int InputTextCallback(
    ImGuiInputTextCallbackData * data
)

function ItemTooltip ​

cpp
inline bool ItemTooltip(
    const char * header,
    const char * description =nullptr,
    ImGuiHoveredFlags hoverFlags =ImGuiHoveredFlags_ForTooltip
)

Makes the last submitted ImGui item have a tooltip.

Return: If the tooltip is showing.

By default, the standard tooltip settings are applied. Tooltip hover options can be modifed, for example to make the tooltip appearing delay longer: hoverFlags = ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_Stationary Tooltip hover delay (what normal / short delay means) can be set in ImGuiStyle.

function maxLengthOfData4x4 ​

cpp
int maxLengthOfData4x4(
    const glm::mat4 & data,
    int numberOfVisibleDecimal
)

function numberOfCharWithDecimalPoint ​

cpp
int numberOfCharWithDecimalPoint(
    float value,
    int numberOfVisibleDecimal
)

function PopFontScale ​

cpp
inline void PopFontScale(
    float oldScale
)

function PushFontScale ​

cpp
inline float PushFontScale(
    float newScale
)

function RenderFrameWithCorners ​

cpp
void RenderFrameWithCorners(
    ImVec2 p_min,
    ImVec2 p_max,
    ImU32 fill_col,
    bool border,
    float rounding,
    ImDrawFlags corners
)

function SliderFloatStepped ​

cpp
bool SliderFloatStepped(
    const char * label,
    float * v,
    float step,
    float v_min,
    float v_max,
    const std::string & format
)

A float slider that is limited to individual steps ImGui doesn't support this by default so this is actually an IntSlider that recalculates back into a float.

Uses std::format syntax for the format string, not printf (eg. {:.2f})

function Text ​

cpp
inline void Text(
    const char * text,
    EFont font
)

function Text ​

cpp
inline void Text(
    const char * text,
    ImFont * font
)

function TextCentered ​

cpp
inline void TextCentered(
    const char * text,
    ImRect rect,
    ImU32 col
)

function TextColoredShadow ​

cpp
inline void TextColoredShadow(
    const char * text,
    const ImVec4 & color
)

function TextColoredShadowCentered ​

cpp
inline void TextColoredShadowCentered(
    const char * text,
    const ImVec4 & color,
    float width
)

function TextShadow ​

cpp
inline void TextShadow(
    const char * text
)

function ToggleButton ​

cpp
bool ToggleButton(
    const char * label,
    bool & toggled,
    bool invert,
    ImVec2 size
)

function Tooltip ​

cpp
inline void Tooltip(
    const char * header,
    const char * description =nullptr
)

function TruncateText ​

cpp
std::string TruncateText(
    const std::string & p_text,
    float p_truncated_width
)

Sourced from https://github.com/ocornut/imgui/issues/5267, credit to Gl1tchs.


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