UI namespace

Contents

Enums

enum WindowFlags { NoTitleBar = 1, NoResize = 2, NoMove = 4, NoScrollbar = 8, NoScrollWithMouse = 16, NoCollapse = 32, AlwaysAutoResize = 64, NoSavedSettings = 256, MenuBar = 1024, HorizontalScrollbar = 2048, NoFocusOnAppearing = 4096, NoBringToFrontOnFocus = 8192, AlwaysVerticalScrollbar = 16384, AlwaysHorizontalScrollbar = 32768, AlwaysUseWindowPadding = 65536, NoNavInputs = 262144, NoNavFocus = 524288, UnsavedDocument = 1048576, NoDocking = 2097152, NoNav = 786432, NoDecoration = 43, NoInputs = 786944 }
Window flags that can be passed to UI::Begin().
enum ComboFlags { None = 0, PopupAlignLeft = 1, HeightSmall = 2, HeightRegular = 4, HeightLarge = 8, HeightLargest = 16, NoArrowButton = 32, NoPreview = 64 }
Combo flags that can be passed to UI::BeginCombo().
enum SelectableFlags { None = 0, DontClosePopups = 1, SpanAllColumns = 2, AllowDoubleClick = 4 }
Selectable flags that can be passed to UI::Selectable().
enum Cond { Always = 1, Once = 2, FirstUseEver = 4, Appearing = 8 }
Conditions for certain UI set operations.
enum DockNodeFlags { None = 0, KeepAliveOnly = 1, NoSplit = 16, NoDockingInCentralNode = 4, NoResize = 2, PassthruCentralNode = 8 }
enum Dir { None = 0, Left = 0, Right = 1, Up = 2, Down = 3 }

Functions

auto GetID(const string& id) -> uint32
Gets an ID in the current scope.
auto Begin(const string& title, int32 flags = UI::WindowFlags::NoCollapse) -> bool
Begins an imgui window.
auto Begin(const string& title, bool& open, int32 flags = UI::WindowFlags::NoCollapse) -> bool
Begins an imgui window.
void End()
Ends an imgui window.
void SetNextWindowSize(int32 w, int32 h, Cond cond = UI::Cond::Appearing)
Sets the size for the next window created with UI::Begin().
void SetNextWindowPos(int32 x, int32 y, Cond cond = UI::Cond::Appearing, float pivotx = 0.0f, float pivoty = 0.0f)
Sets the position for the next window created with UI::Begin(). Pivot floats can be used to align the window on the given point.
void SetNextWindowDockID(const string& id, Cond cond = UI::Cond::Appearing)
Sets the docking container for the next window created with UI::Begin().
void PushID(const AnyType&)
Pushes an ID to the stack.
void PushID(const string& id)
Pushes an ID to the stack.
void PopID()
Pops an ID from the stack.
void SameLine()
Marks the next control to be drawn on the same line as the last one.
void NewLine()
Marks the next control to be drawn on the next line rather than the current line.
auto Button(const string& label) -> bool
Clickable button. Returns true if it was clicked.
void Text(const string& text)
Simple text label.
void TextDisabled(const string& text)
Simple text label, but in its disabled color.
void BulletText(const string& text)
Simple text label with a bullet before it.
void LabelText(const string& label, const string& text)
Text label with a value.
void PlotLines(const string& label, array<float>* values)
Line graph.
auto Checkbox(const string& label, bool value) -> bool
Checkbox. For value, pass the current value. The return value is the new value.
auto BeginMenuBar() -> bool
Begins an imgui menu bar.
void EndMenuBar()
Ends an imgui menu bar.
auto BeginMenu(const string& label, bool enabled = true) -> bool
Begins an imgui menu.
void EndMenu()
Ends an imgui menu.
auto MenuItem(const string& label, const string& shortcut = "", bool selected = false, bool enabled = true) -> bool
Clickable menu item. Returns true when clicked.
void Separator()
A separator.
auto TreeNode(const string& text) -> bool
Node in a tree list. Returns true if opened.
void TreePop()
End of the previously tree node. Must only be called if TreeNode() returned true.
void TreeAdvanceToLabelPos()
Advance the cursor position to the normal label position for tree nodes.
auto CollapsingHeader(const string& label) -> bool
Collapsable header. Returns true if open.
auto IsItemHovered() -> bool
Returns true if the mouse is hovering the previous control.
void BeginTooltip()
Begins a tooltip dialog.
void EndTooltip()
Ends a tooltip dialog.
auto BeginPopupContextItem(const string& id) -> bool
Begins a popup context item.
void EndPopup()
Ends a popup.
auto BeginCombo(const string& label, const string& current, ComboFlags flags = UI::ComboFlags::None) -> bool
Begins a combo box.
auto Selectable(const string& label, bool selected, SelectableFlags flags = UI::SelectableFlags::None) -> bool
Represents a selectable item. Could be inside of a combo box.
void SetItemDefaultFocus()
Puts default focus on the last added item.
void EndCombo()
Ends a combo box.
auto InputInt(const string& label, int32 num, int32 step = 1) -> int32
Input integer. Returns the new value.
auto InputFloat(const string& label, float num, float step = 1.0f) -> float
Input float. Returns the new value.
auto InputFloat2(const string& label, vec2 v) -> vec2
Input 2D vector. Returns the new value.
auto InputFloat3(const string& label, vec3 v) -> vec3
Input 3D vector. Returns the new value.
auto InputFloat4(const string& label, vec4 v) -> vec4
Input 4D vector. Returns the new value.
auto InputColor3(const string& label, vec3 color) -> vec3
Input color. Returns the new value.
auto ColorPicker3(const string& label, vec3 color) -> vec3
Color picker. Returns the new value.
auto SliderInt(const string& label, int32 num, int32 min, int32 max, const string& format = "%d") -> int32
Integer slider. Returns the new value.
auto SliderFloat(const string& label, float num, float min, float max, const string& format = "%.3f") -> float
Float slider. Returns the new value.
auto SliderFloat2(const string& label, vec2 v, float min, float max, const string& format = "%.3f") -> vec2
Vec2 slider. Returns the new value.
auto SliderFloat3(const string& label, vec3 v, float min, float max, const string& format = "%.3f") -> vec3
Vec3 slider. Returns the new value.