Documentation ¶
Index ¶
- Constants
- Variables
- func ActivateItem(id ImGuiID)
- func AddDrawListToDrawData(out_list *[]*ImDrawList, draw_list *ImDrawList)
- func AddRootWindowToDrawData(window *ImGuiWindow)
- func AddWindowToDrawData(window *ImGuiWindow, layer int)
- func AddWindowToSortBuffer(out_sorted_windows *[]*ImGuiWindow, window *ImGuiWindow)
- func AlignTextToFramePadding()
- func ApplyWindowSettings(window *ImGuiWindow, settings *ImGuiWindowSettings)
- func ArrowButton(str_id string, dir ImGuiDir) bool
- func ArrowButtonEx(str_id string, dir ImGuiDir, size ImVec2, flags ImGuiButtonFlags) bool
- func Begin(name string, p_open *bool, flags ImGuiWindowFlags) bool
- func BeginChild(str_id string, size ImVec2, border bool, flags ImGuiWindowFlags) bool
- func BeginChildEx(name string, id ImGuiID, size_arg *ImVec2, border bool, flags ImGuiWindowFlags) bool
- func BeginChildFrame(id ImGuiID, size ImVec2, flags ImGuiWindowFlags) bool
- func BeginChildID(id ImGuiID, size ImVec2, border bool, flags ImGuiWindowFlags) bool
- func BeginColumns(str_id string, columns_count int, flags ImGuiOldColumnFlags)
- func BeginCombo(label string, preview_value string, flags ImGuiComboFlags) bool
- func BeginComboPopup(popup_id ImGuiID, bb *ImRect, flags ImGuiComboFlags) bool
- func BeginComboPreview() bool
- func BeginDisabled(disabled bool)
- func BeginDragDropSource(flags ImGuiDragDropFlags) bool
- func BeginDragDropTarget() bool
- func BeginDragDropTargetCustom(bb *ImRect, id ImGuiID) bool
- func BeginGroup()
- func BeginListBox(label string, size_arg ImVec2) bool
- func BeginMainMenuBar() bool
- func BeginMenu(label string, enabled bool) bool
- func BeginMenuBar() bool
- func BeginMenuEx(label string, icon string, enabled bool) bool
- func BeginPopup(str_id string, flags ImGuiWindowFlags) bool
- func BeginPopupContext(str_id string, popup_flags ImGuiPopupFlags) bool
- func BeginPopupContextItem(str_id string, popup_flags ImGuiPopupFlags) bool
- func BeginPopupContextVoid(str_id string, popup_flags ImGuiPopupFlags) bool
- func BeginPopupContextWindow(str_id string, popup_flags ImGuiPopupFlags) bool
- func BeginPopupEx(id ImGuiID, flags ImGuiWindowFlags) bool
- func BeginPopupModal(name string, p_open *bool, flags ImGuiWindowFlags) bool
- func BeginTabBar(str_id string, flags ImGuiTabBarFlags) bool
- func BeginTabBarEx(tab_bar *ImGuiTabBar, tab_bar_bb *ImRect, flags ImGuiTabBarFlags) bool
- func BeginTabItem(label string, p_open *bool, flags ImGuiTabItemFlags) bool
- func BeginTable(str_id string, columns_count int, flags ImGuiTableFlags, outer_size ImVec2, ...) bool
- func BeginTableEx(name string, id ImGuiID, columns_count int, flags ImGuiTableFlags, ...) bool
- func BeginTooltip()
- func BeginTooltipEx(extra_flags ImGuiWindowFlags, tooltip_flags ImGuiTooltipFlags)
- func BeginViewportSideBar(name string, viewport_p *ImGuiViewport, dir ImGuiDir, axis_size float, ...) bool
- func BringWindowToDisplayBack(window *ImGuiWindow)
- func BringWindowToDisplayFront(window *ImGuiWindow)
- func BringWindowToFocusFront(window *ImGuiWindow)
- func Bullet()
- func BulletText(format string, args ...any)
- func Button(label string) bool
- func ButtonBehavior(bb *ImRect, id ImGuiID, out_hovered *bool, out_held *bool, ...) bool
- func ButtonEx(label string, size_arg *ImVec2, flags ImGuiButtonFlags) bool
- func CalcItemWidth() float
- func CalcListClipping(items_count int, items_height float, out_items_display_start *int, ...)
- func CalcMaxPopupHeightFromItemCount(items_count int) float32
- func CalcResizePosSizeFromAnyCorner(window *ImGuiWindow, corner_target, corner_norm *ImVec2, ...)
- func CalcScrollEdgeSnap(target, snap_min, snap_max, snap_threshold, center_ratio float) float
- func CalcTypematicRepeatAmount(t0, t1, repeat_delay, repeat_rate float) int
- func CalcWindowContentSizes(window *ImGuiWindow, content_size_current, content_size_ideal *ImVec2)
- func CalcWrapWidthForPos(pos *ImVec2, wrap_pos_x float) float
- func CallContextHooks(ctx *ImGuiContext, hook_type ImGuiContextHookType)
- func CaptureKeyboardFromApp(want_capture_keyboard_value bool)
- func CaptureMouseFromApp(want_capture_mouse_value bool)
- func Checkbox(label string, v *bool) bool
- func CheckboxFlagsInt(label string, flags *int, flags_value int) bool
- func CheckboxFlagsS(l string, s *ImU64, flags_value ImU64) bool
- func CheckboxFlagsU(l string, s *ImS64, flags_value ImS64) bool
- func CheckboxFlagsUint(label string, flags *uint, flags_value uint) bool
- func ChildWindowComparer(a, b *ImGuiWindow) int
- func ClampWindowRect(window *ImGuiWindow, visibility_rect *ImRect)
- func ClearActiveID()
- func ClearDragDrop()
- func ClearIniSettings()
- func CloseButton(id ImGuiID, pos *ImVec2) bool
- func CloseCurrentPopup()
- func ClosePopupToLevel(remaining int, restore_focus_to_window_under_popup bool)
- func ClosePopupsOverWindow(ref_window *ImGuiWindow, restore_focus_to_window_under_popup bool)
- func CollapseButton(id ImGuiID, pos *ImVec2) bool
- func CollapsingHeader(label string, flags ImGuiTreeNodeFlags) bool
- func CollapsingHeaderVisible(label string, p_visible *bool, flags ImGuiTreeNodeFlags) bool
- func ColorButton(desc_id string, col ImVec4, flags ImGuiColorEditFlags, size ImVec2) bool
- func ColorConvertHSVtoRGB(h float, s float, v float, out_r, out_g, out_b *float)
- func ColorConvertRGBtoHSV(r float, g float, b float, out_h, out_s, out_v *float)
- func ColorEdit3(label string, col *[3]float, flags ImGuiColorEditFlags) bool
- func ColorEdit4(label string, col *[4]float, flags ImGuiColorEditFlags) bool
- func ColorEditOptionsPopup(col [4]float, flags ImGuiColorEditFlags)
- func ColorPicker3(label string, col *[3]float, flags ImGuiColorEditFlags) bool
- func ColorPicker4(label string, col *[4]float, flags ImGuiColorEditFlags, ref_col []float) bool
- func ColorPickerOptionsPopup(ref_col *[4]float, flags ImGuiColorEditFlags)
- func ColorTooltip(text string, col [4]float, flags ImGuiColorEditFlags)
- func Columns(columns_count int, id string, border bool)
- func Combo(label string, current_item *int, items []string, items_count int, ...) bool
- func ComboFunc(label string, current_item *int, ...) bool
- func DataTypeApplyOp(data_type ImGuiDataType, op int, output any, arg_1 any, arg_2 any)
- func DataTypeApplyOpFromText(buf string, initial_value_buf string, data_type ImGuiDataType, p_data any, ...) bool
- func DataTypeClamp(data_type ImGuiDataType, a any, n any, x any) bool
- func DataTypeCompare(data_type ImGuiDataType, arg_1 any, arg_2 any) int
- func DataTypeFormatString(data_type ImGuiDataType, p_data any, format string) string
- func DebugDrawItemRect(col ImU32)
- func DebugNodeColumns(columns *ImGuiOldColumns)
- func DebugNodeDrawCmdShowMeshAndBoundingBox(out_draw_list *ImDrawList, draw_list *ImDrawList, draw_cmd *ImDrawCmd, ...)
- func DebugNodeDrawList(window *ImGuiWindow, draw_list *ImDrawList, label string)
- func DebugNodeFont(font *ImFont)
- func DebugNodeStorage(storage *ImGuiStorage, label string)
- func DebugNodeTabBar(tab_bar *ImGuiTabBar, label string)
- func DebugNodeTable(table *ImGuiTable)
- func DebugNodeTableGetSizingPolicyDesc(sizing_policy ImGuiTableFlags) string
- func DebugNodeTableSettings(settings *ImGuiTableSettings)
- func DebugNodeViewport(viewport *ImGuiViewportP)
- func DebugNodeWindow(window *ImGuiWindow, label string)
- func DebugNodeWindowSettings(settings *ImGuiWindowSettings)
- func DebugNodeWindowsList(windows []*ImGuiWindow, label string)
- func DebugRenderViewportThumbnail(draw_list *ImDrawList, viewport *ImGuiViewportP, bb *ImRect)
- func DebugStartItemPicker()
- func Decode85(src string, dst []byte)
- func Decode85Byte(c char) uint
- func DestroyContext(ctx *ImGuiContext)
- func DragBehavior(id ImGuiID, data_type ImGuiDataType, v any, v_speed float, n any, x any, ...) bool
- func DragBehaviorT(v *float, v_speed float, v_min, v_max *float, format string, ...) bool
- func DragFloat(label string, v *float, v_speed float, v_min float, v_max float, format string, ...) bool
- func DragFloat2(label string, v *[2]float, v_speed float, v_min float, v_max float, ...) bool
- func DragFloat3(label string, v *[3]float, v_speed float, v_min float, v_max float, ...) bool
- func DragFloat4(label string, v *[4]float, v_speed float, v_min float, v_max float, ...) bool
- func DragFloatRange2(label string, v_current_min *float, v_current_max *float, v_speed float, ...) bool
- func DragInt(label string, v *int, v_speed float, v_min int, v_max int, format string, ...) bool
- func DragInt2(label string, v [2]int, v_speed float, v_min int, v_max int, format string, ...) bool
- func DragInt3(label string, v [3]int, v_speed float, v_min int, v_max int, format string, ...) bool
- func DragInt4(label string, v [4]int, v_speed float, v_min int, v_max int, format string, ...) bool
- func DragIntRange2(label string, v_current_min *int, v_current_max *int, v_speed float, v_min int, ...) bool
- func DragScalar(label string, data_type ImGuiDataType, p_data any, v_speed float, p_min any, ...) bool
- func DragScalarFloat(label string, data_type ImGuiDataType, p_data *float, v_speed float, ...) bool
- func DragScalarFloats(label string, data_type ImGuiDataType, p_data []float, v_speed float, ...) bool
- func DragScalarInt(label string, data_type ImGuiDataType, p_data *int, v_speed float, p_min *int, ...) bool
- func DragScalarInts(label string, data_type ImGuiDataType, p_data []int, v_speed float, p_min *int, ...) bool
- func Dummy(size ImVec2)
- func End()
- func EndChild()
- func EndChildFrame()
- func EndColumns()
- func EndCombo()
- func EndComboPreview()
- func EndDisabled()
- func EndDragDropSource()
- func EndDragDropTarget()
- func EndFrame()
- func EndGroup()
- func EndListBox()
- func EndMainMenuBar()
- func EndMenu()
- func EndMenuBar()
- func EndPopup()
- func EndTabBar()
- func EndTabItem()
- func EndTable()
- func EndTooltip()
- func ErrorCheckEndFrameRecover(log_callback ImGuiErrorLogCallback, user_data any)
- func ErrorCheckEndFrameSanityChecks()
- func ErrorCheckNewFrameSanityChecks()
- func FindHoveredWindow()
- func FindRenderedTextEnd(t string) string
- func FindWindowFocusIndex(window *ImGuiWindow) int
- func FocusTopMostWindowUnderOne(under_this_window *ImGuiWindow, ignore_window *ImGuiWindow)
- func FocusWindow(window *ImGuiWindow)
- func GcAwakeTransientWindowBuffers(window *ImGuiWindow)
- func GcCompactTransientMiscBuffers()
- func GcCompactTransientWindowBuffers(window *ImGuiWindow)
- func GetClipboardText() string
- func GetClipboardTextFn_DefaultImpl(any) string
- func GetColumnIndex() int
- func GetColumnNormFromOffset(columns *ImGuiOldColumns, offset float) float
- func GetColumnOffset(column_index int) float
- func GetColumnOffsetFromNorm(columns *ImGuiOldColumns, offset_norm float) float
- func GetColumnWidth(column_index int) float
- func GetColumnWidthEx(columns *ImGuiOldColumns, column_index int, before_resize bool) float
- func GetColumnsCount() int
- func GetCursorPosX() float
- func GetCursorPosY() float
- func GetDraggedColumnOffset(columns *ImGuiOldColumns, column_index int) float
- func GetFallbackWindowNameForWindowingList(window *ImGuiWindow) string
- func GetFontSize() float
- func GetFrameCount() int
- func GetFrameHeight() float
- func GetFrameHeightWithSpacing() float
- func GetKeyIndex(imgui_key ImGuiKey) int
- func GetKeyPressedAmount(key_index int, repeat_delay float, repeat_rate float) int
- func GetMinimumStepAtDecimalPrecision(decimal_precision int) float
- func GetNavInputAmount(n ImGuiNavInput, mode ImGuiInputReadMode) float
- func GetScrollMaxX() float
- func GetScrollMaxY() float
- func GetScrollX() float
- func GetScrollY() float
- func GetSkipItemForListClipping() bool
- func GetStyleColorName(idx ImGuiCol) string
- func GetTextLineHeight() float
- func GetTextLineHeightWithSpacing() float
- func GetTime() double
- func GetTreeNodeToLabelSpacing() float
- func GetVersion() string
- func GetWindowHeight() float
- func GetWindowWidth() float
- func HelpMarker(desc string)
- func IMGUI_CHECKVERSION()
- func IMGUI_DEBUG_LOG(format string, args ...any)
- func IM_ASSERT(x bool)
- func IM_ASSERT_USER_ERROR(x bool, msg string)
- func IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(RAD, MAXERROR float) float
- func IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(N, RAD float) float
- func IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(N, MAXERROR float) float
- func IM_F32_TO_INT8_SAT(val float32) int
- func IM_F32_TO_INT8_UNBOUND(val float32) int
- func IM_FIXNORMAL2F(VX, VY *float)
- func IM_FLOOR(val float32) float
- func IM_NORMALIZE2F_OVER_ZERO(VX, VY *float)
- func IM_ROUND(val float32) float
- func IM_ROUNDUP_TO_EVEN(V float) float
- func ImAbs(X float) float
- func ImAbsInt(X int) int
- func ImAcos(X float) float
- func ImAcos01(x float) float
- func ImAddClampOverflow(a, b, mn, mx float) float
- func ImAtan2(Y, X float) float
- func ImAtof(str string) float
- func ImBezierCubicClosestPointCasteljauStep(p, p_closest, p_last *ImVec2, ...)
- func ImBitArrayClearBit(arr []ImU32, n int)
- func ImBitArraySetBit(arr []ImU32, n int)
- func ImBitArraySetBitRange(arr []ImU32, n, n2 int)
- func ImBitArrayTestBit(arr []ImU32, n int) bool
- func ImCeil(X float) float
- func ImCharIsBlankA(c char) bool
- func ImCharIsBlankW(c rune) bool
- func ImClamp(v, mn, mx float) float
- func ImClamp64(v, mn, mx float64) float64
- func ImClampInt(v, mn, mx int) int
- func ImClampInt64(v, mn, mx int64) int64
- func ImClampUint64(v, mn, mx uint64) uint64
- func ImCos(X float) float
- func ImDot(a, b *ImVec2) float
- func ImDrawVertSizeAndOffset() (size, o1, o2, o3 uintptr)
- func ImFabs(X float) float
- func ImFileClose(file ImFileHandle) bool
- func ImFileLoadToMemory(filename, mode string, out_file_size *size_t, padding_bytes int) []byte
- func ImFloor(f float) float
- func ImFloorSigned(f float) float
- func ImFmod(X, Y float) float
- func ImFontAtlasBuildFinish(atlas *ImFontAtlas)
- func ImFontAtlasBuildInit(atlas *ImFontAtlas)
- func ImFontAtlasBuildMultiplyCalcLookupTable(out_table []byte, in_brighten_factor float32)
- func ImFontAtlasBuildMultiplyRectAlpha8(table []byte, pixels []byte, x, y, w, h, stride int)
- func ImFontAtlasBuildPackCustomRects(atlas *ImFontAtlas, stbrp_context_opaque any)
- func ImFontAtlasBuildRender32bppRectFromString(atlas *ImFontAtlas, x, y, w, h int, in_str string, in_marker_char byte, ...)
- func ImFontAtlasBuildRender8bppRectFromString(atlas *ImFontAtlas, x, y, w, h int, in_str string, in_marker_char byte, ...)
- func ImFontAtlasBuildRenderDefaultTexData(atlas *ImFontAtlas)
- func ImFontAtlasBuildRenderLinesTexData(atlas *ImFontAtlas)
- func ImFontAtlasBuildSetupFont(atlas *ImFontAtlas, font *ImFont, font_config *ImFontConfig, ascent float32, ...)
- func ImFontAtlasBuildWithStbTruetype(atlas *ImFontAtlas) bool
- func ImInvLength(lhs ImVec2, fail_value float) float
- func ImIsPowerOfTwoInt(v int) bool
- func ImIsPowerOfTwoLong(v int64) bool
- func ImLengthSqrVec2(a ImVec2) float
- func ImLengthSqrVec4(a ImVec4) float
- func ImLerp(a, b, t float) float
- func ImLinearSweep(current, target, speed float) float
- func ImLog(X float) float
- func ImMax(a, b float) float
- func ImMaxInt(a, b int) int
- func ImMin(a, b float) float
- func ImMinInt(a, b int) int
- func ImModPositive(a, b int) int
- func ImPow(X, Y float) float
- func ImRsqrt(X float) float
- func ImSaturate(f float) float
- func ImSign(X float) float
- func ImSin(X float) float
- func ImSqrt(X float) float
- func ImStrSkipBlank(str string) string
- func ImSubClampOverflow(a, b, mn, mx float) float
- func ImSwap(a, b float)
- func ImTextCharFromUtf8(out_char *rune, text string) int
- func ImTextCharToUtf8(out_buf [5]char, c uint) []char
- func ImTextCharToUtf8_inline(buf []char, buf_size int, c uint) int
- func ImTextCountCharsFromUtf8(in_text string) int
- func ImTextCountUtf8BytesFromChar(in_text, in_text_end []char) int
- func ImTextCountUtf8BytesFromStr(in_text, in_text_end []ImWchar) int
- func ImTextStrFromUtf8(out_buf []ImWchar, out_buf_size int, text string, in_remaining *string) int
- func ImTextStrToUtf8(out_buf []byte, out_buf_size int, in_text []ImWchar, in_text_end []ImWchar) int
- func ImTriangleArea(a, b, c *ImVec2) float32
- func ImTriangleBarycentricCoords(a, b, c, p *ImVec2, out_u, out_v, out_w *float32)
- func ImTriangleContainsPoint(a, b, c, p *ImVec2) bool
- func ImUpperPowerOfTwo(v int) int
- func Image(user_texture_id ImTextureID, size ImVec2, uv0 ImVec2, uv1 ImVec2, ...)
- func ImageButton(user_texture_id ImTextureID, size ImVec2, uv0 ImVec2, uv1 ImVec2, ...) bool
- func ImageButtonEx(id ImGuiID, texture_id ImTextureID, size *ImVec2, uv0 *ImVec2, uv1 *ImVec2, ...) bool
- func Indent(indent_w float)
- func Initialize(context *ImGuiContext)
- func InputDouble(label string, v *double, step double, step_fast double, format string, ...) bool
- func InputFloat(label string, v *float, step, step_fast float, format string, ...) bool
- func InputFloat2(label string, v *[2]float, format string, flags ImGuiInputTextFlags) bool
- func InputFloat3(label string, v *[3]float, format string, flags ImGuiInputTextFlags) bool
- func InputFloat4(label string, v *[4]float, format string, flags ImGuiInputTextFlags) bool
- func InputInt(label string, v *int, step int, step_fast int, flags ImGuiInputTextFlags) bool
- func InputInt2(label string, v *[2]int, flags ImGuiInputTextFlags) bool
- func InputInt3(label string, v *[3]int, flags ImGuiInputTextFlags) bool
- func InputInt4(label string, v *[4]int, flags ImGuiInputTextFlags) bool
- func InputScalarFloat32(label string, p_data, p_step, p_step_fast *float32, format string, ...) bool
- func InputScalarFloat32s(label string, p_data []float32, p_step, p_step_fast *float32, format string, ...) bool
- func InputScalarFloat64(label string, p_data, p_step, p_step_fast *float64, format string, ...) bool
- func InputScalarFloat64s(label string, p_data []float64, p_step, p_step_fast *float64, format string, ...) bool
- func InputScalarInt32(label string, p_data, p_step, p_step_fast *int32, format string, ...) bool
- func InputScalarInt32s(label string, p_data []int32, p_step, p_step_fast *int32, format string, ...) bool
- func InputScalarInt64(label string, p_data, p_step, p_step_fast *int64, format string, ...) bool
- func InputScalarInt64s(label string, p_data []int64, p_step, p_step_fast *int64, format string, ...) bool
- func InputText(label string, char *[]byte, flags ImGuiInputTextFlags, ...) bool
- func InputTextCalcLineCount(text string) int
- func InputTextEx(label string, hint string, buf *[]byte, size_arg *ImVec2, ...) bool
- func InputTextFilterCharacter(p_char *rune, flags ImGuiInputTextFlags, callback ImGuiInputTextCallback, ...) bool
- func InputTextMultiline(label string, buf *[]byte, size ImVec2, flags ImGuiInputTextFlags, ...) bool
- func InputTextWithHint(label string, hint string, char *[]byte, flags ImGuiInputTextFlags, ...) bool
- func InvisibleButton(str_id string, size_arg ImVec2, flags ImGuiButtonFlags) bool
- func IsActiveIdUsingKey(key ImGuiKey) bool
- func IsActiveIdUsingNavDir(dir ImGuiDir) bool
- func IsActiveIdUsingNavInput(input ImGuiNavInput) bool
- func IsAnyItemActive() bool
- func IsAnyItemFocused() bool
- func IsAnyItemHovered() bool
- func IsAnyMouseDown() bool
- func IsClippedEx(bb *ImRect, id ImGuiID, clip_even_when_logged bool) bool
- func IsDragDropPayloadBeingAccepted() bool
- func IsItemActivated() bool
- func IsItemActive() bool
- func IsItemClicked(mouse_button ImGuiMouseButton) bool
- func IsItemDeactivated() bool
- func IsItemDeactivatedAfterEdit() bool
- func IsItemEdited() bool
- func IsItemFocused() bool
- func IsItemHovered(flags ImGuiHoveredFlags) bool
- func IsItemToggledOpen() bool
- func IsItemToggledSelection() bool
- func IsItemVisible() bool
- func IsKeyDown(user_key_index int) bool
- func IsKeyPressed(user_key_index int, repeat bool) bool
- func IsKeyPressedMap(key ImGuiKey, repeat bool) bool
- func IsKeyReleased(user_key_index int) bool
- func IsMouseClicked(button ImGuiMouseButton, repeat bool) bool
- func IsMouseDoubleClicked(button ImGuiMouseButton) bool
- func IsMouseDown(button ImGuiMouseButton) bool
- func IsMouseDragPastThreshold(button ImGuiMouseButton, lock_threshold float) bool
- func IsMouseDragging(button ImGuiMouseButton, lock_threshold float) bool
- func IsMouseHoveringRect(r_min, r_max ImVec2, clip bool) bool
- func IsMousePosValid(mouse_pos *ImVec2) bool
- func IsMouseReleased(button ImGuiMouseButton) bool
- func IsNavInputDown(n ImGuiNavInput) bool
- func IsNavInputTest(n ImGuiNavInput, rm ImGuiInputReadMode) bool
- func IsPopupOpen(str_id string, flags ImGuiPopupFlags) bool
- func IsPopupOpenID(id ImGuiID, popup_flags ImGuiPopupFlags) bool
- func IsRectVisible(size ImVec2) bool
- func IsRectVisibleMinMax(rect_min, rect_max ImVec2) bool
- func IsWindowAbove(potential_above *ImGuiWindow, potential_below *ImGuiWindow) bool
- func IsWindowActiveAndVisible(window *ImGuiWindow) bool
- func IsWindowAppearing() bool
- func IsWindowChildOf(window *ImGuiWindow, potential_parent *ImGuiWindow) bool
- func IsWindowCollapsed() bool
- func IsWindowContentHoverable(window *ImGuiWindow, flags ImGuiHoveredFlags) bool
- func IsWindowFocused(flags ImGuiFocusedFlags) bool
- func IsWindowHovered(flags ImGuiHoveredFlags) bool
- func IsWindowNavFocusable(window *ImGuiWindow) bool
- func ItemAdd(bb *ImRect, id ImGuiID, nav_bb_arg *ImRect, extra_flags ImGuiItemFlags) bool
- func ItemHoverable(bb *ImRect, id ImGuiID) bool
- func ItemInputable(window *ImGuiWindow, id ImGuiID)
- func ItemSizeRect(bb *ImRect, text_baseline_y float)
- func ItemSizeVec(size *ImVec2, text_baseline_y float)
- func KeepAliveID(id ImGuiID)
- func LabelText(label string, format string, args ...any)
- func ListBox(label string, current_item *int, items []string, items_count int, ...) bool
- func ListBoxFunc(label string, current_item *int, ...) bool
- func LoadIniSettingsFromDisk(ini_filename string)
- func LoadIniSettingsFromMemory(buf []byte, ini_size uintptr)
- func LogBegin(ltype ImGuiLogType, auto_open_depth int)
- func LogButtons()
- func LogFinish()
- func LogRenderedText(ref_pos *ImVec2, text string)
- func LogSetNextTextDecoration(prefix string, suffix string)
- func LogText(format string, args ...any)
- func LogToBuffer(auto_open_depth int)
- func LogToClipboard(auto_open_depth int)
- func LogToFile(auto_open_depth int, filename string)
- func LogToTTY(auto_open_depth int)
- func MarkIniSettingsDirty()
- func MarkIniSettingsDirtyWindow(window *ImGuiWindow)
- func MarkItemEdited(id ImGuiID)
- func MenuItem(label string, shortcut string, selected *bool, enabled bool) bool
- func MenuItemEx(label string, icon string, shortcut string, selected *bool, enabled bool) bool
- func MenuItemSelected(label string, shortcut string, p_selected *bool, enabled bool) bool
- func MetricsHelpMarker(desc string)
- func NavApplyItemToResult(result *ImGuiNavItemData)
- func NavClampRectToVisibleAreaForMoveDir(move_dir ImGuiDir, r *ImRect, clip_rect *ImRect)
- func NavEndFrame()
- func NavInitWindow(window *ImGuiWindow, force_reinit bool)
- func NavMoveRequestApplyResult()
- func NavMoveRequestButNoResultYet() bool
- func NavMoveRequestCancel()
- func NavMoveRequestForward(move_dir ImGuiDir, clip_dir ImGuiDir, move_flags ImGuiNavMoveFlags)
- func NavMoveRequestSubmit(move_dir ImGuiDir, clip_dir ImGuiDir, move_flags ImGuiNavMoveFlags)
- func NavMoveRequestTryWrapping(window *ImGuiWindow, move_flags ImGuiNavMoveFlags)
- func NavProcessItem()
- func NavRestoreLayer(layer ImGuiNavLayer)
- func NavSaveLastChildNavWindowIntoParent(nav_window *ImGuiWindow)
- func NavScoreItem(result *ImGuiNavItemData) bool
- func NavScoreItemDistInterval(a0, a1, b0, b1 float) float
- func NavUpdate()
- func NavUpdateAnyRequestFlag()
- func NavUpdateCancelRequest()
- func NavUpdateCreateMoveRequest()
- func NavUpdateInitResult()
- func NavUpdatePageUpPageDown() float
- func NavUpdateWindowing()
- func NavUpdateWindowingHighlightWindow(focus_change_dir int)
- func NavUpdateWindowingOverlay()
- func NewFrame()
- func NewLine()
- func NextColumn()
- func OpenPopup(str_id string, popup_flags ImGuiPopupFlags)
- func OpenPopupEx(id ImGuiID, popup_flags ImGuiPopupFlags)
- func OpenPopupID(id ImGuiID, popup_flags ImGuiPopupFlags)
- func OpenPopupOnItemClick(str_id string, popup_flags ImGuiPopupFlags)
- func PatchFormatStringFloatToInt(format string) string
- func PathBezierCubicCurveToCasteljau(path *[]ImVec2, x1, y1, x2, y2, x3, y3, x4, y4, tess_tol float, level int)
- func PathBezierQuadraticCurveToCasteljau(path *[]ImVec2, x1, y1, x2, y2, x3, y3, tess_tol float, level int)
- func PlotEx(plot_type ImGuiPlotType, label string, ...) int
- func PlotHistogram(label string, values []float, values_count int, values_offset int, ...)
- func PlotHistogramFunc(label string, values_getter func(data any, idx int) float, data any, ...)
- func PlotLines(label string, values []float, values_count int, values_offset int, ...)
- func PlotLinesFunc(label string, values_getter func(data any, idx int) float, data any, ...)
- func Plot_ArrayGetter(data any, idx int) float
- func PopAllowKeyboardFocus()
- func PopButtonRepeat()
- func PopClipRect()
- func PopColumnsBackground()
- func PopFocusScope()
- func PopFont()
- func PopID()
- func PopItemFlag()
- func PopItemWidth()
- func PopStyleColor(count int)
- func PopStyleVar(count int)
- func PopTextWrapPos()
- func ProgressBar(fraction float, size_arg ImVec2, overlay string)
- func PushAllowKeyboardFocus(allow_keyboard_focus bool)
- func PushButtonRepeat(repeat bool)
- func PushClipRect(cr_min ImVec2, cr_max ImVec2, intersect_with_current_clip_rect bool)
- func PushColumnClipRect(column_index int)
- func PushColumnsBackground()
- func PushFocusScope(id ImGuiID)
- func PushFont(font *ImFont)
- func PushID(int_id int)
- func PushInterface(ptr_id any)
- func PushItemFlag(option ImGuiItemFlags, enabled bool)
- func PushItemWidth(item_width float)
- func PushMultiItemsWidths(components int, width_full float)
- func PushOverrideID(id ImGuiID)
- func PushString(str_id string)
- func PushStyleColorInt(idx ImGuiCol, col ImU32)
- func PushStyleColorVec(idx ImGuiCol, col *ImVec4)
- func PushStyleFloat(idx ImGuiStyleVar, val float)
- func PushStyleVec(idx ImGuiStyleVar, val ImVec2)
- func PushTextWrapPos(wrap_local_pos_x float)
- func RadioButtonBool(label string, active bool) bool
- func RadioButtonInt(label string, v *int, v_button int) bool
- func RemoveContextHook(context *ImGuiContext, hook_to_remove ImGuiID)
- func Render()
- func RenderArrow(draw_list *ImDrawList, pos ImVec2, col ImU32, dir ImGuiDir, scale float)
- func RenderArrowPointingAt(draw_list *ImDrawList, pos ImVec2, half_sz ImVec2, direction ImGuiDir, ...)
- func RenderArrowsForVerticalBar(draw_list *ImDrawList, pos, half_sz ImVec2, bar_w, alpha float)
- func RenderBullet(draw_list *ImDrawList, pos ImVec2, col ImU32)
- func RenderCheckMark(draw_list *ImDrawList, pos ImVec2, col ImU32, sz float)
- func RenderColorRectWithAlphaCheckerboard(draw_list *ImDrawList, p_min ImVec2, p_max ImVec2, col ImU32, grid_step float, ...)
- func RenderFrame(p_min ImVec2, p_max ImVec2, fill_col ImU32, border bool, rounding float)
- func RenderFrameBorder(p_min ImVec2, p_max ImVec2, rounding float)
- func RenderMouseCursor(draw_list *ImDrawList, pos ImVec2, scale float, mouse_cursor ImGuiMouseCursor, ...)
- func RenderNavHighlight(bb *ImRect, id ImGuiID, flags ImGuiNavHighlightFlags)
- func RenderRectFilledRangeH(draw_list *ImDrawList, rect *ImRect, col ImU32, x_start_norm float, ...)
- func RenderRectFilledWithHole(draw_list *ImDrawList, outer ImRect, inner ImRect, col ImU32, rounding float)
- func RenderText(pos ImVec2, text string, hide_text_after_hash bool)
- func RenderTextClipped(pos_min *ImVec2, pos_max *ImVec2, text string, text_size_if_known *ImVec2, ...)
- func RenderTextClippedEx(draw_list *ImDrawList, pos_min *ImVec2, pos_max *ImVec2, text string, ...)
- func RenderTextEllipsis(draw_list *ImDrawList, pos_min *ImVec2, pos_max *ImVec2, clip_max_x float, ...)
- func RenderTextWrapped(pos ImVec2, text string, wrap_width float)
- func RenderViewportsThumbnails()
- func RenderWindowDecorations(window *ImGuiWindow, title_bar_rect *ImRect, title_bar_is_highlight bool, ...)
- func RenderWindowOuterBorders(window *ImGuiWindow)
- func RenderWindowTitleBarContents(window *ImGuiWindow, title_bar_rect *ImRect, name string, p_open *bool)
- func ResetMouseDragDelta(button ImGuiMouseButton)
- func RoundScalarWithFormatT(format string, v float) float
- func STB_TEXTEDIT_DELETECHARS(obj *STB_TEXTEDIT_STRING, pos, n int)
- func STB_TEXTEDIT_GETWIDTH(obj *STB_TEXTEDIT_STRING, line_start_idx, char_idx int) float
- func STB_TEXTEDIT_INSERTCHARS(obj *STB_TEXTEDIT_STRING, pos int, new_text []STB_TEXTEDIT_CHARTYPE, ...) bool
- func STB_TEXTEDIT_IS_SPACE(char STB_TEXTEDIT_CHARTYPE) bool
- func STB_TEXTEDIT_LAYOUTROW(r *StbTexteditRow, obj *STB_TEXTEDIT_STRING, line_start_idx int)
- func STB_TEXTEDIT_MOVEWORDLEFT(obj *STB_TEXTEDIT_STRING, idx int) int
- func STB_TEXTEDIT_MOVEWORDRIGHT(obj *STB_TEXTEDIT_STRING, idx int) int
- func STB_TEXTEDIT_STRINGLEN(obj *STB_TEXTEDIT_STRING) int
- func STB_TEXT_HAS_SELECTION(s *STB_TexteditState) bool
- func SameLine(offset_from_start_x, spacing_w float)
- func SaveIniSettingsToDisk(ini_filename string)
- func SaveIniSettingsToMemory(out_size *uintptr) []byte
- func ScaleRatioFromValueT(v, v_min, v_max float, is_logarithmic bool, ...) float
- func ScaleValueFromRatioT(t, v_min, v_max float, is_logarithmic bool, ...) float
- func Scrollbar(axis ImGuiAxis)
- func ScrollbarEx(bb_frame *ImRect, id ImGuiID, axis ImGuiAxis, p_scroll_v *float, ...) bool
- func Selectable(label string, selected bool, flags ImGuiSelectableFlags, size_arg ImVec2) bool
- func SelectablePointer(label string, p_selected *bool, flags ImGuiSelectableFlags, size_arg ImVec2) bool
- func Separator()
- func SeparatorEx(flags ImGuiSeparatorFlags)
- func SetActiveID(id ImGuiID, window *ImGuiWindow)
- func SetActiveIdUsingNavAndKeys()
- func SetClipboardText(text string)
- func SetClipboardTextFn_DefaultImpl(_ any, text string)
- func SetColorEditOptions(flags ImGuiColorEditFlags)
- func SetColumnOffset(column_index int, offset float)
- func SetColumnWidth(column_index int, width float)
- func SetCurrentContext(ctx *ImGuiContext)
- func SetCurrentFont(font *ImFont)
- func SetCurrentWindow(window *ImGuiWindow)
- func SetCursorPos(local_pos *ImVec2)
- func SetCursorPosX(local_x float)
- func SetCursorPosY(local_y float)
- func SetCursorPosYAndSetupForPrevLine(pos_y, line_height float)
- func SetCursorScreenPos(pos ImVec2)
- func SetDragDropPayload(ptype string, data any, data_size uintptr, cond ImGuiCond) bool
- func SetFocusID(id ImGuiID, window *ImGuiWindow)
- func SetHoveredID(id ImGuiID)
- func SetItemAllowOverlap()
- func SetItemDefaultFocus()
- func SetItemUsingMouseWheel()
- func SetKeyboardFocusHere(offset int)
- func SetMouseCursor(cursor_type ImGuiMouseCursor)
- func SetNamedWindowCollapsed(name string, collapsed bool, cond ImGuiCond)
- func SetNamedWindowFocus(name string)
- func SetNamedWindowPos(name string, pos ImVec2, cond ImGuiCond)
- func SetNamedWindowSize(name string, size ImVec2, cond ImGuiCond)
- func SetNavID(id ImGuiID, nav_layer ImGuiNavLayer, focus_scope_id ImGuiID, rect_rel *ImRect)
- func SetNextItemOpen(is_open bool, cond ImGuiCond)
- func SetNextItemWidth(item_width float)
- func SetNextWindowBgAlpha(alpha float)
- func SetNextWindowCollapsed(collapsed bool, cond ImGuiCond)
- func SetNextWindowContentSize(size ImVec2)
- func SetNextWindowFocus()
- func SetNextWindowPos(pos *ImVec2, cond ImGuiCond, pivot ImVec2)
- func SetNextWindowScroll(scroll *ImVec2)
- func SetNextWindowSize(size *ImVec2, cond ImGuiCond)
- func SetNextWindowSizeConstraints(size_min ImVec2, size_max ImVec2, custom_callback ImGuiSizeCallback, ...)
- func SetScrollFromPosX(local_x, center_x_ratio float)
- func SetScrollFromPosY(local_y, center_y_ratio float)
- func SetScrollHereX(center_x_ratio float)
- func SetScrollHereY(center_y_ratio float)
- func SetScrollX(scroll_x float)
- func SetScrollY(scroll_y float)
- func SetStateStorage(storage *ImGuiStorage)
- func SetTabItemClosed(tab_or_docked_window_label string)
- func SetTooltip(format string, args ...any)
- func SetWindowClipRectBeforeSetChannel(window *ImGuiWindow, clip_rect *ImRect)
- func SetWindowCollapsed(collapsed bool, cond ImGuiCond)
- func SetWindowConditionAllowFlags(window *ImGuiWindow, flags ImGuiCond, enabled bool)
- func SetWindowFocus()
- func SetWindowFontScale(scale float)
- func SetWindowHitTestHole(window *ImGuiWindow, pos *ImVec2, size *ImVec2)
- func SetWindowPos(pos ImVec2, cond ImGuiCond)
- func SetWindowSize(size ImVec2, cond ImGuiCond)
- func SetupViewportDrawData(viewport *ImGuiViewportP, draw_lists *[]*ImDrawList)
- func ShadeVertsLinearColorGradientKeepAlpha(draw_list *ImDrawList, vert_start_idx int, vert_end_idx int, ...)
- func ShadeVertsLinearUV(t *ImDrawList, vert_start_idx int, vert_end_idx int, a *ImVec2, b *ImVec2, ...)
- func ShowAboutWindow(p_open *bool)
- func ShowDemoWindow(p_open *bool)
- func ShowFontAtlas(atlas *ImFontAtlas)
- func ShowFontSelector(label string)
- func ShowMetricsWindow(p_open *bool)
- func ShowStyleEditor(ref *ImGuiStyle)
- func ShowStyleSelector(label string) bool
- func ShowUserGuide()
- func ShrinkWidths(items []ImGuiShrinkWidthItem, count int, width_excess float)
- func Shutdown(context *ImGuiContext)
- func SliderAngle(label string, v_rad *float, v_degrees_min float, v_degrees_max float, ...) bool
- func SliderBehavior(bb *ImRect, id ImGuiID, data_type ImGuiDataType, p_v any, p_min any, p_max any, ...) bool
- func SliderFloat(label string, v *float, v_min float, v_max float, format string, ...) bool
- func SliderFloat2(label string, v *[2]float, v_min float, v_max float, format string, ...) bool
- func SliderFloat3(label string, v *[3]float, v_min float, v_max float, format string, ...) bool
- func SliderFloat4(label string, v *[4]float, v_min float, v_max float, format string, ...) bool
- func SliderInt(label string, v *int, v_min int, v_max int, format string, ...) bool
- func SliderInt2(label string, v [2]int, v_min int, v_max int, format string, ...) bool
- func SliderInt3(label string, v [3]int, v_min int, v_max int, format string, ...) bool
- func SliderInt4(label string, v [4]int, v_min int, v_max int, format string, ...) bool
- func SliderScalar(label string, data_type ImGuiDataType, p_data any, p_min any, p_max any, ...) bool
- func SliderScalarN(label string, data_type ImGuiDataType, p_data []float, p_min float, ...) bool
- func SmallButton(label string) bool
- func Spacing()
- func SplitterBehavior(bb *ImRect, id ImGuiID, axis ImGuiAxis, size1 *float, size2 *float, ...) bool
- func StartLockWheelingWindow(window *ImGuiWindow)
- func StartMouseMovingWindow(window *ImGuiWindow)
- func StyleColorsClassic(style *ImGuiStyle)
- func StyleColorsDark(style *ImGuiStyle)
- func StyleColorsLight(style *ImGuiStyle)
- func TabBarCalcMaxTabWidth() float
- func TabBarCloseTab(tab_bar *ImGuiTabBar, tab *ImGuiTabItem)
- func TabBarLayout(tab_bar *ImGuiTabBar)
- func TabBarProcessReorder(tab_bar *ImGuiTabBar) bool
- func TabBarQueueReorder(tab_bar *ImGuiTabBar, tab *ImGuiTabItem, offset int)
- func TabBarQueueReorderFromMousePos(tab_bar *ImGuiTabBar, src_tab *ImGuiTabItem, mouse_pos ImVec2)
- func TabBarRemoveTab(tab_bar *ImGuiTabBar, tab_id ImGuiID)
- func TabBarScrollClamp(tab_bar *ImGuiTabBar, scrolling float) float
- func TabBarScrollToTab(tab_bar *ImGuiTabBar, tab_id ImGuiID, sections [3]ImGuiTabBarSection)
- func TabItemBackground(draw_list *ImDrawList, bb *ImRect, flags ImGuiTabItemFlags, col ImU32)
- func TabItemButton(label string, flags ImGuiTabItemFlags) bool
- func TabItemEx(tab_bar *ImGuiTabBar, label string, p_open *bool, flags ImGuiTabItemFlags) bool
- func TabItemGetSectionIdx(tab *ImGuiTabItem) int
- func TabItemLabelAndCloseButton(draw_list *ImDrawList, bb *ImRect, flags ImGuiTabItemFlags, ...)
- func TableBeginApplyRequests(table *ImGuiTable)
- func TableBeginCell(table *ImGuiTable, column_n int)
- func TableBeginInitMemory(e *ImGuiTable, columns_count int)
- func TableBeginRow(table *ImGuiTable)
- func TableDrawBorders(table *ImGuiTable)
- func TableDrawContextMenu(table *ImGuiTable)
- func TableEndCell(table *ImGuiTable)
- func TableEndRow(table *ImGuiTable)
- func TableFixColumnSortDirection(table *ImGuiTable, column *ImGuiTableColumn)
- func TableGcCompactSettings()
- func TableGcCompactTransientBuffers(table *ImGuiTable)
- func TableGcCompactTransientBuffersTempData(temp_data *ImGuiTableTempData)
- func TableGetColumnCount() int
- func TableGetColumnIndex() int
- func TableGetColumnName(column_n int) string
- func TableGetColumnWidthAuto(table *ImGuiTable, column *ImGuiTableColumn) float
- func TableGetHeaderRowHeight() float
- func TableGetHoveredColumn() int
- func TableGetMaxColumnWidth(table *ImGuiTable, column_n int) float
- func TableGetRowIndex() int
- func TableHeader(label string)
- func TableHeadersRow()
- func TableLoadSettings(table *ImGuiTable)
- func TableMergeDrawChannels(table *ImGuiTable)
- func TableNextColumn() bool
- func TableNextRow(row_flags ImGuiTableRowFlags, row_min_height float)
- func TableOpenContextMenu(column_n int)
- func TablePopBackgroundChannel()
- func TablePushBackgroundChannel()
- func TableRemove(table *ImGuiTable)
- func TableResetSettings(table *ImGuiTable)
- func TableSaveSettings(table *ImGuiTable)
- func TableSetBgColor(target ImGuiTableBgTarget, color ImU32, column_n int)
- func TableSetColumnEnabled(column_n int, enabled bool)
- func TableSetColumnIndex(column_n int) bool
- func TableSetColumnSortDirection(column_n int, sort_direction ImGuiSortDirection, append_to_sort_specs bool)
- func TableSetColumnWidth(column_n int, width float)
- func TableSetColumnWidthAutoAll(table *ImGuiTable)
- func TableSetColumnWidthAutoSingle(table *ImGuiTable, column_n int)
- func TableSettingsCalcChunkSize(columns_count int) size_t
- func TableSettingsHandler_ApplyAll(ctx *ImGuiContext, _ *ImGuiSettingsHandler)
- func TableSettingsHandler_ClearAll(ctx *ImGuiContext, _ *ImGuiSettingsHandler)
- func TableSettingsHandler_ReadLine(ctx *ImGuiContext, _ *ImGuiSettingsHandler, entry any, line string)
- func TableSettingsHandler_ReadOpen(ctx *ImGuiContext, _ *ImGuiSettingsHandler, name string) any
- func TableSettingsHandler_WriteAll(ctx *ImGuiContext, handler *ImGuiSettingsHandler, buf *ImGuiTextBuffer)
- func TableSettingsInit(settings *ImGuiTableSettings, id ImGuiID, columns_count, columns_count_max int)
- func TableSettingsInstallHandler(context *ImGuiContext)
- func TableSetupColumn(label string, flags ImGuiTableColumnFlags, init_width_or_weight float, ...)
- func TableSetupColumnFlags(table *ImGuiTable, column *ImGuiTableColumn, flags_in ImGuiTableColumnFlags)
- func TableSetupDrawChannels(table *ImGuiTable)
- func TableSetupScrollFreeze(columns int, rows int)
- func TableSortSpecsBuild(table *ImGuiTable)
- func TableSortSpecsSanitize(table *ImGuiTable)
- func TableUpdateBorders(table *ImGuiTable)
- func TableUpdateColumnsWeightFromWidth(table *ImGuiTable)
- func TableUpdateLayout(table *ImGuiTable)
- func TempInputIsActive(id ImGuiID) bool
- func TempInputScalar(bb *ImRect, id ImGuiID, label string, data_type ImGuiDataType, p_data any, ...) bool
- func TempInputText(bb *ImRect, id ImGuiID, label string, buf *[]byte, flags ImGuiInputTextFlags) bool
- func Text(format string, args ...any)
- func TextColored(col *ImVec4, format string, args ...any)
- func TextDisabled(format string, args ...any)
- func TextEx(text string, flags ImGuiTextFlags)
- func TextUnformatted(text string)
- func TextWrapped(format string, args ...any)
- func TreeNode(label string) bool
- func TreeNodeBehavior(id ImGuiID, flags ImGuiTreeNodeFlags, label string) bool
- func TreeNodeBehaviorIsOpen(id ImGuiID, flags ImGuiTreeNodeFlags) bool
- func TreeNodeEx(str_id string, flags ImGuiTreeNodeFlags, format string, args ...any) bool
- func TreeNodeF(str_id string, format string, args ...any) bool
- func TreeNodeInterface(ptr_id any, format string, args ...any) bool
- func TreeNodeInterfaceEx(ptr_id any, flags ImGuiTreeNodeFlags, format string, args ...any) bool
- func TreePop()
- func TreePush(str_id string)
- func TreePushInterface(ptr_id any)
- func TreePushOverrideID(id ImGuiID)
- func Unindent(indent_w float)
- func UnpackAccumulativeOffsetsIntoRanges(base_codepoint int, accumulative_offsets []int16, ...)
- func UnpackBitVectorToFlatIndexList(in *ImBitVector, out *[]int)
- func UpdateDebugToolItemPicker()
- func UpdateHoveredWindowAndCaptureFlags()
- func UpdateMouseInputs()
- func UpdateMouseMovingWindowEndFrame()
- func UpdateMouseMovingWindowNewFrame()
- func UpdateMouseWheel()
- func UpdateSettings()
- func UpdateTabFocus()
- func UpdateViewportsNewFrame()
- func UpdateWindowManualResize(window *ImGuiWindow, size_auto_fit *ImVec2, border_held *int, ...) bool
- func UpdateWindowParentAndRootLinks(window *ImGuiWindow, flags ImGuiWindowFlags, parent_window *ImGuiWindow)
- func VSliderFloat(label string, size ImVec2, v *float, v_min float, v_max float, format string, ...) bool
- func VSliderInt(label string, size ImVec2, v *int, v_min int, v_max int, format string, ...) bool
- func VSliderScalar(label string, size ImVec2, data_type ImGuiDataType, p_data any, p_min any, ...) bool
- func WindowSettingsHandler_ApplyAll(ctx *ImGuiContext, _ *ImGuiSettingsHandler)
- func WindowSettingsHandler_ClearAll(ctx *ImGuiContext, _ *ImGuiSettingsHandler)
- func WindowSettingsHandler_ReadLine(_ *ImGuiContext, _ *ImGuiSettingsHandler, entry any, line string)
- func WindowSettingsHandler_ReadOpen(_ *ImGuiContext, _ *ImGuiSettingsHandler, name string) any
- func WindowSettingsHandler_WriteAll(ctx *ImGuiContext, handler *ImGuiSettingsHandler, buf *ImGuiTextBuffer)
- type ImBitVector
- type ImDrawCallback
- type ImDrawChannel
- type ImDrawCmd
- type ImDrawCmdHeader
- type ImDrawData
- type ImDrawDataBuilder
- type ImDrawFlags
- type ImDrawIdx
- type ImDrawList
- func GetBackgroundDrawList(viewport *ImGuiViewport) *ImDrawList
- func GetForegroundDrawList(viewport *ImGuiViewport) *ImDrawList
- func GetForegroundDrawListViewport(viewport *ImGuiViewport) *ImDrawList
- func GetViewportDrawList(viewport *ImGuiViewportP, drawlist_no size_t, drawlist_name string) *ImDrawList
- func GetWindowDrawList() *ImDrawList
- func NewImDrawList(shared_data *ImDrawListSharedData) ImDrawList
- func (l *ImDrawList) AddBezierCubic(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, p4 ImVec2, col ImU32, thickness float, ...)
- func (l *ImDrawList) AddBezierQuadratic(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, col ImU32, thickness float, ...)
- func (l *ImDrawList) AddCallback(callback ImDrawCallback, callback_data any)
- func (l *ImDrawList) AddCircle(center ImVec2, radius float, col ImU32, num_segments int, thickness float)
- func (l *ImDrawList) AddCircleFilled(center ImVec2, radius float, col ImU32, num_segments int)
- func (l *ImDrawList) AddConvexPolyFilled(points []ImVec2, points_count int, col ImU32)
- func (l *ImDrawList) AddDrawCmd()
- func (l *ImDrawList) AddImage(user_texture_id ImTextureID, p_min ImVec2, p_max ImVec2, uv_min *ImVec2, ...)
- func (l *ImDrawList) AddImageQuad(user_texture_id ImTextureID, p1 *ImVec2, p2 *ImVec2, p3 ImVec2, p4 ImVec2, ...)
- func (l *ImDrawList) AddImageRounded(user_texture_id ImTextureID, p_min ImVec2, p_max ImVec2, ...)
- func (l *ImDrawList) AddLine(p1 *ImVec2, p2 *ImVec2, col ImU32, thickness float)
- func (l *ImDrawList) AddNgon(center ImVec2, radius float, col ImU32, num_segments int, thickness float)
- func (l *ImDrawList) AddNgonFilled(center ImVec2, radius float, col ImU32, num_segments int)
- func (l *ImDrawList) AddPolyline(points []ImVec2, points_count int, col ImU32, flags ImDrawFlags, ...)
- func (l *ImDrawList) AddQuad(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, p4 ImVec2, col ImU32, thickness float)
- func (l *ImDrawList) AddQuadFilled(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, p4 ImVec2, col ImU32)
- func (l *ImDrawList) AddRect(p_min ImVec2, p_max ImVec2, col ImU32, rounding float, flags ImDrawFlags, ...)
- func (l *ImDrawList) AddRectFilled(p_min, p_max ImVec2, col ImU32, rounding float, flags ImDrawFlags)
- func (l *ImDrawList) AddRectFilledMultiColor(p_min ImVec2, p_max ImVec2, ...)
- func (l *ImDrawList) AddText(pos ImVec2, col ImU32, text string)
- func (l *ImDrawList) AddTextV(font *ImFont, font_size float, pos ImVec2, col ImU32, text string, ...)
- func (l *ImDrawList) AddTriangle(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, col ImU32, thickness float)
- func (l *ImDrawList) AddTriangleFilled(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, col ImU32)
- func (l *ImDrawList) ChannelsMerge()
- func (l *ImDrawList) ChannelsSetCurrent(n int)
- func (l *ImDrawList) ChannelsSplit(count int)
- func (l *ImDrawList) CloneOutput() *ImDrawList
- func (l *ImDrawList) GetClipRectMax() ImVec2
- func (l *ImDrawList) GetClipRectMin() ImVec2
- func (l *ImDrawList) PathArcTo(center ImVec2, radius, a_min, a_max float, num_segments int)
- func (l *ImDrawList) PathArcToFast(center ImVec2, radius float, a_min_sample, a_max_sample int)
- func (l *ImDrawList) PathArcToFastEx(center ImVec2, radius float, a_min_sample, a_max_sample, a_step int)
- func (l *ImDrawList) PathBezierCubicCurveTo(p2 *ImVec2, p3 ImVec2, p4 ImVec2, num_segments int)
- func (l *ImDrawList) PathBezierQuadraticCurveTo(p2 *ImVec2, p3 ImVec2, num_segments int)
- func (l *ImDrawList) PathClear()
- func (l *ImDrawList) PathFillConvex(col ImU32)
- func (l *ImDrawList) PathLineTo(pos ImVec2)
- func (l *ImDrawList) PathLineToMergeDuplicate(pos ImVec2)
- func (l *ImDrawList) PathRect(a, b *ImVec2, rounding float, flags ImDrawFlags)
- func (l *ImDrawList) PathStroke(col ImU32, flags ImDrawFlags, thickness float)
- func (l *ImDrawList) PopClipRect()
- func (l *ImDrawList) PopTextureID()
- func (l *ImDrawList) PrimQuadUV(a, b, c, d *ImVec2, uv_a, uv_b, uv_c, uv_d *ImVec2, col ImU32)
- func (l *ImDrawList) PrimRect(a, c *ImVec2, col ImU32)
- func (l *ImDrawList) PrimRectUV(a, c, uv_a, uv_c *ImVec2, col ImU32)
- func (l *ImDrawList) PrimReserve(idx_count, vtx_count int)
- func (l *ImDrawList) PrimUnreserve(idx_count, vtx_count int)
- func (l *ImDrawList) PrimVtx(pos ImVec2, uv *ImVec2, col ImU32)
- func (l *ImDrawList) PrimWriteIdx(idx ImDrawIdx)
- func (l *ImDrawList) PrimWriteVtx(pos ImVec2, uv *ImVec2, col ImU32)
- func (l *ImDrawList) PushClipRect(cr_min, cr_max ImVec2, intersect_with_current_clip_rect bool)
- func (l *ImDrawList) PushClipRectFullScreen()
- func (l *ImDrawList) PushTextureID(texture_id ImTextureID)
- type ImDrawListFlags
- type ImDrawListSharedData
- type ImDrawListSplitter
- func (this *ImDrawListSplitter) Clear()
- func (this *ImDrawListSplitter) ClearFreeMemory()
- func (this *ImDrawListSplitter) Merge(draw_list *ImDrawList)
- func (this *ImDrawListSplitter) SetCurrentChannel(draw_list *ImDrawList, idx int)
- func (this *ImDrawListSplitter) Split(draw_list *ImDrawList, channels_count int)
- type ImDrawVert
- type ImFileHandle
- type ImFont
- func (f *ImFont) AddGlyph(cfg *ImFontConfig, codepoint ImWchar, ...)
- func (f *ImFont) AddRemapChar(dst, src ImWchar, overwrite_dst bool)
- func (f *ImFont) BuildLookupTable()
- func (f *ImFont) CalcTextSizeA(size, max_width, wrap_width float, text string, remaining *string) ImVec2
- func (f *ImFont) CalcWordWrapPositionA(scale float, text string, wrap_width float) int
- func (f *ImFont) ClearOutputData()
- func (f *ImFont) FindGlyph(c ImWchar) *ImFontGlyph
- func (f *ImFont) FindGlyphNoFallback(c ImWchar) *ImFontGlyph
- func (f *ImFont) GetCharAdvance(c ImWchar) float
- func (f *ImFont) GetDebugName() string
- func (f *ImFont) GrowIndex(new_size int)
- func (f *ImFont) IsGlyphRangeUnused(c_begin, c_last uint) bool
- func (f *ImFont) IsLoaded() bool
- func (f *ImFont) RenderChar(draw_list *ImDrawList, size float, pos ImVec2, col ImU32, c ImWchar)
- func (f *ImFont) RenderText(draw_list *ImDrawList, size float, pos ImVec2, col ImU32, clip_rect *ImVec4, ...)
- func (f *ImFont) SetGlyphVisible(c ImWchar, visible bool)
- type ImFontAtlas
- func (atlas *ImFontAtlas) AddCustomRectFontGlyph(font *ImFont, id ImWchar, width, height int, advance_x float, offset *ImVec2) int
- func (atlas *ImFontAtlas) AddCustomRectRegular(width, height int) int
- func (atlas *ImFontAtlas) AddFont(font_cfg *ImFontConfig) *ImFont
- func (atlas *ImFontAtlas) AddFontDefault(font_cfg_template *ImFontConfig) *ImFont
- func (atlas *ImFontAtlas) AddFontFromFileTTF(filename string, size_pixels float, font_cfg_template *ImFontConfig, ...) *ImFont
- func (atlas *ImFontAtlas) AddFontFromMemoryTTF(ttf_data []byte, ttf_size int, size_pixels float, ...) *ImFont
- func (atlas *ImFontAtlas) Build() bool
- func (atlas *ImFontAtlas) CalcCustomRectUV(rect *ImFontAtlasCustomRect, out_uv_min, out_uv_max *ImVec2)
- func (atlas *ImFontAtlas) Clear()
- func (atlas *ImFontAtlas) ClearFonts()
- func (atlas *ImFontAtlas) ClearInputData()
- func (atlas *ImFontAtlas) ClearTexData()
- func (atlas *ImFontAtlas) GetCustomRectByIndex(index int) *ImFontAtlasCustomRect
- func (atlas *ImFontAtlas) GetGlyphRangesChineseFull() []ImWchar
- func (atlas *ImFontAtlas) GetGlyphRangesChineseSimplifiedCommon() []ImWchar
- func (atlas *ImFontAtlas) GetGlyphRangesCyrillic() []ImWchar
- func (atlas *ImFontAtlas) GetGlyphRangesDefault() []ImWchar
- func (atlas *ImFontAtlas) GetGlyphRangesJapanese() []ImWchar
- func (atlas *ImFontAtlas) GetGlyphRangesKorean() []ImWchar
- func (atlas *ImFontAtlas) GetGlyphRangesThai() []ImWchar
- func (atlas *ImFontAtlas) GetGlyphRangesVietnamese() []ImWchar
- func (atlas *ImFontAtlas) GetMouseCursorTexData(cursor_type ImGuiMouseCursor, out_offset, out_size *ImVec2, ...) bool
- func (atlas *ImFontAtlas) GetTexDataAsAlpha8(out_pixels *[]byte, out_width, out_height, out_bytes_per_pixel *int)
- func (atlas *ImFontAtlas) GetTexDataAsRGBA32(out_pixels *[]uint32, out_width, out_height, out_bytes_per_pixel *int)
- func (atlas *ImFontAtlas) IsBuilt() bool
- func (atlas *ImFontAtlas) SetTexID(id ImTextureID)
- type ImFontAtlasCustomRect
- type ImFontAtlasFlags
- type ImFontBuildDstData
- type ImFontBuildSrcData
- type ImFontBuilderIO
- type ImFontConfig
- type ImFontGlyph
- type ImFontGlyphRangesBuilder
- func (b ImFontGlyphRangesBuilder) AddChar(c ImWchar)
- func (b ImFontGlyphRangesBuilder) AddRanges(ranges []ImWchar)
- func (b ImFontGlyphRangesBuilder) AddText(text string)
- func (b ImFontGlyphRangesBuilder) BuildRanges(out_ranges *[]ImWchar)
- func (b ImFontGlyphRangesBuilder) GetBit(n uintptr) bool
- func (b ImFontGlyphRangesBuilder) SetBit(n uintptr)
- type ImGuiAxis
- type ImGuiBackendFlags
- type ImGuiButtonFlags
- type ImGuiCol
- type ImGuiColorEditFlags
- type ImGuiColorMod
- type ImGuiComboFlags
- type ImGuiComboPreviewData
- type ImGuiCond
- type ImGuiConfigFlags
- type ImGuiContext
- type ImGuiContextHook
- type ImGuiContextHookCallback
- type ImGuiContextHookType
- type ImGuiDataType
- type ImGuiDataTypeInfo
- type ImGuiDataTypeTempStorage
- type ImGuiDir
- type ImGuiDragDropFlags
- type ImGuiErrorLogCallback
- type ImGuiFocusedFlags
- type ImGuiGroupData
- type ImGuiHoveredFlags
- type ImGuiID
- func AddContextHook(context *ImGuiContext, hook *ImGuiContextHook) ImGuiID
- func GetActiveID() ImGuiID
- func GetColumnsID(str_id string, columns_count int) ImGuiID
- func GetFocusID() ImGuiID
- func GetFocusScope() ImGuiID
- func GetFocusedFocusScope() ImGuiID
- func GetHoveredID() ImGuiID
- func GetIDFromInterface(ptr_id any) ImGuiID
- func GetIDFromString(str_id string) ImGuiID
- func GetIDWithSeed(str string, seed ImGuiID) ImGuiID
- func GetIDs(str_id_begin string) ImGuiID
- func GetItemID() ImGuiID
- func GetWindowResizeBorderID(window *ImGuiWindow, dir ImGuiDir) ImGuiID
- func GetWindowResizeCornerID(window *ImGuiWindow, n int) ImGuiID
- func GetWindowScrollbarID(window *ImGuiWindow, axis ImGuiAxis) ImGuiID
- func ImHashData(ptr unsafe.Pointer, data_size uintptr, seed ImU32) ImGuiID
- func ImHashStr(data_p string, data_size size_t, seed ImU32) ImGuiID
- func TableGetColumnResizeID(table *ImGuiTable, column_n int, instance_no int) ImGuiID
- type ImGuiIO
- type ImGuiInputReadMode
- type ImGuiInputSource
- type ImGuiInputTextCallback
- type ImGuiInputTextCallbackData
- func (this *ImGuiInputTextCallbackData) ClearSelection()
- func (this *ImGuiInputTextCallbackData) DeleteChars(pos, bytes_count int)
- func (this *ImGuiInputTextCallbackData) HasSelection() bool
- func (this *ImGuiInputTextCallbackData) InsertChars(pos int, new_text string)
- func (this *ImGuiInputTextCallbackData) SelectAll()
- type ImGuiInputTextFlags
- type ImGuiInputTextState
- func (s *ImGuiInputTextState) ClearSelection()
- func (s *ImGuiInputTextState) ClearText()
- func (s *ImGuiInputTextState) CursorAnimReset()
- func (s *ImGuiInputTextState) CursorClamp()
- func (s *ImGuiInputTextState) GetCursorPos() int
- func (s *ImGuiInputTextState) GetRedoAvailCount() int
- func (s *ImGuiInputTextState) GetSelectionEnd() int
- func (s *ImGuiInputTextState) GetSelectionStart() int
- func (s *ImGuiInputTextState) GetUndoAvailCount() int
- func (s *ImGuiInputTextState) HasSelection() bool
- func (s *ImGuiInputTextState) OnKeyPressed(key int)
- func (s *ImGuiInputTextState) SelectAll()
- type ImGuiItemFlags
- type ImGuiItemStatusFlags
- type ImGuiKey
- type ImGuiKeyModFlags
- type ImGuiLastItemData
- type ImGuiLayoutType
- type ImGuiListClipper
- type ImGuiLogType
- type ImGuiMenuColumns
- type ImGuiMetricsConfig
- type ImGuiMouseButton
- type ImGuiMouseCursor
- type ImGuiNavDirSourceFlags
- type ImGuiNavHighlightFlags
- type ImGuiNavInput
- type ImGuiNavItemData
- type ImGuiNavLayer
- type ImGuiNavMoveFlags
- type ImGuiNextItemData
- type ImGuiNextItemDataFlags
- type ImGuiNextWindowData
- type ImGuiNextWindowDataFlags
- type ImGuiOldColumnData
- type ImGuiOldColumnFlags
- type ImGuiOldColumns
- type ImGuiOnceUponAFrame
- type ImGuiPayload
- type ImGuiPlotArrayGetterData
- type ImGuiPlotType
- type ImGuiPopupData
- type ImGuiPopupFlags
- type ImGuiPopupPositionPolicy
- type ImGuiPtrOrIndex
- type ImGuiResizeBorderDef
- type ImGuiResizeGripDef
- type ImGuiSelectableFlags
- type ImGuiSeparatorFlags
- type ImGuiSettingsHandler
- type ImGuiShrinkWidthItem
- type ImGuiSizeCallback
- type ImGuiSizeCallbackData
- type ImGuiSliderFlags
- type ImGuiSortDirection
- type ImGuiStackSizes
- type ImGuiStorage
- func (this *ImGuiStorage) Clear()
- func (this *ImGuiStorage) GetBool(key ImGuiID, default_val bool) bool
- func (this *ImGuiStorage) GetFloat(key ImGuiID, default_val float) float
- func (this *ImGuiStorage) GetInt(key ImGuiID, default_val int) int
- func (this *ImGuiStorage) GetInterface(key ImGuiID) any
- func (this *ImGuiStorage) SetAllInt(val int)
- func (this *ImGuiStorage) SetBool(key ImGuiID, val bool)
- func (this *ImGuiStorage) SetFloat(key ImGuiID, val float)
- func (this *ImGuiStorage) SetInt(key ImGuiID, val int)
- func (this *ImGuiStorage) SetInterface(key ImGuiID, val any)
- type ImGuiStoragePair
- type ImGuiStyle
- type ImGuiStyleMod
- type ImGuiStyleVar
- type ImGuiTabBar
- type ImGuiTabBarFlags
- type ImGuiTabBarSection
- type ImGuiTabItem
- type ImGuiTabItemFlags
- type ImGuiTable
- type ImGuiTableBgTarget
- type ImGuiTableCellData
- type ImGuiTableColumn
- type ImGuiTableColumnFlags
- type ImGuiTableColumnIdx
- type ImGuiTableColumnSettings
- type ImGuiTableColumnSortSpecs
- type ImGuiTableDrawChannelIdx
- type ImGuiTableFlags
- type ImGuiTableRowFlags
- type ImGuiTableSettings
- type ImGuiTableSortSpecs
- type ImGuiTableTempData
- type ImGuiTextBuffer
- type ImGuiTextFilter
- type ImGuiTextFlags
- type ImGuiTooltipFlags
- type ImGuiTreeNodeFlags
- type ImGuiViewport
- type ImGuiViewportFlags
- type ImGuiViewportP
- func (p *ImGuiViewportP) CalcWorkRectPos(off_min *ImVec2) ImVec2
- func (p *ImGuiViewportP) CalcWorkRectSize(off_min *ImVec2, off_max *ImVec2) ImVec2
- func (p *ImGuiViewportP) GetBuildWorkRect() ImRect
- func (p *ImGuiViewportP) GetMainRect() ImRect
- func (p *ImGuiViewportP) GetWorkRect() ImRect
- func (p *ImGuiViewportP) UpdateWorkRect()
- type ImGuiWindow
- func CreateNewWindow(name string, flags ImGuiWindowFlags) *ImGuiWindow
- func FindWindowByID(id ImGuiID) *ImGuiWindow
- func FindWindowByName(e string) *ImGuiWindow
- func FindWindowNavFocusable(i_start, i_stop, dir int) *ImGuiWindow
- func GetCurrentWindow() *ImGuiWindow
- func GetCurrentWindowRead() *ImGuiWindow
- func GetTopMostPopupModal() *ImGuiWindow
- func NavRestoreLastChildNavWindow(window *ImGuiWindow) *ImGuiWindow
- func NewImGuiWindow(context *ImGuiContext, name string) *ImGuiWindow
- func (w *ImGuiWindow) CalcFontSize() float
- func (w *ImGuiWindow) GetIDFromRectangle(r_abs ImRect) ImGuiID
- func (w *ImGuiWindow) GetIDInt(n int) ImGuiID
- func (w *ImGuiWindow) GetIDInterface(ptr any) ImGuiID
- func (w *ImGuiWindow) GetIDNoKeepAlive(str string) ImGuiID
- func (w *ImGuiWindow) GetIDNoKeepAliveInt(n int) ImGuiID
- func (w *ImGuiWindow) GetIDNoKeepAliveInterface(ptr any) ImGuiID
- func (w *ImGuiWindow) GetIDs(str string) ImGuiID
- func (w *ImGuiWindow) MenuBarHeight() float
- func (w *ImGuiWindow) MenuBarRect() ImRect
- func (w *ImGuiWindow) Rect() ImRect
- func (w *ImGuiWindow) TitleBarHeight() float
- func (w *ImGuiWindow) TitleBarRect() ImRect
- type ImGuiWindowFlags
- type ImGuiWindowSettings
- type ImGuiWindowStackData
- type ImGuiWindowTempData
- type ImRect
- func GetPopupAllowedExtentRect(*ImGuiWindow) ImRect
- func GetResizeBorderRect(window *ImGuiWindow, border_n int, perp_padding, thickness float) ImRect
- func GetWindowScrollbarRect(window *ImGuiWindow, axis ImGuiAxis) ImRect
- func ImRectFromVec4(v *ImVec4) ImRect
- func TableGetCellBgRect(table *ImGuiTable, column_n int) ImRect
- func (this *ImRect) AddRect(r ImRect)
- func (this *ImRect) AddVec(p ImVec2)
- func (this *ImRect) ClipWith(r ImRect)
- func (this *ImRect) ClipWithFull(r ImRect)
- func (this *ImRect) ContainsRect(r ImRect) bool
- func (this *ImRect) ContainsVec(p ImVec2) bool
- func (this *ImRect) Expand(amount float)
- func (this *ImRect) ExpandVec(amount ImVec2)
- func (this *ImRect) Floor()
- func (this *ImRect) GetArea() float
- func (this *ImRect) GetBL() ImVec2
- func (this *ImRect) GetBR() ImVec2
- func (this *ImRect) GetCenter() ImVec2
- func (this *ImRect) GetHeight() float
- func (this *ImRect) GetSize() ImVec2
- func (this *ImRect) GetTL() ImVec2
- func (this *ImRect) GetTR() ImVec2
- func (this *ImRect) GetWidth() float
- func (this *ImRect) IsInverted() bool
- func (this *ImRect) Overlaps(r ImRect) bool
- func (this *ImRect) ToVec4() ImVec4
- func (this *ImRect) Translate(d ImVec2)
- func (this *ImRect) TranslateX(dx float)
- func (this *ImRect) TranslateY(dy float)
- type ImS16
- type ImS32
- type ImS64
- type ImS8
- type ImSpan
- type ImTextureID
- type ImU16
- type ImU32
- func ColorConvertFloat4ToU32(in ImVec4) ImU32
- func GetColorU32FromID(idx ImGuiCol, alpha_mul float) ImU32
- func GetColorU32FromInt(col ImU32) ImU32
- func GetColorU32FromVec(col ImVec4) ImU32
- func IM_COL32(R, G, B, A byte) ImU32
- func ImAlphaBlendColors(col_a, col_b ImU32) ImU32
- func TabBarCalcTabID(tab_bar *ImGuiTabBar, label string) ImU32
- type ImU64
- type ImU8
- type ImVec1
- type ImVec2
- func CalcItemSize(size ImVec2, default_w float, default_h float) ImVec2
- func CalcNextScrollFromScrollTargetAndClamp(window *ImGuiWindow) ImVec2
- func CalcTextSize(text string, hide_text_after_double_hash bool, wrap_width float) ImVec2
- func CalcWindowAutoFitSize(window *ImGuiWindow, size_contents *ImVec2) ImVec2
- func CalcWindowNextAutoFitSize(window *ImGuiWindow) ImVec2
- func CalcWindowSizeAfterConstraint(window *ImGuiWindow, size_desired *ImVec2) ImVec2
- func FindBestWindowPosForPopup(window *ImGuiWindow) ImVec2
- func FindBestWindowPosForPopupEx(ref_pos *ImVec2, size *ImVec2, last_dir *ImGuiDir, r_outer *ImRect, ...) ImVec2
- func GetContentRegionAvail() ImVec2
- func GetContentRegionMax() ImVec2
- func GetContentRegionMaxAbs() ImVec2
- func GetCursorPos() ImVec2
- func GetCursorScreenPos() ImVec2
- func GetCursorStartPos() ImVec2
- func GetFontTexUvWhitePixel() ImVec2
- func GetItemRectMax() ImVec2
- func GetItemRectMin() ImVec2
- func GetItemRectSize() ImVec2
- func GetMouseDragDelta(button ImGuiMouseButton, lock_threshold float) ImVec2
- func GetMousePos() ImVec2
- func GetMousePosOnOpeningCurrentPopup() ImVec2
- func GetNavInputAmount2d(dir_sources ImGuiNavDirSourceFlags, mode ImGuiInputReadMode, slow_factor float, ...) ImVec2
- func GetWindowContentRegionMax() ImVec2
- func GetWindowContentRegionMin() ImVec2
- func GetWindowPos() ImVec2
- func GetWindowSize() ImVec2
- func ImBezierCubicCalc(p1, p2, p3, p4 *ImVec2, t float32) ImVec2
- func ImBezierCubicClosestPoint(p1, p2, p3, p4 *ImVec2, p *ImVec2, num_segments int) ImVec2
- func ImBezierCubicClosestPointCasteljau(p1, p2, p3, p4 *ImVec2, p *ImVec2, tess_tol float32) ImVec2
- func ImBezierQuadraticCalc(p1, p2, p3 *ImVec2, t float32) ImVec2
- func ImClampVec2(v, mn *ImVec2, mx ImVec2) (res ImVec2)
- func ImFloorVec(v *ImVec2) *ImVec2
- func ImLerpVec2(a, b *ImVec2, t float) ImVec2
- func ImLerpVec2WithVec2(a, b *ImVec2, t ImVec2) ImVec2
- func ImLineClosestPoint(a, b, p *ImVec2) ImVec2
- func ImMaxVec2(lhs, rhs *ImVec2) (res ImVec2)
- func ImMinVec2(lhs, rhs *ImVec2) (res ImVec2)
- func ImMul(lhs, rhs *ImVec2) *ImVec2
- func ImRotate(v *ImVec2, cos_a, sin_a float) *ImVec2
- func ImTriangleClosestPoint(a, b, c, p *ImVec2) ImVec2
- func InputTextCalcTextSizeW(text []ImWchar, remaining *[]ImWchar, out_offset *ImVec2, ...) ImVec2
- func NavCalcPreferredRefPos() ImVec2
- func NewImVec2(x, y float) *ImVec2
- func ScrollToBringRectIntoView(window *ImGuiWindow, item_rect *ImRect) ImVec2
- func TabItemCalcSize(label string, has_close_button bool) ImVec2
- type ImVec2ih
- type ImVec4
- type ImWchar
- type ImWchar16
- type ImWchar32
- type STB_TEXTEDIT_CHARTYPE
- type STB_TEXTEDIT_KEYTYPE
- type STB_TEXTEDIT_POSITIONTYPE
- type STB_TEXTEDIT_STRING
- type STB_TexteditState
- type StbFindState
- type StbTexteditRow
- type StbUndoRecord
- type StbUndoState
Constants ¶
const ( IM_S8_MIN = -128 IM_S8_MAX = 127 IM_U8_MIN = 0 IM_U8_MAX = 255 IM_S16_MIN = -32768 IM_S16_MAX = 32767 IM_U16_MIN = 0 IM_U16_MAX = 65535 IM_S32_MIN = -2147483648 IM_S32_MAX = 2147483647 IM_U32_MIN = 0 IM_U32_MAX = 4294967295 IM_S64_MIN = -9223372036854775808 IM_S64_MAX = 9223372036854775807 IM_U64_MIN = 0 IM_U64_MAX = 18446744073709551615 )
const ( WRT_OuterRect = iota WRT_InnerRect WRT_OuterRectClipped WRT_InnerClipRect WRT_WorkRect WRT_Content WRT_ContentIdeal WRT_ContentRegionRect WRT_Count )
Debugging enums
const ( TRT_OuterRect = iota TRT_InnerRect TRT_WorkRect TRT_HostClipRect TRT_InnerClipRect TRT_BackgroundClipRect TRT_ColumnsRect TRT_ColumnsWorkRect TRT_ColumnsClipRect TRT_ColumnsContentHeadersUsed TRT_ColumnsContentHeadersIdeal TRT_ColumnsContentFrozen TRT_ColumnsContentUnfrozen TRT_Count )
const ( ImDrawFlags_None ImDrawFlags = 0 ImDrawFlags_Closed ImDrawFlags = 1 << 0 // PathStroke(), AddPolyline(): specify that shape should be closed (Important: this is always == 1 for legacy reason) ImDrawFlags_RoundCornersTopLeft ImDrawFlags = 1 << 4 // AddRect(), AddRectFilled(), PathRect(): enable rounding top-left corner only (when rounding > 0.0f, we default to all corners). Was 0x01. ImDrawFlags_RoundCornersTopRight ImDrawFlags = 1 << 5 // AddRect(), AddRectFilled(), PathRect(): enable rounding top-right corner only (when rounding > 0.0f, we default to all corners). Was 0x02. ImDrawFlags_RoundCornersBottomLeft ImDrawFlags = 1 << 6 // AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-left corner only (when rounding > 0.0f, we default to all corners). Was 0x04. ImDrawFlags_RoundCornersBottomRight ImDrawFlags = 1 << 7 // AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-right corner only (when rounding > 0.0f, we default to all corners). Wax 0x08. ImDrawFlags_RoundCornersNone ImDrawFlags = 1 << 8 // AddRect(), AddRectFilled(), PathRect(): disable rounding on all corners (when rounding > 0.0f). This is NOT zero, NOT an implicit flag! ImDrawFlags_RoundCornersTop = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight ImDrawFlags_RoundCornersBottom = ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight ImDrawFlags_RoundCornersLeft = ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersTopLeft ImDrawFlags_RoundCornersRight = ImDrawFlags_RoundCornersBottomRight | ImDrawFlags_RoundCornersTopRight ImDrawFlags_RoundCornersAll = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight | ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight ImDrawFlags_RoundCornersDefault_ = ImDrawFlags_RoundCornersAll // Default to ALL corners if none of the _RoundCornersXX flags are specified. ImDrawFlags_RoundCornersMask_ = ImDrawFlags_RoundCornersAll | ImDrawFlags_RoundCornersNone )
Flags for ImDrawList functions (Legacy: bit 0 must always correspond to ImDrawFlags_Closed to be backward compatible with old API using a bool. Bits 1..3 must be unused)
const ( ImGuiDataType_String = iota + ImGuiDataType_COUNT + 1 ImGuiDataType_Pointer ImGuiDataType_ID )
Extend ImGuiDataType_
const ( STB_TEXTEDIT_NEWLINE = '\n' STB_TEXTEDIT_GETWIDTH_NEWLINE = -1 STB_TEXTEDIT_UNDOSTATECOUNT = 99 STB_TEXTEDIT_UNDOCHARCOUNT = 999 )
const ( STB_TEXTEDIT_K_LEFT = 0x200000 + iota STB_TEXTEDIT_K_RIGHT STB_TEXTEDIT_K_UP STB_TEXTEDIT_K_DOWN STB_TEXTEDIT_K_PGUP STB_TEXTEDIT_K_PGDOWN STB_TEXTEDIT_K_LINESTART STB_TEXTEDIT_K_LINEEND STB_TEXTEDIT_K_TEXTSTART STB_TEXTEDIT_K_TEXTEND STB_TEXTEDIT_K_DELETE STB_TEXTEDIT_K_BACKSPACE STB_TEXTEDIT_K_UNDO STB_TEXTEDIT_K_REDO STB_TEXTEDIT_K_INSERT STB_TEXTEDIT_K_WORDLEFT STB_TEXTEDIT_K_WORDRIGHT STB_TEXTEDIT_K_LINESTART2 STB_TEXTEDIT_K_LINEEND2 STB_TEXTEDIT_K_TEXTSTART2 STB_TEXTEDIT_K_TEXTEND2 )
const ( TABLE_DRAW_CHANNEL_BG0 int = 0 TABLE_DRAW_CHANNEL_BG2_FROZEN int = 1 TABLE_DRAW_CHANNEL_NOCLIP int = 2 TABLE_BORDER_SIZE float = 1.0 TABLE_RESIZE_SEPARATOR_HALF_THICKNESS float = 4.0 TABLE_RESIZE_SEPARATOR_FEEDBACK_TIMER float = 0.06 )
const COLUMNS_HIT_RECT_HALF_WIDTH float = 4
const DRAGDROP_HOLD_TO_OPEN_TIMER float = 0.70 // Time for drag-hold to activate items accepting the ImGuiButtonFlags_PressedOnDragDropHold button behavior.
const DRAG_MOUSE_THRESHOLD_FACTOR float = 0.50 // Multiplier for the default value of io.MouseDragThreshold to make DragFloat/DragInt react faster to mouse drags.
const FLT_MAX = math.MaxFloat32
const FLT_MIN = math.SmallestNonzeroFloat32
const FONT_ATLAS_DEFAULT_TEX_DATA_H int = 27
const FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS = "" +
"..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX- XX " +
"..- -X.....X- X.X - X.X -X.....X - X.....X- X..X " +
"--- -XXX.XXX- X...X - X...X -X....X - X....X- X..X " +
"X - X.X - X.....X - X.....X -X...X - X...X- X..X " +
"XX - X.X -X.......X- X.......X -X..X.X - X.X..X- X..X " +
"X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X- X..XXX " +
"X..X - X.X - X.X - X.X -XX X.X - X.X XX- X..X..XXX " +
"X...X - X.X - X.X - XX X.X XX - X.X - X.X - X..X..X..XX " +
"X....X - X.X - X.X - X.X X.X X.X - X.X - X.X - X..X..X..X.X " +
"X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X -XXX X..X..X..X..X" +
"X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X -X..XX........X..X" +
"X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X -X...X...........X" +
"X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X - X..............X" +
"X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X - X.............X" +
"X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X - X.............X" +
"X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X - X............X" +
"X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX - X...........X " +
"X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------- X..........X " +
"X.X X..X - -X.......X- X.......X - XX XX - - X..........X " +
"XX X..X - - X.....X - X.....X - X.X X.X - - X........X " +
" X..X - X...X - X...X - X..X X..X - - X........X " +
" XX - X.X - X.X - X...XXXXXXXXXXXXX...X - - XXXXXXXXXX " +
"------------ - X - X -X.....................X- ------------------" +
" ----------------------------------- X...XXXXXXXXXXXXX...X - " +
" - X..X X..X - " +
" - X.X X.X - " +
" - XX XX - "
const FONT_ATLAS_DEFAULT_TEX_DATA_W int = 108 // Actual texture will be 2 times that + 1 spacing.
FONT_ATLAS_DEFAULT_TEX_DATA_W A work of art lies ahead! (. = white layer, X = black layer, others are blank) The 2x2 white texels on the top left are the ones we'll use everywhere in Dear ImGui to render filled shapes.
const IMGUI_HAS_TABLE = true
const IMGUI_PAYLOAD_TYPE_COLOR_3F = "_COL3F" // float[3]: Standard type for colors, without alpha. User code may use this type.
Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui.
const IMGUI_PAYLOAD_TYPE_COLOR_4F = "_COL4F" // float[4]: Standard type for colors. User code may use this type.
const IMGUI_TABLE_MAX_COLUMNS = 64 // sizeof(ImU64) * 8. This is solely because we frequently encode columns set in a ImU64.
const IMGUI_TABLE_MAX_DRAW_CHANNELS = (4 + 64*2) // See TableSetupDrawChannels()
const IMGUI_VERSION = "1.85 WIP"
const IMGUI_VERSION_NUM = 18411
const IM_COL32_A_MASK = 0xFF000000
const IM_COL32_A_SHIFT = 24
const IM_COL32_BLACK = 0xFF00000
const IM_COL32_BLACK_TRANS = 0x0000000
const IM_COL32_B_SHIFT = 16
const IM_COL32_G_SHIFT = 8
const IM_COL32_R_SHIFT = 0
const IM_COL32_WHITE = 0xFFFFFFF
const IM_DRAWLIST_ARCFAST_SAMPLE_MAX = IM_DRAWLIST_ARCFAST_TABLE_SIZE
const IM_DRAWLIST_ARCFAST_TABLE_SIZE = 48
const IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX = 512
const IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN = 4
const IM_DRAWLIST_TEX_LINES_WIDTH_MAX = 63
IM_DRAWLIST_TEX_LINES_WIDTH_MAX The maximum line width to bake anti-aliased textures for. Build atlas with ImFontAtlasFlags_NoBakedLines to disable baking.
const IM_FIXNORMAL2F_MAX_INVLEN2 float = 100
const IM_NEWLINE = "\n"
const IM_PI = 3.14159265358979323846
const IM_TABSIZE = 4
const IM_UNICODE_CODEPOINT_INVALID = unicode.ReplacementChar
const IM_UNICODE_CODEPOINT_MAX = 0xFFFF
IM_UNICODE_CODEPOINT_MAX /*
const INT_MAX = math.MaxInt32
const NAV_WINDOWING_HIGHLIGHT_DELAY float = 0.20 // Time before the highlight and screen dimming starts fading in
const NAV_WINDOWING_LIST_APPEAR_DELAY float = 0.15 // Time before the window list starts to appear
NAV_WINDOWING_LIST_APPEAR_DELAY When using CTRL+TAB (or Gamepad Square+L/R) we delay the visual a little in order to reduce visual noise doing a fast switch.
const STB_TEXTEDIT_K_SHIFT = 0x400000
const WINDOWS_HOVER_PADDING float = 4.0 // Extend outside window for hovering/resizing (maxxed with TouchPadding) and inside windows for borders. Affect FindHoveredWindow().
const WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER float = 2.00 // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certain time, unless mouse moved.
const WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER float = 0.04 // Reduce visual noise by only highlighting the border after a certain time.
Variables ¶
var FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA = [ImGuiMouseCursor_COUNT][3]ImVec2{ {ImVec2{0, 3}, ImVec2{12, 19}, ImVec2{0, 0}}, {ImVec2{13, 0}, ImVec2{7, 16}, ImVec2{1, 8}}, {ImVec2{31, 0}, ImVec2{23, 23}, ImVec2{11, 11}}, {ImVec2{21, 0}, ImVec2{9, 23}, ImVec2{4, 11}}, {ImVec2{55, 18}, ImVec2{23, 9}, ImVec2{11, 4}}, {ImVec2{73, 0}, ImVec2{17, 17}, ImVec2{8, 8}}, {ImVec2{55, 0}, ImVec2{17, 17}, ImVec2{8, 8}}, {ImVec2{91, 0}, ImVec2{17, 22}, ImVec2{5, 0}}, }
var GCrc32LookupTable = [256]ImU32{}/* 256 elements not displayed */
GCrc32LookupTable CRC32 needs a 1KB lookup table (not cache friendly) Although the code to generate the table is simple and shorter than the table itself, using a const table allows us to easily: - avoid an unnecessary branch/memory tap, - keep the ImHashXXX functions usable by static constructors, - make it thread-safe.
var GDataTypeInfo = []ImGuiDataTypeInfo{ {unsafe.Sizeof(int8(0)), "S8", "%v", "%v"}, {unsafe.Sizeof(uint8(0)), "U8", "%v", "%v"}, {unsafe.Sizeof(int16(0)), "S16", "%v", "%v"}, {unsafe.Sizeof(uint16(0)), "U16", "%v", "%v"}, {unsafe.Sizeof(int(0)), "S32", "%v", "%v"}, {unsafe.Sizeof(uint(0)), "U32", "%v", "%v"}, {unsafe.Sizeof(ImS64(0)), "S64", "%v", "%v"}, {unsafe.Sizeof(ImU64(0)), "U64", "%v", "%v"}, {unsafe.Sizeof(float(0)), "float", "%.3f", "%f"}, {unsafe.Sizeof(double(0)), "double", "%f", "%lf"}, }
var IM_COL32_DISABLE = IM_COL32(0, 0, 0, 1) // Special sentinel code which cannot be used as a regular color.
Functions ¶
func ActivateItem ¶
func ActivateItem(id ImGuiID)
Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.
func AddDrawListToDrawData ¶
func AddDrawListToDrawData(out_list *[]*ImDrawList, draw_list *ImDrawList)
func AddRootWindowToDrawData ¶
func AddRootWindowToDrawData(window *ImGuiWindow)
Layer is locked for the root window, however child windows may use a different viewport (e.g. extruding menu)
func AddWindowToDrawData ¶
func AddWindowToDrawData(window *ImGuiWindow, layer int)
func AddWindowToSortBuffer ¶
func AddWindowToSortBuffer(out_sorted_windows *[]*ImGuiWindow, window *ImGuiWindow)
func AlignTextToFramePadding ¶
func AlignTextToFramePadding()
vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item)
func ApplyWindowSettings ¶
func ApplyWindowSettings(window *ImGuiWindow, settings *ImGuiWindowSettings)
func ArrowButton ¶
square button with an arrow shape
func ArrowButtonEx ¶
func ArrowButtonEx(str_id string, dir ImGuiDir, size ImVec2, flags ImGuiButtonFlags) bool
func Begin ¶
func Begin(name string, p_open *bool, flags ImGuiWindowFlags) bool
Push a new Dear ImGui window to add widgets to.
- A default window called "Debug" is automatically stacked at the beginning of every frame so you can use widgets without explicitly calling a Begin/End pair.
- Begin/End can be called multiple times during the frame with the same window name to append content.
- The window name is used as a unique identifier to preserve window information across frames (and save rudimentary information to the .ini file). You can use the "##" or "###" markers to use the same label with different id, or same id with different label. See documentation at the top of this file.
- Return false when window is collapsed, so you can early out in your code. You always need to call ImGui::End() even if false is returned.
- Passing 'bool* p_open' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed.
func BeginChild ¶
func BeginChild(str_id string, size ImVec2, border bool, flags ImGuiWindowFlags) bool
Child Windows
- Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child.
- For each independent axis of 'size': ==0.0: use remaining host window size / >0.0: fixed size / <0.0: use remaining window size minus abs(size) / Each axis can use a different mode, e.g. ImVec2(0,400).
- BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window. Always call a matching EndChild() for each BeginChild() call, regardless of its return value. [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
func BeginChildEx ¶
func BeginChildEx(name string, id ImGuiID, size_arg *ImVec2, border bool, flags ImGuiWindowFlags) bool
Popups, Modals, Tooltips
func BeginChildFrame ¶
func BeginChildFrame(id ImGuiID, size ImVec2, flags ImGuiWindowFlags) bool
calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can. helper to create a child window / scrolling region that looks like a normal widget frame
func BeginChildID ¶
func BeginChildID(id ImGuiID, size ImVec2, border bool, flags ImGuiWindowFlags) bool
func BeginColumns ¶
func BeginColumns(str_id string, columns_count int, flags ImGuiOldColumnFlags)
setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().
func BeginCombo ¶
func BeginCombo(label string, preview_value string, flags ImGuiComboFlags) bool
func BeginComboPopup ¶
func BeginComboPopup(popup_id ImGuiID, bb *ImRect, flags ImGuiComboFlags) bool
func BeginComboPreview ¶
func BeginComboPreview() bool
Call directly after the BeginCombo/EndCombo block. The preview is designed to only host non-interactive elements (Experimental, see GitHub issues: #1658, #4168)
func BeginDisabled ¶
func BeginDisabled(disabled bool)
BeginDisabled BeginDisabled()/EndDisabled() - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled) - Visually this is currently altering alpha, but it is expected that in a future styling system this would work differently. - Feedback welcome at https://github.com/ocornut/imgui/issues/211 - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(False)/EndDisabled() best to avoid it. - Optimized shortcuts instead of PushStyleVar() + PushItemFlag()
func BeginDragDropSource ¶
func BeginDragDropSource(flags ImGuiDragDropFlags) bool
BeginDragDropSource When this returns true you need to: a) call SetDragDropPayload() exactly once, b) you may render the payload visual/description, c) call EndDragDropSource() If the item has an identifier: - This assume/require the item to be activated (typically via ButtonBehavior). - Therefore if you want to use this with a mouse button other than left mouse button, it is up to the item itself to activate with another button. - We then pull and use the mouse button that was used to activate the item and use it to carry on the drag. If the item has no identifier: - Currently always assume left mouse button. call after submitting an item which may be dragged. when this return true, you can call SetDragDropPayload() + EndDragDropSource()
func BeginDragDropTarget ¶
func BeginDragDropTarget() bool
BeginDragDropTarget call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()\ We don't use BeginDragDropTargetCustom() and duplicate its code because: 1) we use LastItemRectHoveredRect which handles items that pushes a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them. 2) and it's faster. as this code may be very frequently called, we want to early out as fast as we can. Also note how the HoveredWindow test is positioned differently in both functions (in both functions we optimize for the cheapest early out case)
func BeginDragDropTargetCustom ¶
BeginDragDropTargetCustom Drag and Drop
func BeginGroup ¶
func BeginGroup()
Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) Groups are currently a mishmash of functionalities which should perhaps be clarified and separated.
func BeginListBox ¶
open a framed scrolling region Tip: To have a list filling the entire window width, use size.x = -FLT_MIN and pass an non-visible label e.g. "##empty" Tip: If your vertical size is calculated from an item count (e.g. 10 * item_height) consider adding a fractional part to facilitate seeing scrolling boundaries (e.g. 10.25 * item_height).
func BeginMenuBar ¶
func BeginMenuBar() bool
append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window). FIXME: Provided a rectangle perhaps e.g. a BeginMenuBarEx() could be used anywhere.. Currently the main responsibility of this function being to setup clip-rect + horizontal layout + menu navigation layer. Ideally we also want this to be responsible for claiming space out of the main window scrolling rectangle, in which case ImGuiWindowFlags_MenuBar will become unnecessary. Then later the same system could be used for multiple menu-bars, scrollbars, side-bars.
func BeginPopup ¶
func BeginPopup(str_id string, flags ImGuiWindowFlags) bool
BeginPopup Popups: begin/end functions
- BeginPopup(): query popup state, if open start appending into the window. Call EndPopup() afterwards. ImGuiWindowFlags are forwarded to the window.
- BeginPopupModal(): block every interactions behind the window, cannot be closed by user, add a dimming background, has a title bar.
return true if the popup is open, and you can start outputting to it.
func BeginPopupContext ¶
func BeginPopupContext(str_id string, popup_flags ImGuiPopupFlags) bool
BeginPopupContext open+begin popup when clicked in (where there are no windows).
func BeginPopupContextItem ¶
func BeginPopupContextItem(str_id string, popup_flags ImGuiPopupFlags) bool
BeginPopupContextItem This is a helper to handle the simplest case of associating one named popup to one given widget. - To create a popup associated to the last item, you generally want to pass a nil value to str_id. - To create a popup with a specific identifier, pass it in str_id.
- This is useful when using using BeginPopupContextItem() on an item which doesn't have an identifier, e.g. a Text() call.
- This is useful when multiple code locations may want to manipulate/open the same popup, given an explicit id.
- You may want to handle the whole on user side if you have specific needs (e.g. tweaking IsItemHovered() parameters). This is essentially the same as: id = str_id ? GetID(str_id) : GetItemID(); OpenPopupOnItemClick(str_id); return BeginPopup(id); Which is essentially the same as: id = str_id ? GetID(str_id) : GetItemID(); if (IsItemHovered() && IsMouseReleased(ImGuiMouseButton_Right)) OpenPopup(id); return BeginPopup(id); The main difference being that this is tweaked to avoid computing the ID twice.
open+begin popup when clicked on last item. Use str_id==NULL to associate the popup to previous item. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp!
func BeginPopupContextVoid ¶
func BeginPopupContextVoid(str_id string, popup_flags ImGuiPopupFlags) bool
func BeginPopupContextWindow ¶
func BeginPopupContextWindow(str_id string, popup_flags ImGuiPopupFlags) bool
BeginPopupContextWindow open+begin popup when clicked on current window.
func BeginPopupEx ¶
func BeginPopupEx(id ImGuiID, flags ImGuiWindowFlags) bool
BeginPopupEx Attention! BeginPopup() adds default flags which BeginPopupEx()!
func BeginPopupModal ¶
func BeginPopupModal(name string, p_open *bool, flags ImGuiWindowFlags) bool
BeginPopupModal If 'p_open' is specified for a modal popup window, the popup will have a regular close button which will close the popup. Note that popup visibility status is owned by Dear ImGui (and manipulated with e.g. OpenPopup) so the actual value of *p_open is meaningless here. return true if the modal is open, and you can start outputting to it.
func BeginTabBar ¶
func BeginTabBar(str_id string, flags ImGuiTabBarFlags) bool
create and append into a TabBar
func BeginTabBarEx ¶
func BeginTabBarEx(tab_bar *ImGuiTabBar, tab_bar_bb *ImRect, flags ImGuiTabBarFlags) bool
Tab Bars
func BeginTabItem ¶
func BeginTabItem(label string, p_open *bool, flags ImGuiTabItemFlags) bool
create a Tab. Returns true if the Tab is selected.
func BeginTable ¶
func BeginTable(str_id string, columns_count int, flags ImGuiTableFlags, outer_size ImVec2, inner_width float) bool
BeginTable Tables [BETA API] API may evolve slightly! If you use this, please update to the next version when it comes out! - Full-featured replacement for old Columns API. - See Demo->Tables for demo code. - See top of imgui_tables.cpp for general commentary. - See ImGuiTableFlags_ and ImGuiTableColumnFlags_ enums for a description of available flags. The typical call flow is: - 1. Call BeginTable(). - 2. Optionally call TableSetupColumn() to submit column name/flags/defaults. - 3. Optionally call TableSetupScrollFreeze() to request scroll freezing of columns/rows. - 4. Optionally call TableHeadersRow() to submit a header row. Names are pulled from TableSetupColumn() data. - 5. Populate contents:
- In most situations you can use TableNextRow() + TableSetColumnIndex(N) to start appending into a column.
- If you are using tables as a sort of grid, where every columns is holding the same type of contents, you may prefer using TableNextColumn() instead of TableNextRow() + TableSetColumnIndex(). TableNextColumn() will automatically wrap-around into the next row if needed.
- IMPORTANT: Comparatively to the old Columns() API, we need to call TableNextColumn() for the first column!
- Summary of possible call flow: -------------------------------------------------------------------------------------------------------- TableNextRow() -> TableSetColumnIndex(0) -> Text("Hello 0") -> TableSetColumnIndex(1) -> Text("Hello 1") // OK TableNextRow() -> TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK: TableNextColumn() automatically gets to next row! TableNextRow() -> Text("Hello 0") // Not OK! Missing TableSetColumnIndex() or TableNextColumn()! Text will not appear! --------------------------------------------------------------------------------------------------------
- 5. Call EndTable() Read about "TABLE SIZING" at the top of this file.
func BeginTableEx ¶
func BeginTableEx(name string, id ImGuiID, columns_count int, flags ImGuiTableFlags, outer_size *ImVec2, inner_width float) bool
func BeginTooltip ¶
func BeginTooltip()
BeginTooltip Tooltips - Tooltip are windows following the mouse. They do not take focus away. begin/append a tooltip window. to create full-featured tooltip (with any kind of items).
func BeginTooltipEx ¶
func BeginTooltipEx(extra_flags ImGuiWindowFlags, tooltip_flags ImGuiTooltipFlags)
func BeginViewportSideBar ¶
func BeginViewportSideBar(name string, viewport_p *ImGuiViewport, dir ImGuiDir, axis_size float, window_flags ImGuiWindowFlags) bool
Important: calling order matters! FIXME: Somehow overlapping with docking tech. FIXME: The "rect-cut" aspect of this could be formalized into a lower-level helper (rect-cut: https://halt.software/dead-simple-layouts)
func BringWindowToDisplayBack ¶
func BringWindowToDisplayBack(window *ImGuiWindow)
func BringWindowToDisplayFront ¶
func BringWindowToDisplayFront(window *ImGuiWindow)
func BringWindowToFocusFront ¶
func BringWindowToFocusFront(window *ImGuiWindow)
func Bullet ¶
func Bullet()
draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
func BulletText ¶
Text with a little bullet aligned to the typical tree node. shortcut for Bullet()+Text()
func ButtonBehavior ¶
func ButtonBehavior(bb *ImRect, id ImGuiID, out_hovered *bool, out_held *bool, flags ImGuiButtonFlags) bool
The ButtonBehavior() function is key to many interactions and used by many/most widgets. Because we handle so many cases (keyboard/gamepad navigation, drag and drop) and many specific behavior (via ImGuiButtonFlags_), this code is a little complex. By far the most common path is interacting with the Mouse using the default ImGuiButtonFlags_PressedOnClickRelease button behavior. See the series of events below and the corresponding state reported by dear imgui: ------------------------------------------------------------------------------------------------------------------------------------------------ with PressedOnClickRelease: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked()
Frame N+0 (mouse is outside bb) - - - - - - Frame N+1 (mouse moves inside bb) - true - - - - Frame N+2 (mouse button is down) - true true true - true Frame N+3 (mouse button is down) - true true - - - Frame N+4 (mouse moves outside bb) - - true - - - Frame N+5 (mouse moves inside bb) - true true - - - Frame N+6 (mouse button is released) true true - - true - Frame N+7 (mouse button is released) - true - - - - Frame N+8 (mouse moves outside bb) - - - - - -
------------------------------------------------------------------------------------------------------------------------------------------------ with PressedOnClick: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked()
Frame N+2 (mouse button is down) true true true true - true Frame N+3 (mouse button is down) - true true - - - Frame N+6 (mouse button is released) - true - - true - Frame N+7 (mouse button is released) - true - - - -
------------------------------------------------------------------------------------------------------------------------------------------------ with PressedOnRelease: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked()
Frame N+2 (mouse button is down) - true - - - true Frame N+3 (mouse button is down) - true - - - - Frame N+6 (mouse button is released) true true - - - - Frame N+7 (mouse button is released) - true - - - -
------------------------------------------------------------------------------------------------------------------------------------------------ with PressedOnDoubleClick: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked()
Frame N+0 (mouse button is down) - true - - - true Frame N+1 (mouse button is down) - true - - - - Frame N+2 (mouse button is released) - true - - - - Frame N+3 (mouse button is released) - true - - - - Frame N+4 (mouse button is down) true true true true - true Frame N+5 (mouse button is down) - true true - - - Frame N+6 (mouse button is released) - true - - true - Frame N+7 (mouse button is released) - true - - - -
------------------------------------------------------------------------------------------------------------------------------------------------ Note that some combinations are supported, - PressedOnDragDropHold can generally be associated with any flag. - PressedOnDoubleClick can be associated by PressedOnClickRelease/PressedOnRelease, in which case the second release event won't be reported. ------------------------------------------------------------------------------------------------------------------------------------------------ The behavior of the return-value changes when ImGuiButtonFlags_Repeat is set:
Repeat+ Repeat+ Repeat+ Repeat+ PressedOnClickRelease PressedOnClick PressedOnRelease PressedOnDoubleClick
-------------------------------------------------------------------------------------------------------------------------------------------------
Frame N+0 (mouse button is down) - true - true ... - - - - Frame N + RepeatDelay true true - true ... - - - - Frame N + RepeatDelay + RepeatRate*N true true - true
-------------------------------------------------------------------------------------------------------------------------------------------------
func CalcItemWidth ¶
func CalcItemWidth() float
Calculate default item width given value passed to PushItemWidth() or SetNextItemWidth(). The SetNextItemWidth() data is generally cleared/consumed by ItemAdd() or NextItemData.ClearFlags() width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most 'Item' functions.
func CalcListClipping ¶
func CalcListClipping(items_count int, items_height float, out_items_display_start *int, out_items_display_end *int)
Helper to calculate coarse clipping of large list of evenly sized items. NB: Prefer using the ImGuiListClipper higher-level helper if you can! Read comments and instructions there on how those use this sort of pattern. NB: 'items_count' is only used to clamp the result, if you don't know your count you can use INT_MAX
func CalcMaxPopupHeightFromItemCount ¶
func CalcMaxPopupHeightFromItemCount(items_count int) float32
func CalcResizePosSizeFromAnyCorner ¶
func CalcResizePosSizeFromAnyCorner(window *ImGuiWindow, corner_target, corner_norm *ImVec2, out_pos, out_size *ImVec2)
func CalcScrollEdgeSnap ¶
func CalcScrollEdgeSnap(target, snap_min, snap_max, snap_threshold, center_ratio float) float
CalcScrollEdgeSnap Helper to snap on edges when aiming at an item very close to the edge, So the difference between WindowPadding and ItemSpacing will be in the visible area after scrolling. When we refactor the scrolling API this may be configurable with a flag? Note that the effect for this won't be visible on X axis with default Style settings as WindowPadding.x == ItemSpacing.x by default.
func CalcTypematicRepeatAmount ¶
func CalcTypematicRepeatAmount(t0, t1, repeat_delay, repeat_rate float) int
CalcTypematicRepeatAmount t0 = previous time (e.g.: g.Time - g.IO.DeltaTime) t1 = current time (e.g.: g.Time) An event is triggered at:
t = 0.0f t = repeat_delay, t = repeat_delay + repeat_rate*N
func CalcWindowContentSizes ¶
func CalcWindowContentSizes(window *ImGuiWindow, content_size_current, content_size_ideal *ImVec2)
func CalcWrapWidthForPos ¶
func CalcWrapWidthForPos(pos *ImVec2, wrap_pos_x float) float
func CallContextHooks ¶
func CallContextHooks(ctx *ImGuiContext, hook_type ImGuiContextHookType)
CallContextHooks Call context hooks (used by e.g. test engine) We assume a small number of hooks so all stored in same array
func CaptureKeyboardFromApp ¶
func CaptureKeyboardFromApp(want_capture_keyboard_value bool)
attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value" {panic("not implemented")} after the next NewFrame() call.
func CaptureMouseFromApp ¶
func CaptureMouseFromApp(want_capture_mouse_value bool)
CaptureMouseFromApp attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value {panic("not implemented")}" after the next NewFrame() call.
func CheckboxFlagsInt ¶
func CheckboxFlagsUint ¶
func ChildWindowComparer ¶
func ChildWindowComparer(a, b *ImGuiWindow) int
FIXME: Add a more explicit sort order in the window structure.
func ClampWindowRect ¶
func ClampWindowRect(window *ImGuiWindow, visibility_rect *ImRect)
func ClearActiveID ¶
func ClearActiveID()
func ClearDragDrop ¶
func ClearDragDrop()
func ClearIniSettings ¶
func ClearIniSettings()
func CloseCurrentPopup ¶
func CloseCurrentPopup()
CloseCurrentPopup manually close the popup we have begin-ed into.
func ClosePopupToLevel ¶
func ClosePopupToLevel(remaining int, restore_focus_to_window_under_popup bool)
func ClosePopupsOverWindow ¶
func ClosePopupsOverWindow(ref_window *ImGuiWindow, restore_focus_to_window_under_popup bool)
ClosePopupsOverWindow When popups are stacked, clicking on a lower level popups puts focus back to it and close popups above it. This function closes any popups that are over 'ref_window'.
func CollapseButton ¶
func CollapsingHeader ¶
func CollapsingHeader(label string, flags ImGuiTreeNodeFlags) bool
CollapsingHeader returns true when opened but do not indent nor push into the ID stack (because of the ImGuiTreeNodeFlags_NoTreePushOnOpen flag). This is basically the same as calling TreeNodeEx(label, ImGuiTreeNodeFlags_CollapsingHeader). You can remove the _NoTreePushOnOpen flag if you want behavior closer to normal TreeNode(). if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop().
func CollapsingHeaderVisible ¶
func CollapsingHeaderVisible(label string, p_visible *bool, flags ImGuiTreeNodeFlags) bool
when 'p_visible != NULL': if '*p_visible==true' display an additional small close button on upper right of the header which will set the to bool false when clicked, if '*p_visible==false' don't display the header. p_visible == nil : regular collapsing header p_visible != nil && *p_visible == true : show a small close button on the corner of the header, clicking the button will set *p_visible = false p_visible != nil && *p_visible == false : do not show the header at all Do not mistake this with the Open state of the header itself, which you can adjust with SetNextItemOpen() or ImGuiTreeNodeFlags_DefaultOpen.
func ColorButton ¶
func ColorButton(desc_id string, col ImVec4, flags ImGuiColorEditFlags, size ImVec2) bool
display a color square/button, hover for details, return true when pressed. A little color square. Return true when clicked. FIXME: May want to display/ignore the alpha component in the color display? Yet show it in the tooltip. 'desc_id' is not called 'label' because we don't display it next to the button, but only in the tooltip. Note that 'col' may be encoded in HSV if ImGuiColorEditFlags_InputHSV is set.
func ColorConvertHSVtoRGB ¶
func ColorConvertHSVtoRGB(h float, s float, v float, out_r, out_g, out_b *float)
ColorConvertHSVtoRGB Convert hsv floats ([0-1],[0-1],[0-1]) to rgb floats ([0-1],[0-1],[0-1]), from Foley & van Dam p593 also http://en.wikipedia.org/wiki/HSL_and_HSV
func ColorConvertRGBtoHSV ¶
func ColorConvertRGBtoHSV(r float, g float, b float, out_h, out_s, out_v *float)
ColorConvertRGBtoHSV Convert rgb floats ([0-1],[0-1],[0-1]) to hsv floats ([0-1],[0-1],[0-1]), from Foley & van Dam p592 Optimized http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv
func ColorEdit3 ¶
func ColorEdit3(label string, col *[3]float, flags ImGuiColorEditFlags) bool
Widgets: Color Editor/Picker (tip: the ColorEdit* functions have a little color square that can be left-clicked to open a picker, and right-clicked to open an option menu.) - Note that in C++ a 'v float[X]' function argument is the _same_ as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. - You can pass the address of a first element float out of a contiguous structure, e.g. &myvector.x
func ColorEdit4 ¶
func ColorEdit4(label string, col *[4]float, flags ImGuiColorEditFlags) bool
Edit colors components (each component in 0.0f..1.0f range). See enum ImGuiColorEditFlags_ for available options. e.g. Only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. With typical options: Left-click on color square to open color picker. Right-click to open option menu. CTRL-Click over input fields to edit them and TAB to go to next item.
func ColorEditOptionsPopup ¶
func ColorEditOptionsPopup(col [4]float, flags ImGuiColorEditFlags)
func ColorPicker3 ¶
func ColorPicker3(label string, col *[3]float, flags ImGuiColorEditFlags) bool
func ColorPicker4 ¶
func ColorPicker4(label string, col *[4]float, flags ImGuiColorEditFlags, ref_col []float) bool
Note: ColorPicker4() only accesses 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. (In C++ the 'float col[4]' notation for a function argument is equivalent to 'float* col', we only specify a size to facilitate understanding of the code.) FIXME: we adjust the big color square height based on item width, which may cause a flickering feedback loop (if automatic height makes a vertical scrollbar appears, affecting automatic width..) FIXME: this is trying to be aware of style.Alpha but not fully correct. Also, the color wheel will have overlapping glitches with (style.Alpha < 1.0)
func ColorPickerOptionsPopup ¶
func ColorPickerOptionsPopup(ref_col *[4]float, flags ImGuiColorEditFlags)
func ColorTooltip ¶
func ColorTooltip(text string, col [4]float, flags ImGuiColorEditFlags)
Color Note: only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set.
func Combo ¶
func Combo(label string, current_item *int, items []string, items_count int, popup_max_height_in_items int) bool
Combo box helper allowing to pass an array of strings.
func ComboFunc ¶
func ComboFunc(label string, current_item *int, items_getter func(data any, idx int, out_text *string) bool, data any, items_count, popup_max_height_in_items int) bool
Old API, prefer using BeginCombo() nowadays if you can.
func DataTypeApplyOp ¶
func DataTypeApplyOp(data_type ImGuiDataType, op int, output any, arg_1 any, arg_2 any)
func DataTypeApplyOpFromText ¶
func DataTypeApplyOpFromText(buf string, initial_value_buf string, data_type ImGuiDataType, p_data any, format string) bool
DataTypeApplyOpFromText User can input math operators (e.g. +100) to edit a numerical values. NB: This is _not_ a full expression evaluator. We should probably add one and replace this dumb mess..
func DataTypeClamp ¶
func DataTypeClamp(data_type ImGuiDataType, a any, n any, x any) bool
func DataTypeCompare ¶
func DataTypeCompare(data_type ImGuiDataType, arg_1 any, arg_2 any) int
func DataTypeFormatString ¶
func DataTypeFormatString(data_type ImGuiDataType, p_data any, format string) string
func DebugDrawItemRect ¶
func DebugDrawItemRect(col ImU32)
func DebugNodeColumns ¶
func DebugNodeColumns(columns *ImGuiOldColumns)
func DebugNodeDrawCmdShowMeshAndBoundingBox ¶
func DebugNodeDrawCmdShowMeshAndBoundingBox(out_draw_list *ImDrawList, draw_list *ImDrawList, draw_cmd *ImDrawCmd, show_mesh bool, show_aabb bool)
func DebugNodeDrawList ¶
func DebugNodeDrawList(window *ImGuiWindow, draw_list *ImDrawList, label string)
func DebugNodeFont ¶
func DebugNodeFont(font *ImFont)
func DebugNodeStorage ¶
func DebugNodeStorage(storage *ImGuiStorage, label string)
func DebugNodeTabBar ¶
func DebugNodeTabBar(tab_bar *ImGuiTabBar, label string)
func DebugNodeTable ¶
func DebugNodeTable(table *ImGuiTable)
func DebugNodeTableGetSizingPolicyDesc ¶
func DebugNodeTableGetSizingPolicyDesc(sizing_policy ImGuiTableFlags) string
func DebugNodeTableSettings ¶
func DebugNodeTableSettings(settings *ImGuiTableSettings)
func DebugNodeViewport ¶
func DebugNodeViewport(viewport *ImGuiViewportP)
func DebugNodeWindow ¶
func DebugNodeWindow(window *ImGuiWindow, label string)
func DebugNodeWindowSettings ¶
func DebugNodeWindowSettings(settings *ImGuiWindowSettings)
func DebugNodeWindowsList ¶
func DebugNodeWindowsList(windows []*ImGuiWindow, label string)
func DebugRenderViewportThumbnail ¶
func DebugRenderViewportThumbnail(draw_list *ImDrawList, viewport *ImGuiViewportP, bb *ImRect)
func DebugStartItemPicker ¶
func DebugStartItemPicker()
func Decode85Byte ¶
func Decode85Byte(c char) uint
func DragBehavior ¶
func DragBehavior(id ImGuiID, data_type ImGuiDataType, v any, v_speed float, n any, x any, t string, flags ImGuiSliderFlags) bool
func DragBehaviorT ¶
func DragBehaviorT(v *float, v_speed float, v_min, v_max *float, format string, flags ImGuiSliderFlags) bool
func DragFloat ¶
func DragFloat(label string, v *float, v_speed float, v_min float, v_max float, format string, flags ImGuiSliderFlags) bool
Widgets: Drag Sliders
- CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped and can go off-bounds.
- For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'v float[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x
- Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2 secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
- Format string may also be set to NULL or use the default format ("%f" or "%d").
- Speed are per-pixel of mouse movement (v_speed=0.2: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision).
- Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits.
- Use v_max/*= m*/,same with v_min = -FLT_MAX / INT_MIN to a clamping to a minimum.
- We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them.
- Legacy: Pre-1.78 there are DragXXX() function signatures that takes a final `power float=1.0' argument instead of the `ImGuiSliderFlags flags=0' argument. If you get a warning converting a to float ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361
func DragFloat2 ¶
func DragFloat2(label string, v *[2]float, v_speed float, v_min float, v_max float, format string, flags ImGuiSliderFlags) bool
func DragFloat3 ¶
func DragFloat3(label string, v *[3]float, v_speed float, v_min float, v_max float, format string, flags ImGuiSliderFlags) bool
func DragFloat4 ¶
func DragFloat4(label string, v *[4]float, v_speed float, v_min float, v_max float, format string, flags ImGuiSliderFlags) bool
func DragFloatRange2 ¶
func DragFloatRange2(label string, v_current_min *float, v_current_max *float, v_speed float, v_min float, v_max float, format string, format_max string, flags ImGuiSliderFlags) bool
NB: You likely want to specify the ImGuiSliderFlags_AlwaysClamp when using this.
func DragInt ¶
func DragInt(label string, v *int, v_speed float, v_min int, v_max int, format string, flags ImGuiSliderFlags) bool
func DragInt2 ¶
func DragInt2(label string, v [2]int, v_speed float, v_min int, v_max int, format string, flags ImGuiSliderFlags) bool
func DragInt3 ¶
func DragInt3(label string, v [3]int, v_speed float, v_min int, v_max int, format string, flags ImGuiSliderFlags) bool
func DragInt4 ¶
func DragInt4(label string, v [4]int, v_speed float, v_min int, v_max int, format string, flags ImGuiSliderFlags) bool
func DragIntRange2 ¶
func DragIntRange2(label string, v_current_min *int, v_current_max *int, v_speed float, v_min int, v_max int, format string, format_max string, flags ImGuiSliderFlags) bool
func DragScalar ¶
func DragScalar(label string, data_type ImGuiDataType, p_data any, v_speed float, p_min any, p_max any, format string, flags ImGuiSliderFlags) bool
Note: p_data, p_min and p_max are _pointers_ to a memory address holding the data. For a Drag widget, p_min and p_max are optional. Read code of e.g. DragFloat(), DragInt() etc. or examples in 'Demo.Widgets.Data Types' to understand how to use this function directly.
func DragScalarFloat ¶
func DragScalarFloat(label string, data_type ImGuiDataType, p_data *float, v_speed float, p_min *float, p_max *float, format string, flags ImGuiSliderFlags) bool
func DragScalarFloats ¶
func DragScalarFloats(label string, data_type ImGuiDataType, p_data []float, v_speed float, p_min *float, p_max *float, format string, flags ImGuiSliderFlags) bool
func DragScalarInt ¶
func DragScalarInt(label string, data_type ImGuiDataType, p_data *int, v_speed float, p_min *int, p_max *int, format string, flags ImGuiSliderFlags) bool
func DragScalarInts ¶
func DragScalarInts(label string, data_type ImGuiDataType, p_data []int, v_speed float, p_min *int, p_max *int, format string, flags ImGuiSliderFlags) bool
func Dummy ¶
func Dummy(size ImVec2)
add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into.
func EndChildFrame ¶
func EndChildFrame()
always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window)
func EndComboPreview ¶
func EndComboPreview()
func EndDisabled ¶
func EndDisabled()
func EndDragDropSource ¶
func EndDragDropSource()
EndDragDropSource only call EndDragDropSource() if BeginDragDropSource() returns true!
func EndDragDropTarget ¶
func EndDragDropTarget()
EndDragDropTarget We don't really use/need this now, but added it for the sake of consistency and because we might need it later. only call EndDragDropTarget() if BeginDragDropTarget() returns true!
func EndFrame ¶
func EndFrame()
ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all!
func EndGroup ¶
func EndGroup()
unlock horizontal starting position + capture the whole group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)
func EndMainMenuBar ¶
func EndMainMenuBar()
only call EndMainMenuBar() if BeginMainMenuBar() returns true!
func EndTooltip ¶
func EndTooltip()
func ErrorCheckEndFrameRecover ¶
func ErrorCheckEndFrameRecover(log_callback ImGuiErrorLogCallback, user_data any)
ErrorCheckEndFrameRecover Experimental recovery from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls. Must be called during or before EndFrame(). This is generally flawed as we are not necessarily End/Popping things in the right order. FIXME: Can't recover from inside BeginTabItem/EndTabItem yet. FIXME: Can't recover from interleaved BeginTabBar/Begin
func ErrorCheckEndFrameSanityChecks ¶
func ErrorCheckEndFrameSanityChecks()
func ErrorCheckNewFrameSanityChecks ¶
func ErrorCheckNewFrameSanityChecks()
func FindHoveredWindow ¶
func FindHoveredWindow()
Find window given position, search front-to-back FIXME: Note that we have an inconsequential lag here: OuterRectClipped is updated in Begin(), so windows moved programmatically with SetWindowPos() and not SetNextWindowPos() will have that rectangle lagging by a frame at the time FindHoveredWindow() is called, aka before the next Begin(). Moving window isn't affected.
func FindRenderedTextEnd ¶
FindRenderedTextEnd Find the optional ## from which we stop displaying text.
func FindWindowFocusIndex ¶
func FindWindowFocusIndex(window *ImGuiWindow) int
func FocusTopMostWindowUnderOne ¶
func FocusTopMostWindowUnderOne(under_this_window *ImGuiWindow, ignore_window *ImGuiWindow)
func GcAwakeTransientWindowBuffers ¶
func GcAwakeTransientWindowBuffers(window *ImGuiWindow)
func GcCompactTransientMiscBuffers ¶
func GcCompactTransientMiscBuffers()
GcCompactTransientMiscBuffers Garbage collection
func GcCompactTransientWindowBuffers ¶
func GcCompactTransientWindowBuffers(window *ImGuiWindow)
GcCompactTransientWindowBuffers Free up/compact internal window buffers, we can use this when a window becomes unused. Not freed: - ImGuiWindow, ImGuiWindowSettings, Name, StateStorage, ColumnsStorage (may hold useful data) This should have no noticeable visual effect. When the window reappear however, expect new allocation/buffer growth/copy cost.
func GetClipboardText ¶
func GetClipboardText() string
func GetClipboardTextFn_DefaultImpl ¶
GetClipboardTextFn_DefaultImpl Local Dear ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers.
func GetColumnNormFromOffset ¶
func GetColumnNormFromOffset(columns *ImGuiOldColumns, offset float) float
func GetColumnOffset ¶
func GetColumnOffset(column_index int) float
get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0
func GetColumnOffsetFromNorm ¶
func GetColumnOffsetFromNorm(columns *ImGuiOldColumns, offset_norm float) float
func GetColumnWidth ¶
func GetColumnWidth(column_index int) float
get column width (in pixels). pass -1 to use current column
func GetColumnWidthEx ¶
func GetColumnWidthEx(columns *ImGuiOldColumns, column_index int, before_resize bool) float
func GetColumnsCount ¶
func GetColumnsCount() int
func GetCursorPosX ¶
func GetCursorPosX() float
func GetCursorPosY ¶
func GetCursorPosY() float
func GetDraggedColumnOffset ¶
func GetDraggedColumnOffset(columns *ImGuiOldColumns, column_index int) float
func GetFallbackWindowNameForWindowingList ¶
func GetFallbackWindowNameForWindowingList(window *ImGuiWindow) string
Window has already passed the IsWindowNavFocusable()
func GetFontSize ¶
func GetFontSize() float
GetFontSize get current font size (= height in pixels) of current font with current scale applied
func GetFrameCount ¶
func GetFrameCount() int
func GetFrameHeightWithSpacing ¶
func GetFrameHeightWithSpacing() float
~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)
func GetKeyIndex ¶
func GetKeyIndex(imgui_key ImGuiKey) int
map ImGuiKey_* values into user's key index. == io.KeyMap[key]
func GetKeyPressedAmount ¶
func GetKeyPressedAmount(key_index int, repeat_delay float, repeat_rate float) int
uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
func GetMinimumStepAtDecimalPrecision ¶
func GetMinimumStepAtDecimalPrecision(decimal_precision int) float
func GetNavInputAmount ¶
func GetNavInputAmount(n ImGuiNavInput, mode ImGuiInputReadMode) float
func GetScrollMaxX ¶
func GetScrollMaxX() float
GetScrollMaxX get maximum scrolling amount ~~ ContentSize.x - WindowSize.x - DecorationsSize.x
func GetScrollMaxY ¶
func GetScrollMaxY() float
GetScrollMaxY get maximum scrolling amount ~~ ContentSize.y - WindowSize.y - DecorationsSize.y
func GetSkipItemForListClipping ¶
func GetSkipItemForListClipping() bool
FIXME-TABLE: This prevents us from using ImGuiListClipper _inside_ a table cell. The problem we have is that without a Begin/End scheme for rows using the clipper is ambiguous.
func GetStyleColorName ¶
get a string corresponding to the enum value (for display, saving, etc.).
func GetTextLineHeightWithSpacing ¶
func GetTextLineHeightWithSpacing() float
~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)
func GetTreeNodeToLabelSpacing ¶
func GetTreeNodeToLabelSpacing() float
horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode
func GetVersion ¶
func GetVersion() string
GetVersion get the compiled version string e.g. "1.80 WIP" (essentially the value for IMGUI_VERSION from the compiled version of imgui.cpp)
func GetWindowHeight ¶
func GetWindowHeight() float
get current window height (shortcut for GetWindowSize().y)
func GetWindowWidth ¶
func GetWindowWidth() float
get current window width (shortcut for GetWindowSize().x)
func HelpMarker ¶
func HelpMarker(desc string)
HelpMarker Helper to display a little (?) mark which shows a tooltip when hovered. In your own code you may want to display an actual icon if you are using a merged icon fonts (see docs/FONTS.md)
func IMGUI_CHECKVERSION ¶
func IMGUI_CHECKVERSION()
func IMGUI_DEBUG_LOG ¶
func IM_ASSERT_USER_ERROR ¶
func IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC ¶
func IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(RAD, MAXERROR float) float
func IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR ¶
func IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_ERROR(N, RAD float) float
func IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R ¶
func IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(N, MAXERROR float) float
func IM_F32_TO_INT8_SAT ¶
func IM_F32_TO_INT8_SAT(val float32) int
IM_F32_TO_INT8_SAT Saturated, always output 0..255
func IM_F32_TO_INT8_UNBOUND ¶
func IM_F32_TO_INT8_UNBOUND(val float32) int
IM_F32_TO_INT8_UNBOUND Unsaturated, for display purpose
func IM_FIXNORMAL2F ¶
func IM_FIXNORMAL2F(VX, VY *float)
func IM_NORMALIZE2F_OVER_ZERO ¶
func IM_NORMALIZE2F_OVER_ZERO(VX, VY *float)
func IM_ROUNDUP_TO_EVEN ¶
func IM_ROUNDUP_TO_EVEN(V float) float
IM_ROUNDUP_TO_EVEN ImDrawList: Helper function to calculate a circle's segment count given its radius and a "maximum error" value. Estimation of number of circle segment based on error is derived using method described in https://stackoverflow.com/a/2244088/15194693 Number of segments (N) is calculated using equation:
N = ceil ( pi / acos(1 - error / r) ) where r > 0, error <= r
Our equation is significantly simpler that one in the post thanks for choosing segment that is perpendicular to X axis. Follow steps in the article from this starting condition and you will will get this result.
Rendering circles with an odd number of segments, while mathematically correct will produce asymmetrical results on the raster grid. Therefore we're rounding N to next even number (7->8, 8->8, 9->10 etc.)
func ImAddClampOverflow ¶
func ImAddClampOverflow(a, b, mn, mx float) float
func ImBezierCubicClosestPointCasteljauStep ¶
func ImBezierCubicClosestPointCasteljauStep(p, p_closest, p_last *ImVec2, p_closest_dist2, x1, y1, x2, y2, x3, y3, x4, y4, tess_tol float, level int)
ImBezierCubicClosestPointCasteljauStep Closely mimics PathBezierToCasteljau
func ImBitArrayClearBit ¶
func ImBitArrayClearBit(arr []ImU32, n int)
func ImBitArraySetBit ¶
func ImBitArraySetBit(arr []ImU32, n int)
func ImBitArraySetBitRange ¶
func ImBitArraySetBitRange(arr []ImU32, n, n2 int)
func ImBitArrayTestBit ¶
func ImCharIsBlankA ¶
func ImCharIsBlankA(c char) bool
func ImCharIsBlankW ¶
func ImClampInt ¶
func ImClampInt(v, mn, mx int) int
func ImClampInt64 ¶
func ImClampUint64 ¶
func ImDrawVertSizeAndOffset ¶
func ImDrawVertSizeAndOffset() (size, o1, o2, o3 uintptr)
func ImFileClose ¶
func ImFileClose(file ImFileHandle) bool
func ImFileLoadToMemory ¶
ImFileLoadToMemory Helper: Load file content into memory Memory allocated with IM_ALLOC(), must be freed by user using IM_FREE() == ImGui::MemFree() This can't really be used with "rt" because fseek size won't match read size.
func ImFloorSigned ¶
func ImFloorSigned(f float) float
func ImFontAtlasBuildFinish ¶
func ImFontAtlasBuildFinish(atlas *ImFontAtlas)
ImFontAtlasBuildFinish This is called/shared by both the stb_truetype and the FreeType builder.
func ImFontAtlasBuildInit ¶
func ImFontAtlasBuildInit(atlas *ImFontAtlas)
ImFontAtlasBuildInit Note: this is called / shared by both the stb_truetype and the FreeType builder
func ImFontAtlasBuildPackCustomRects ¶
func ImFontAtlasBuildPackCustomRects(atlas *ImFontAtlas, stbrp_context_opaque any)
func ImFontAtlasBuildRender32bppRectFromString ¶
func ImFontAtlasBuildRender32bppRectFromString(atlas *ImFontAtlas, x, y, w, h int, in_str string, in_marker_char byte, in_marker_pixel_value uint32)
func ImFontAtlasBuildRender8bppRectFromString ¶
func ImFontAtlasBuildRender8bppRectFromString(atlas *ImFontAtlas, x, y, w, h int, in_str string, in_marker_char byte, in_marker_pixel_value byte)
func ImFontAtlasBuildRenderDefaultTexData ¶
func ImFontAtlasBuildRenderDefaultTexData(atlas *ImFontAtlas)
func ImFontAtlasBuildRenderLinesTexData ¶
func ImFontAtlasBuildRenderLinesTexData(atlas *ImFontAtlas)
func ImFontAtlasBuildSetupFont ¶
func ImFontAtlasBuildSetupFont(atlas *ImFontAtlas, font *ImFont, font_config *ImFontConfig, ascent float32, descent float32)
func ImFontAtlasBuildWithStbTruetype ¶
func ImFontAtlasBuildWithStbTruetype(atlas *ImFontAtlas) bool
func ImInvLength ¶
func ImInvLength(lhs ImVec2, fail_value float) float
func ImIsPowerOfTwoInt ¶
func ImIsPowerOfTwoInt(v int) bool
func ImIsPowerOfTwoLong ¶
func ImLengthSqrVec2 ¶
func ImLengthSqrVec2(a ImVec2) float
func ImLengthSqrVec4 ¶
func ImLengthSqrVec4(a ImVec4) float
func ImLinearSweep ¶
func ImLinearSweep(current, target, speed float) float
func ImModPositive ¶
func ImModPositive(a, b int) int
func ImSaturate ¶
func ImSaturate(f float) float
func ImStrSkipBlank ¶
func ImSubClampOverflow ¶
func ImSubClampOverflow(a, b, mn, mx float) float
func ImTextCharFromUtf8 ¶
ImTextCharFromUtf8 read one character. return input UTF-8 bytes count
func ImTextCharToUtf8 ¶
func ImTextCharToUtf8(out_buf [5]char, c uint) []char
ImTextCharToUtf8 Helpers: UTF-8 <> wchar conversions
func ImTextCharToUtf8_inline ¶
func ImTextCharToUtf8_inline(buf []char, buf_size int, c uint) int
ImTextCharToUtf8_inline Based on stb_to_utf8() from github.com/nothings/stb/
func ImTextCountCharsFromUtf8 ¶
func ImTextCountCharsFromUtf8(in_text string) int
func ImTextCountUtf8BytesFromChar ¶
func ImTextCountUtf8BytesFromChar(in_text, in_text_end []char) int
ImTextCountUtf8BytesFromChar Not optimal but we very rarely use this function.
func ImTextCountUtf8BytesFromStr ¶
func ImTextCountUtf8BytesFromStr(in_text, in_text_end []ImWchar) int
func ImTextStrFromUtf8 ¶
func ImTextStrToUtf8 ¶
func ImTriangleArea ¶
func ImTriangleContainsPoint ¶
func ImUpperPowerOfTwo ¶
func ImUpperPowerOfTwo(v int) int
func ImageButton ¶
func ImageButton(user_texture_id ImTextureID, size ImVec2, uv0 ImVec2, uv1 ImVec2, frame_padding int, bg_col ImVec4, tint_col ImVec4) bool
frame_padding < 0: uses FramePadding from style (default) frame_padding = 0: no framing frame_padding > 0: set framing size
func ImageButtonEx ¶
func ImageButtonEx(id ImGuiID, texture_id ImTextureID, size *ImVec2, uv0 *ImVec2, uv1 *ImVec2, padding *ImVec2, bg_col *ImVec4, tint_col *ImVec4) bool
ImageButton() is flawed as 'id' is always derived from 'texture_id' (see #2464 #1390) We provide this internal helper to write your own variant while we figure out how to redesign the public ImageButton() API.
func Indent ¶
func Indent(indent_w float)
move content position toward the right, by indent_w, or style.IndentSpacing if indent_w <= 0
func InputDouble ¶
func InputDouble(label string, v *double, step double, step_fast double, format string, flags ImGuiInputTextFlags) bool
func InputFloat ¶
func InputFloat(label string, v *float, step, step_fast float, format string, flags ImGuiInputTextFlags) bool
func InputFloat2 ¶
func InputFloat2(label string, v *[2]float, format string, flags ImGuiInputTextFlags) bool
func InputFloat3 ¶
func InputFloat3(label string, v *[3]float, format string, flags ImGuiInputTextFlags) bool
func InputFloat4 ¶
func InputFloat4(label string, v *[4]float, format string, flags ImGuiInputTextFlags) bool
func InputInt ¶
func InputInt(label string, v *int, step int, step_fast int, flags ImGuiInputTextFlags) bool
func InputInt2 ¶
func InputInt2(label string, v *[2]int, flags ImGuiInputTextFlags) bool
func InputInt3 ¶
func InputInt3(label string, v *[3]int, flags ImGuiInputTextFlags) bool
func InputInt4 ¶
func InputInt4(label string, v *[4]int, flags ImGuiInputTextFlags) bool
func InputScalarFloat32 ¶
func InputScalarFloat32(label string, p_data, p_step, p_step_fast *float32, format string, flags ImGuiInputTextFlags) bool
Note: p_data, p_step, p_step_fast are _pointers_ to a memory address holding the data. For an Input widget, p_step and p_step_fast are optional. Read code of e.g. InputFloat(), InputInt() etc. or examples in 'Demo.Widgets.Data Types' to understand how to use this function directly.
func InputScalarFloat32s ¶
func InputScalarFloat64 ¶
func InputScalarFloat64(label string, p_data, p_step, p_step_fast *float64, format string, flags ImGuiInputTextFlags) bool
Note: p_data, p_step, p_step_fast are _pointers_ to a memory address holding the data. For an Input widget, p_step and p_step_fast are optional. Read code of e.g. InputFloat(), InputInt() etc. or examples in 'Demo.Widgets.Data Types' to understand how to use this function directly.
func InputScalarFloat64s ¶
func InputScalarInt32 ¶
func InputScalarInt32(label string, p_data, p_step, p_step_fast *int32, format string, flags ImGuiInputTextFlags) bool
Note: p_data, p_step, p_step_fast are _pointers_ to a memory address holding the data. For an Input widget, p_step and p_step_fast are optional. Read code of e.g. InputFloat(), InputInt() etc. or examples in 'Demo.Widgets.Data Types' to understand how to use this function directly.
func InputScalarInt32s ¶
func InputScalarInt64 ¶
func InputScalarInt64(label string, p_data, p_step, p_step_fast *int64, format string, flags ImGuiInputTextFlags) bool
Note: p_data, p_step, p_step_fast are _pointers_ to a memory address holding the data. For an Input widget, p_step and p_step_fast are optional. Read code of e.g. InputFloat(), InputInt() etc. or examples in 'Demo.Widgets.Data Types' to understand how to use this function directly.
func InputScalarInt64s ¶
func InputText ¶
func InputText(label string, char *[]byte, flags ImGuiInputTextFlags, callback ImGuiInputTextCallback, user_data any) bool
func InputTextCalcLineCount ¶
func InputTextCalcLineCount(text string) int
func InputTextEx ¶
func InputTextEx(label string, hint string, buf *[]byte, size_arg *ImVec2, flags ImGuiInputTextFlags, callback ImGuiInputTextCallback, callback_user_data any) bool
Edit a string of text
- buf_size account for the zero-terminator, so a buf_size of 6 can hold "Hello" but not "Hello!". This is so we can easily call InputText() on static arrays using ARRAYSIZE() and to match Note that in std::string world, capacity() would omit 1 byte used by the zero-terminator.
- When active, hold on a privately held copy of the text (and apply back to 'buf'). So changing 'buf' while the InputText is active has no effect.
- If you want to use ImGui::InputText() with std::string, see misc/cpp/imgui_stdlib.h
(FIXME: Rather confusing and messy function, among the worse part of our codebase, expecting to rewrite a V2 at some point.. Partly because we are
doing UTF8 > U16 > UTF8 conversions on the go to easily interface with stb_textedit. Ideally should stay in UTF-8 all the time. See https://github.com/nothings/stb/issues/188)
func InputTextFilterCharacter ¶
func InputTextFilterCharacter(p_char *rune, flags ImGuiInputTextFlags, callback ImGuiInputTextCallback, user_data any, input_source ImGuiInputSource) bool
Return false to discard a character.
func InputTextMultiline ¶
func InputTextMultiline(label string, buf *[]byte, size ImVec2, flags ImGuiInputTextFlags, callback ImGuiInputTextCallback, user_data any) bool
func InputTextWithHint ¶
func InputTextWithHint(label string, hint string, char *[]byte, flags ImGuiInputTextFlags, callback ImGuiInputTextCallback, user_data any) bool
func InvisibleButton ¶
func InvisibleButton(str_id string, size_arg ImVec2, flags ImGuiButtonFlags) bool
flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.) Tip: use ImGui::PushID()/PopID() to push indices or pointers in the ID stack. Then you can keep 'str_id' empty or the same for all your buttons (instead of creating a string based on a non-string id)
func IsActiveIdUsingKey ¶
func IsActiveIdUsingNavDir ¶
func IsActiveIdUsingNavInput ¶
func IsActiveIdUsingNavInput(input ImGuiNavInput) bool
func IsDragDropPayloadBeingAccepted ¶
func IsDragDropPayloadBeingAccepted() bool
func IsItemActivated ¶
func IsItemActivated() bool
IsItemActivated was the last item just made active (item was previously inactive).
func IsItemActive ¶
func IsItemActive() bool
is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item. Items that don't interact will always return false)
func IsItemClicked ¶
func IsItemClicked(mouse_button ImGuiMouseButton) bool
IsItemClicked is the last item hovered and mouse clicked on? (**) == IsMouseClicked(mouse_button) && IsItemHovered()Important. (**) this it NOT equivalent to the behavior of e.g. Button(). Read comments in function definition. Important: this can be useful but it is NOT equivalent to the behavior of e.g.Button()! Most widgets have specific reactions based on mouse-up/down state, mouse position etc.
func IsItemDeactivated ¶
func IsItemDeactivated() bool
IsItemDeactivated was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that requires continuous editing.
func IsItemDeactivatedAfterEdit ¶
func IsItemDeactivatedAfterEdit() bool
IsItemDeactivatedAfterEdit was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that requires continuous editing. Note that you may get false positives (some widgets such as Combo()/ListBox()/Selectable() will return true even when clicking an already selected item).
func IsItemEdited ¶
func IsItemEdited() bool
IsItemEdited did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets.
func IsItemFocused ¶
func IsItemFocused() bool
IsItemFocused is the last item focused for keyboard/gamepad navigation? == GetItemID() == GetFocusID()
func IsItemHovered ¶
func IsItemHovered(flags ImGuiHoveredFlags) bool
IsItemHovered is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options. This is roughly matching the behavior of internal-facing ItemHoverable() - we allow hovering to be true when ActiveId==window.MoveID, so that clicking on non-interactive items such as a Text() item still returns true with IsItemHovered() - this should work even for non-interactive items that have no ID, so we cannot use LastItemId
func IsItemToggledOpen ¶
func IsItemToggledOpen() bool
IsItemToggledOpen was the last item open state toggled? set by TreeNode().
func IsItemToggledSelection ¶
func IsItemToggledSelection() bool
Was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly)
func IsItemVisible ¶
func IsItemVisible() bool
IsItemVisible is the last item visible? (items may be out of sight because of clipping/scrolling)
func IsKeyDown ¶
func IsKeyDown(user_key_index int) bool
Note that dear imgui doesn't know the semantic of each entry of io.KeysDown[]! Use your own indices/enums according to how your backend/engine stored them into io.KeysDown[]! is key being held. == io.KeysDown[user_key_index].
func IsKeyPressed ¶
func IsKeyPressedMap ¶
func IsKeyReleased ¶
func IsKeyReleased(user_key_index int) bool
was key released (went from Down to !Down)?
func IsMouseClicked ¶
func IsMouseClicked(button ImGuiMouseButton, repeat bool) bool
IsMouseClicked did mouse button clicked? (went from !Down to Down)
func IsMouseDoubleClicked ¶
func IsMouseDoubleClicked(button ImGuiMouseButton) bool
IsMouseDoubleClicked did mouse button double-clicked? (note that a double-click will also report IsMouseClicked() == true)
func IsMouseDragPastThreshold ¶
func IsMouseDragPastThreshold(button ImGuiMouseButton, lock_threshold float) bool
IsMouseDragPastThreshold Return if a mouse click/drag went past the given threshold. Valid to call during the MouseReleased frame. [Internal] This doesn't test if the button is pressed
func IsMouseDragging ¶
func IsMouseDragging(button ImGuiMouseButton, lock_threshold float) bool
IsMouseDragging is mouse dragging? (if lock_threshold < -1.0, uses io.MouseDraggingThreshold)
func IsMouseHoveringRect ¶
IsMouseHoveringRect Test if mouse cursor is hovering given rectangle NB- Rectangle is clipped by our current clip setting NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding) is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
func IsMousePosValid ¶
IsMousePosValid We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position.
func IsMouseReleased ¶
func IsMouseReleased(button ImGuiMouseButton) bool
IsMouseReleased did mouse button released? (went from Down to !Down)
func IsNavInputDown ¶
func IsNavInputDown(n ImGuiNavInput) bool
func IsNavInputTest ¶
func IsNavInputTest(n ImGuiNavInput, rm ImGuiInputReadMode) bool
func IsPopupOpen ¶
func IsPopupOpen(str_id string, flags ImGuiPopupFlags) bool
IsPopupOpen Popups: query functions
- IsPopupOpen(): return true if the popup is open at the current BeginPopup() level of the popup stack.
- IsPopupOpen() with ImGuiPopupFlags_AnyPopupId: return true if any popup is open at the current BeginPopup() level of the popup stack.
- IsPopupOpen() with ImGuiPopupFlags_AnyPopupId + ImGuiPopupFlags_AnyPopupLevel: return true if any popup is open.
return true if the popup is open.
func IsPopupOpenID ¶
func IsPopupOpenID(id ImGuiID, popup_flags ImGuiPopupFlags) bool
IsPopupOpenID Supported flags: ImGuiPopupFlags_AnyPopupId, ImGuiPopupFlags_AnyPopupLevel
func IsRectVisible ¶
test if rectangle (of given size, starting from cursor position) is visible / not clipped.
func IsRectVisibleMinMax ¶
test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side.
func IsWindowAbove ¶
func IsWindowAbove(potential_above *ImGuiWindow, potential_below *ImGuiWindow) bool
func IsWindowActiveAndVisible ¶
func IsWindowActiveAndVisible(window *ImGuiWindow) bool
func IsWindowAppearing ¶
func IsWindowAppearing() bool
func IsWindowChildOf ¶
func IsWindowChildOf(window *ImGuiWindow, potential_parent *ImGuiWindow) bool
func IsWindowCollapsed ¶
func IsWindowCollapsed() bool
func IsWindowContentHoverable ¶
func IsWindowContentHoverable(window *ImGuiWindow, flags ImGuiHoveredFlags) bool
func IsWindowFocused ¶
func IsWindowFocused(flags ImGuiFocusedFlags) bool
is current window focused? or its root/child, depending on flags. see flags for options.
func IsWindowHovered ¶
func IsWindowHovered(flags ImGuiHoveredFlags) bool
is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ!
func IsWindowNavFocusable ¶
func IsWindowNavFocusable(window *ImGuiWindow) bool
Can we focus this window with CTRL+TAB (or PadMenu + PadFocusPrev/PadFocusNext) Note that NoNavFocus makes the window not reachable with CTRL+TAB but it can still be focused with mouse or programmatically. If you want a window to never be focused, you may use the e.g. NoInputs flag.
func ItemAdd ¶
func ItemAdd(bb *ImRect, id ImGuiID, nav_bb_arg *ImRect, extra_flags ImGuiItemFlags) bool
Declare item bounding box for clipping and interaction. Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface declare their minimum size requirement to ItemSize() and provide a larger region to ItemAdd() which is used drawing/interaction.
func ItemHoverable ¶
Internal facing ItemHoverable() used when submitting widgets. Differs slightly from IsItemHovered().
func ItemInputable ¶
func ItemInputable(window *ImGuiWindow, id ImGuiID)
Called by ItemAdd() Process TAB/Shift+TAB. Be mindful that this function may _clear_ the ActiveID when tabbing out. [WIP] This will eventually be refactored and moved into NavProcessItem()
func ItemSizeRect ¶
func ItemSizeRect(bb *ImRect, text_baseline_y float)
func ItemSizeVec ¶
func ItemSizeVec(size *ImVec2, text_baseline_y float)
Advance cursor given item size for layout. Register minimum needed size so it can extend the bounding box used for auto-fit calculation. See comments in ItemAdd() about how/why the size provided to ItemSize() vs ItemAdd() may often different.
func KeepAliveID ¶
func KeepAliveID(id ImGuiID)
func ListBoxFunc ¶
func ListBoxFunc(label string, current_item *int, items_getter func(data any, idx int, out_text *string) bool, data any, items_count int, height_in_items int) bool
This is merely a helper around BeginListBox(), EndListBox(). Considering using those directly to submit custom data or store selection differently.
func LoadIniSettingsFromDisk ¶
func LoadIniSettingsFromDisk(ini_filename string)
LoadIniSettingsFromDisk Settings/.Ini Utilities - The disk functions are automatically called if io.IniFilename != NULL (default is "imgui.ini"). - Set io.IniFilename to NULL to load/save manually. Read io.WantSaveIniSettings description about handling .ini saving manually. - Important: default value "imgui.ini" is relative to current working dir! Most apps will want to lock this to an absolute path (e.g. same path as executables).
func LogBegin ¶
func LogBegin(ltype ImGuiLogType, auto_open_depth int)
LogBegin Logging/Capture . BeginCapture() when we design v2 api, for now stay under the radar by using the old name.
func LogButtons ¶
func LogButtons()
LogButtons helper to display buttons for logging to tty/file/clipboard
func LogRenderedText ¶
LogRenderedText Internal version that takes a position to decide on newline placement and pad items according to their depth. We split text into individual lines to add current tree level padding FIXME: This code is a little complicated perhaps, considering simplifying the whole system.
func LogSetNextTextDecoration ¶
LogSetNextTextDecoration Important: doesn't copy underlying data, use carefully (prefix/suffix must be in scope at the time of the next LogRenderedText)
func LogToBuffer ¶
func LogToBuffer(auto_open_depth int)
LogToBuffer Start logging/capturing to internal buffer
func LogToClipboard ¶
func LogToClipboard(auto_open_depth int)
LogToClipboard start logging to OS clipboard
func LogToFile ¶
func LogToFile(auto_open_depth int, filename string)
LogToFile Start logging/capturing text output to given file
func MarkIniSettingsDirtyWindow ¶
func MarkIniSettingsDirtyWindow(window *ImGuiWindow)
func MarkItemEdited ¶
func MarkItemEdited(id ImGuiID)
MarkItemEdited Mark data associated to given item as "edited", used by IsItemDeactivatedAfterEdit() function.
func MenuItemEx ¶
func MenuItemSelected ¶
return true when activated + toggle (*p_selected) if p_selected != NULL
func MetricsHelpMarker ¶
func MetricsHelpMarker(desc string)
MetricsHelpMarker Avoid naming collision with imgui_demo.cpp's HelpMarker() for unity builds.
func NavApplyItemToResult ¶
func NavApplyItemToResult(result *ImGuiNavItemData)
func NavEndFrame ¶
func NavEndFrame()
func NavInitWindow ¶
func NavInitWindow(window *ImGuiWindow, force_reinit bool)
NavInitWindow This needs to be called before we submit any widget (aka in or before Begin)
func NavMoveRequestApplyResult ¶
func NavMoveRequestApplyResult()
NavMoveRequestApplyResult Apply result from previous frame navigation directional move request. Always called from NavUpdate()
func NavMoveRequestButNoResultYet ¶
func NavMoveRequestButNoResultYet() bool
NavMoveRequestButNoResultYet Gamepad/Keyboard Navigation
func NavMoveRequestCancel ¶
func NavMoveRequestCancel()
func NavMoveRequestForward ¶
func NavMoveRequestForward(move_dir ImGuiDir, clip_dir ImGuiDir, move_flags ImGuiNavMoveFlags)
NavMoveRequestForward Forward will reuse the move request again on the next frame (generally with modifications done to it)
func NavMoveRequestSubmit ¶
func NavMoveRequestSubmit(move_dir ImGuiDir, clip_dir ImGuiDir, move_flags ImGuiNavMoveFlags)
NavMoveRequestSubmit FIXME: ScoringRect is not set
func NavMoveRequestTryWrapping ¶
func NavMoveRequestTryWrapping(window *ImGuiWindow, move_flags ImGuiNavMoveFlags)
NavMoveRequestTryWrapping Navigation wrap-around logic is delayed to the end of the frame because this operation is only valid after entire popup is assembled and in case of appended popups it is not clear which EndPopup() call is final.
func NavProcessItem ¶
func NavProcessItem()
NavProcessItem We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above) This is called after LastItemData is set.
func NavRestoreLayer ¶
func NavRestoreLayer(layer ImGuiNavLayer)
func NavSaveLastChildNavWindowIntoParent ¶
func NavSaveLastChildNavWindowIntoParent(nav_window *ImGuiWindow)
NavSaveLastChildNavWindowIntoParent FIXME: This could be replaced by updating a frame number in each window when (window == NavWindow) and (NavLayer == 0). This way we could find the last focused window among our children. It would be much less confusing this way?
func NavScoreItem ¶
func NavScoreItem(result *ImGuiNavItemData) bool
NavScoreItem Scoring function for gamepad/keyboard directional navigation. Based on https://gist.github.com/rygorous/6981057
func NavScoreItemDistInterval ¶
func NavScoreItemDistInterval(a0, a1, b0, b1 float) float
func NavUpdateAnyRequestFlag ¶
func NavUpdateAnyRequestFlag()
func NavUpdateCancelRequest ¶
func NavUpdateCancelRequest()
NavUpdateCancelRequest Process NavCancel input (to close a popup, get back to parent, clear focus) FIXME: In order to support e.g. Escape to clear a selection we'll need: - either to store the equivalent of ActiveIdUsingKeyInputMask for a FocusScope and test for it. - either to move most/all of those tests to the epilogue/end functions of the scope they are dealing with (e.g. exit child window in EndChild()) or in EndFrame(), to allow an earlier intercept
func NavUpdateCreateMoveRequest ¶
func NavUpdateCreateMoveRequest()
func NavUpdateInitResult ¶
func NavUpdateInitResult()
func NavUpdatePageUpPageDown ¶
func NavUpdatePageUpPageDown() float
NavUpdatePageUpPageDown Handle PageUp/PageDown/Home/End keys Called from NavUpdateCreateMoveRequest() which will use our output to create a move request FIXME-NAV: This doesn't work properly with NavFlattened siblings as we use NavWindow rectangle for reference FIXME-NAV: how to get Home/End to aim at the beginning/end of a 2D grid?
func NavUpdateWindowing ¶
func NavUpdateWindowing()
NavUpdateWindowing Windowing management mode Keyboard: CTRL+Tab (change focus/move/resize), Alt (toggle menu layer) Gamepad: Hold Menu/Square (change focus/move/resize), Tap Menu/Square (toggle menu layer)
func NavUpdateWindowingHighlightWindow ¶
func NavUpdateWindowingHighlightWindow(focus_change_dir int)
func NavUpdateWindowingOverlay ¶
func NavUpdateWindowingOverlay()
NavUpdateWindowingOverlay Overlay displayed when using CTRL+TAB. Called by EndFrame().
func NewFrame ¶
func NewFrame()
start a new Dear ImGui frame, you can submit any command from this pountil int Render()/EndFrame().
func NewLine ¶
func NewLine()
undo a SameLine() or force a new line when in an horizontal-layout context.
func NextColumn ¶
func NextColumn()
next column, defaults to current row or next row if the current row is finished
func OpenPopup ¶
func OpenPopup(str_id string, popup_flags ImGuiPopupFlags)
OpenPopup Popups: open/close functions
- OpenPopup(): set popup state to open. are ImGuiPopupFlags available for opening options.
- If not modal: they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
- CloseCurrentPopup(): use inside the BeginPopup()/EndPopup() scope to close manually.
- CloseCurrentPopup() is called by default by Selectable()/MenuItem() when activated (FIXME: need some options).
- Use ImGuiPopupFlags_NoOpenOverExistingPopup to a opening a popup if there's already one at the same level. This is equivalent to e.g. testing for !IsAnyPopupOpen() prior to OpenPopup().
- Use IsWindowAppearing() after BeginPopup() to tell if a window just opened.
call to mark popup as open (don't call every frame!).
func OpenPopupEx ¶
func OpenPopupEx(id ImGuiID, popup_flags ImGuiPopupFlags)
OpenPopupEx Mark popup as open (toggle toward open state). Popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). One open popup per level of the popup hierarchy (NB: when assigning we reset the Window member of ImGuiPopupRef to nil)
func OpenPopupID ¶
func OpenPopupID(id ImGuiID, popup_flags ImGuiPopupFlags)
OpenPopupID id overload to facilitate calling from nested stacks
func OpenPopupOnItemClick ¶
func OpenPopupOnItemClick(str_id string, popup_flags ImGuiPopupFlags)
OpenPopupOnItemClick Helper to open a popup if mouse button is released over the item - This is essentially the same as BeginPopupContextItem() but without the trailing BeginPopup() helper to open popup when clicked on last item. Default to ImGuiPopupFlags_MouseButtonRight == 1. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors)
func PatchFormatStringFloatToInt ¶
PatchFormatStringFloatToInt FIXME-LEGACY: Prior to 1.61 our DragInt() function internally used floats and because of this the compile-time default value for format was "%.0f". Even though we changed the compile-time default, we expect users to have carried %f around, which would break the display of DragInt() calls. To honor backward compatibility we are rewriting the format string, unless IMGUI_DISABLE_OBSOLETE_FUNCTIONS is enabled. What could possibly go wrong?!
func PathBezierCubicCurveToCasteljau ¶
func PathBezierCubicCurveToCasteljau(path *[]ImVec2, x1, y1, x2, y2, x3, y3, x4, y4, tess_tol float, level int)
PathBezierCubicCurveToCasteljau Closely mimics ImBezierCubicClosestPointCasteljau() in imgui.cpp
func PathBezierQuadraticCurveToCasteljau ¶
func PathBezierQuadraticCurveToCasteljau(path *[]ImVec2, x1, y1, x2, y2, x3, y3, tess_tol float, level int)
func PlotHistogram ¶
func PlotHistogramFunc ¶
func PlotLines ¶
func PlotLines(label string, values []float, values_count int, values_offset int, overlay_text string, scale_min float, scale_max float, graph_size ImVec2, stride int)
Widgets: Data Plotting - Consider using ImPlot (https://github.com/epezent/implot) which is much better!
func PlotLinesFunc ¶
func Plot_ArrayGetter ¶
func Plot_ArrayGetter(data any, idx int) float
func PopAllowKeyboardFocus ¶
func PopAllowKeyboardFocus()
func PopButtonRepeat ¶
func PopButtonRepeat()
func PopClipRect ¶
func PopClipRect()
func PopColumnsBackground ¶
func PopColumnsBackground()
func PopFocusScope ¶
func PopFocusScope()
func PopItemFlag ¶
func PopItemFlag()
func PopItemWidth ¶
func PopItemWidth()
func PopStyleColor ¶
func PopStyleColor(count int)
func PopStyleVar ¶
func PopStyleVar(count int)
func PopTextWrapPos ¶
func PopTextWrapPos()
func ProgressBar ¶
size_arg (for each axis) < 0.0f: align to end, 0.0f: auto, > 0.0f: specified size
func PushAllowKeyboardFocus ¶
func PushAllowKeyboardFocus(allow_keyboard_focus bool)
== tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
func PushButtonRepeat ¶
func PushButtonRepeat(repeat bool)
in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.
func PushClipRect ¶
PushClipRect Clipping - Mouse hovering is affected by ImGui::PushClipRect() calls, unlike direct calls to ImDrawList::PushClipRect() which are render only. Push a clipping rectangle for both ImGui logic (hit-testing etc.) and low-level ImDrawList rendering.
- When using this function it is sane to ensure that float are perfectly rounded to integer values, so that e.g. (int)(max.x-min.x) in user's render produce correct result.
- If the code here changes, may need to update code of functions like NextColumn() and PushColumnClipRect(): some frequently called functions which to modify both channels and clipping simultaneously tend to use the more specialized SetWindowClipRectBeforeSetChannel() to avoid extraneous updates of underlying ImDrawCmds.
func PushColumnClipRect ¶
func PushColumnClipRect(column_index int)
func PushColumnsBackground ¶
func PushColumnsBackground()
Get into the columns background draw command (which is generally the same draw command as before we called BeginColumns)
func PushFocusScope ¶
func PushFocusScope(id ImGuiID)
Focus Scope (WIP) This is generally used to identify a selection set (multiple of which may be in the same window), as selection patterns generally need to react (e.g. clear selection) when landing on an item of the set.
func PushFont ¶
func PushFont(font *ImFont)
PushFont Parameters stacks (shared) use NULL as a shortcut to push default font
func PushInterface ¶
func PushInterface(ptr_id any)
PushInterface push pointer into the ID stack (will hash pointer).
func PushItemFlag ¶
func PushItemFlag(option ImGuiItemFlags, enabled bool)
PushItemFlag Parameter stacks
func PushItemWidth ¶
func PushItemWidth(item_width float)
push width of items for common large "item+label" widgets. >0.0: width in pixels, <0.0 align xx pixels to the right of window (so -FLT_MIN always align width to the right side).
func PushMultiItemsWidths ¶
func PushMultiItemsWidths(components int, width_full float)
func PushOverrideID ¶
func PushOverrideID(id ImGuiID)
PushOverrideID Push given value as-is at the top of the ID stack (whereas PushID combines old and new hashes)
func PushString ¶
func PushString(str_id string)
func PushStyleColorInt ¶
FIXME: This may incur a round-trip (if the end user got their data from a float4) but eventually we aim to store the in-flight colors as ImU32
func PushStyleColorVec ¶
func PushStyleFloat ¶
func PushStyleFloat(idx ImGuiStyleVar, val float)
modify a style variable float. always use this if you modify the style after NewFrame().
func PushStyleVec ¶
func PushStyleVec(idx ImGuiStyleVar, val ImVec2)
modify a style variable ImVec2. always use this if you modify the style after NewFrame().
func PushTextWrapPos ¶
func PushTextWrapPos(wrap_local_pos_x float)
push word-wrapping position for Text*() commands. < 0.0: no wrapping; 0.0: wrap to end of window (or column) {panic("not implemented")} > 0.0: wrap at 'wrap_pos_x' position in window local space
func RadioButtonBool ¶
use with e.g. if (RadioButton("one", my_value==1)) { my_value = 1 bool {panic("not implemented")} }
func RadioButtonInt ¶
shortcut to handle the above pattern when value is an integer
func RemoveContextHook ¶
func RemoveContextHook(context *ImGuiContext, hook_to_remove ImGuiID)
Deferred removal, avoiding issue with changing vector while iterating it
func Render ¶
func Render()
Render ends the Dear ImGui frame, finalize the draw data. You can then get call GetDrawData() Prepare the data for rendering so you can call GetDrawData() (As with anything within the ImGui:: namspace this doesn't touch your GPU or graphics API at all: it is the role of the ImGui_ImplXXXX_RenderDrawData() function provided by the renderer backend).
func RenderArrow ¶
func RenderArrow(draw_list *ImDrawList, pos ImVec2, col ImU32, dir ImGuiDir, scale float)
RenderArrow Render an arrow aimed to be aligned with text (p_min is a position in the same space text would be positioned). To e.g. denote expanded/collapsed state
func RenderArrowPointingAt ¶
func RenderArrowPointingAt(draw_list *ImDrawList, pos ImVec2, half_sz ImVec2, direction ImGuiDir, col ImU32)
RenderArrowPointingAt Render an arrow. 'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side.
func RenderArrowsForVerticalBar ¶
func RenderArrowsForVerticalBar(draw_list *ImDrawList, pos, half_sz ImVec2, bar_w, alpha float)
Helper for ColorPicker4()
func RenderBullet ¶
func RenderBullet(draw_list *ImDrawList, pos ImVec2, col ImU32)
func RenderCheckMark ¶
func RenderCheckMark(draw_list *ImDrawList, pos ImVec2, col ImU32, sz float)
func RenderColorRectWithAlphaCheckerboard ¶
func RenderColorRectWithAlphaCheckerboard(draw_list *ImDrawList, p_min ImVec2, p_max ImVec2, col ImU32, grid_step float, grid_off ImVec2, rounding float, flags ImDrawFlags)
RenderColorRectWithAlphaCheckerboard Helper for ColorPicker4() NB: This is rather brittle and will show artifact when rounding this enabled if rounded corners overlap multiple cells. Caller currently responsible for avoiding that. Spent a non reasonable amount of time trying to getting this right for ColorButton with rounding+anti-aliasing+ImGuiColorEditFlags_HalfAlphaPreview flag + various grid sizes and offsets, and eventually gave up... probably more reasonable to disable rounding altogether. FIXME: uses ImGui::GetColorU32
func RenderFrame ¶
Render a rectangle shaped with optional rounding and borders
func RenderFrameBorder ¶
func RenderMouseCursor ¶
func RenderMouseCursor(draw_list *ImDrawList, pos ImVec2, scale float, mouse_cursor ImGuiMouseCursor, col_fill ImU32, col_border ImU32, col_shadow ImU32)
func RenderNavHighlight ¶
func RenderNavHighlight(bb *ImRect, id ImGuiID, flags ImGuiNavHighlightFlags)
RenderNavHighlight Navigation highlight
func RenderRectFilledRangeH ¶
func RenderRectFilledRangeH(draw_list *ImDrawList, rect *ImRect, col ImU32, x_start_norm float, x_end_norm float, rounding float)
RenderRectFilledRangeH FIXME: Cleanup and move code to ImDrawList.
func RenderRectFilledWithHole ¶
func RenderRectFilledWithHole(draw_list *ImDrawList, outer ImRect, inner ImRect, col ImU32, rounding float)
func RenderText ¶
RenderText Render helpers AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT. NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)
func RenderTextClipped ¶
func RenderTextClippedEx ¶
func RenderTextClippedEx(draw_list *ImDrawList, pos_min *ImVec2, pos_max *ImVec2, text string, text_size_if_known *ImVec2, align *ImVec2, clip_rect *ImRect)
RenderTextClippedEx Default clip_rect uses (pos_min,pos_max) Handle clipping on CPU immediately (vs typically let the GPU clip the triangles that are overlapping the clipping rectangle edges)
func RenderTextEllipsis ¶
func RenderTextEllipsis(draw_list *ImDrawList, pos_min *ImVec2, pos_max *ImVec2, clip_max_x float, ellipsis_max_x float, text string, text_size_if_known *ImVec2)
RenderTextEllipsis Another overly complex function until we reorganize everything into a nice all-in-one helper. This is made more complex because we have dissociated the layout rectangle (pos_min..pos_max) which define _where_ the ellipsis is, from actual clipping of text and limit of the ellipsis display. This is because in the context of tabs we selectively hide part of the text when the Close Button appears, but we don't want the ellipsis to move.
func RenderTextWrapped ¶
func RenderViewportsThumbnails ¶
func RenderViewportsThumbnails()
func RenderWindowDecorations ¶
func RenderWindowDecorations(window *ImGuiWindow, title_bar_rect *ImRect, title_bar_is_highlight bool, resize_grip_count int, resize_grip_col [4]ImU32, resize_grip_draw_size float)
Draw background and borders Draw and handle scrollbars
func RenderWindowOuterBorders ¶
func RenderWindowOuterBorders(window *ImGuiWindow)
func RenderWindowTitleBarContents ¶
func RenderWindowTitleBarContents(window *ImGuiWindow, title_bar_rect *ImRect, name string, p_open *bool)
Render title text, collapse button, close button
func ResetMouseDragDelta ¶
func ResetMouseDragDelta(button ImGuiMouseButton)
func RoundScalarWithFormatT ¶
func RoundScalarWithFormatT(format string, v float) float
func STB_TEXTEDIT_DELETECHARS ¶
func STB_TEXTEDIT_DELETECHARS(obj *STB_TEXTEDIT_STRING, pos, n int)
func STB_TEXTEDIT_GETWIDTH ¶
func STB_TEXTEDIT_GETWIDTH(obj *STB_TEXTEDIT_STRING, line_start_idx, char_idx int) float
func STB_TEXTEDIT_INSERTCHARS ¶
func STB_TEXTEDIT_INSERTCHARS(obj *STB_TEXTEDIT_STRING, pos int, new_text []STB_TEXTEDIT_CHARTYPE, new_text_len int) bool
func STB_TEXTEDIT_IS_SPACE ¶
func STB_TEXTEDIT_IS_SPACE(char STB_TEXTEDIT_CHARTYPE) bool
func STB_TEXTEDIT_LAYOUTROW ¶
func STB_TEXTEDIT_LAYOUTROW(r *StbTexteditRow, obj *STB_TEXTEDIT_STRING, line_start_idx int)
func STB_TEXTEDIT_MOVEWORDLEFT ¶
func STB_TEXTEDIT_MOVEWORDLEFT(obj *STB_TEXTEDIT_STRING, idx int) int
func STB_TEXTEDIT_MOVEWORDRIGHT ¶
func STB_TEXTEDIT_MOVEWORDRIGHT(obj *STB_TEXTEDIT_STRING, idx int) int
func STB_TEXTEDIT_STRINGLEN ¶
func STB_TEXTEDIT_STRINGLEN(obj *STB_TEXTEDIT_STRING) int
func STB_TEXT_HAS_SELECTION ¶
func STB_TEXT_HAS_SELECTION(s *STB_TexteditState) bool
func SameLine ¶
func SameLine(offset_from_start_x, spacing_w float)
Gets back to previous line and continue with horizontal layout
offset_from_start_x == 0 : follow right after previous item offset_from_start_x != 0 : align to specified x position (relative to window/group left) spacing_w < 0 : use default spacing if pos_x == 0, no spacing if pos_x != 0 spacing_w >= 0 : enforce spacing amount
func SaveIniSettingsToDisk ¶
func SaveIniSettingsToDisk(ini_filename string)
func SaveIniSettingsToMemory ¶
func ScaleRatioFromValueT ¶
func ScaleRatioFromValueT(v, v_min, v_max float, is_logarithmic bool, logarithmic_zero_epsilon, zero_deadzone_halfsize float) float
Convert a value v in the output space of a slider into a parametric position on the slider itself (the logical opposite of ScaleValueFromRatioT)
func ScaleValueFromRatioT ¶
func ScaleValueFromRatioT(t, v_min, v_max float, is_logarithmic bool, logarithmic_zero_epsilon, zero_deadzone_halfsize float) float
Convert a parametric position on a slider into a value v in the output space (the logical opposite of ScaleRatioFromValueT)
func ScrollbarEx ¶
func ScrollbarEx(bb_frame *ImRect, id ImGuiID, axis ImGuiAxis, p_scroll_v *float, size_avail_v float, size_contents_v float, flags ImDrawFlags) bool
Vertical/Horizontal scrollbar The entire piece of code below is rather confusing because: - We handle absolute seeking (when first clicking outside the grab) and relative manipulation (afterward or when clicking inside the grab) - We store values as normalized ratio and in a form that allows the window content to change while we are holding on a scrollbar - We handle both horizontal and vertical scrollbars, which makes the terminology not ideal. Still, the code should probably be made simpler..
func Selectable ¶
func Selectable(label string, selected bool, flags ImGuiSelectableFlags, size_arg ImVec2) bool
Widgets: Selectables - A selectable highlights when hovered, and can display another color when selected. - Neighbors selectable extend their highlight bounds in order to leave no gap between them. This is so a series of selected Selectable appear contiguous. "selected bool" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height Tip: pass a non-visible label (e.g. "##hello") then you can use the space to draw other text or image. But you need to make sure the ID is unique, e.g. enclose calls in PushID/PopID or use ##unique_id. With this scheme, ImGuiSelectableFlags_SpanAllColumns and ImGuiSelectableFlags_AllowItemOverlap are also frequently used flags. FIXME: Selectable() with (size.x == 0.0f) and (SelectableTextAlign.x > 0.0f) followed by SameLine() is currently not supported.
func SelectablePointer ¶
func SelectablePointer(label string, p_selected *bool, flags ImGuiSelectableFlags, size_arg ImVec2) bool
"bool* p_selected" poto int the selection state (read-write), as a convenient helper.
func Separator ¶
func Separator()
separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
func SetActiveID ¶
func SetActiveID(id ImGuiID, window *ImGuiWindow)
func SetActiveIdUsingNavAndKeys ¶
func SetActiveIdUsingNavAndKeys()
func SetClipboardText ¶
func SetClipboardText(text string)
func SetColorEditOptions ¶
func SetColorEditOptions(flags ImGuiColorEditFlags)
initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.
func SetColumnOffset ¶
func SetColumnOffset(column_index int, offset float)
set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
func SetColumnWidth ¶
func SetColumnWidth(column_index int, width float)
set column width (in pixels). pass -1 to use current column
func SetCurrentContext ¶
func SetCurrentContext(ctx *ImGuiContext)
func SetCurrentFont ¶
func SetCurrentFont(font *ImFont)
func SetCurrentWindow ¶
func SetCurrentWindow(window *ImGuiWindow)
func SetCursorPos ¶
func SetCursorPos(local_pos *ImVec2)
func SetCursorPosX ¶
func SetCursorPosX(local_x float)
func SetCursorPosY ¶
func SetCursorPosY(local_y float)
func SetCursorPosYAndSetupForPrevLine ¶
func SetCursorPosYAndSetupForPrevLine(pos_y, line_height float)
func SetCursorScreenPos ¶
func SetCursorScreenPos(pos ImVec2)
cursor position in absolute coordinates
func SetDragDropPayload ¶
SetDragDropPayload Use 'cond' to choose to submit payload on drag start or every frame type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui.
func SetFocusID ¶
func SetFocusID(id ImGuiID, window *ImGuiWindow)
func SetHoveredID ¶
func SetHoveredID(id ImGuiID)
func SetItemAllowOverlap ¶
func SetItemAllowOverlap()
SetItemAllowOverlap allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area. Allow last item to be overlapped by a subsequent item. Both may be activated during the same frame before the later one takes priority. FIXME: Although this is exposed, its interaction and ideal idiom with using ImGuiButtonFlags_AllowItemOverlap flag are extremely confusing, need rework.
func SetItemDefaultFocus ¶
func SetItemDefaultFocus()
make last item the default focused item of a window.
func SetItemUsingMouseWheel ¶
func SetItemUsingMouseWheel()
Inputs FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.
func SetKeyboardFocusHere ¶
func SetKeyboardFocusHere(offset int)
focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
func SetMouseCursor ¶
func SetMouseCursor(cursor_type ImGuiMouseCursor)
SetMouseCursor set desired cursor type
func SetNamedWindowCollapsed ¶
set named window collapsed state
func SetNamedWindowFocus ¶
func SetNamedWindowFocus(name string)
set named window to be focused / top-most. use NULL to remove focus.
func SetNamedWindowPos ¶
set named window position.
func SetNamedWindowSize ¶
set named window size. set axis to 0.0 to force an auto-fit on this axis.
func SetNavID ¶
func SetNavID(id ImGuiID, nav_layer ImGuiNavLayer, focus_scope_id ImGuiID, rect_rel *ImRect)
SetNavID FIXME-NAV: The existence of SetNavID vs SetFocusID properly needs to be clarified/reworked. In our terminology those should be interchangeable. Those two functions are merely a legacy artifact, so at minimum naming should be clarified.
func SetNextItemOpen ¶
set next TreeNode/CollapsingHeader open state.
func SetNextItemWidth ¶
func SetNextItemWidth(item_width float)
set width of the _next_ common large "item+label" widget. >0.0: width in pixels, <0.0 align xx pixels to the right of window (so -FLT_MIN always align width to the right side) Affect large frame+labels widgets only.
func SetNextWindowBgAlpha ¶
func SetNextWindowBgAlpha(alpha float)
set next window background color alpha. helper to easily override the Alpha component of ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.
func SetNextWindowCollapsed ¶
set next window collapsed state. call before Begin()
func SetNextWindowContentSize ¶
func SetNextWindowContentSize(size ImVec2)
Content size = inner scrollable rectangle, padded with WindowPadding. SetNextWindowContentSize(ImVec2(100,100) + ImGuiWindowFlags_AlwaysAutoResize will always allow submitting a 100x100 item. set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0 to leave it automatic. call before Begin()
func SetNextWindowFocus ¶
func SetNextWindowFocus()
set next window to be focused / top-most. call before Begin()
func SetNextWindowPos ¶
set next window position. call before Begin(). use pivot=(0.5,0.5) to center on given point, etc.
func SetNextWindowScroll ¶
func SetNextWindowScroll(scroll *ImVec2)
SetNextWindowScroll Use -1.0f on one axis to leave as-is
func SetNextWindowSize ¶
set next window size. set axis to 0.0 to force an auto-fit on this axis. call before Begin()
func SetNextWindowSizeConstraints ¶
func SetNextWindowSizeConstraints(size_min ImVec2, size_max ImVec2, custom_callback ImGuiSizeCallback, custom_callback_data any)
set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down. Use callback to apply non-trivial programmatic constraints.
func SetScrollFromPosX ¶
func SetScrollFromPosX(local_x, center_x_ratio float)
SetScrollFromPosX adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position
func SetScrollFromPosY ¶
func SetScrollFromPosY(local_y, center_y_ratio float)
SetScrollFromPosY adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.
func SetScrollHereX ¶
func SetScrollHereX(center_x_ratio float)
SetScrollHereX adjust scrolling amount to make current cursor position visible. center_x_ratio=0.0: left, 0.5: center, 1.0: right. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead. center_x_ratio: 0.0f left of last item, 0.5f horizontal center of last item, 1.0f right of last item.
func SetScrollHereY ¶
func SetScrollHereY(center_y_ratio float)
SetScrollHereY adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead. center_y_ratio: 0.0f top of last item, 0.5f vertical center of last item, 1.0f bottom of last item.
func SetScrollX ¶
func SetScrollX(scroll_x float)
SetScrollX set scrolling amount [0 .. GetScrollMaxX()]
func SetScrollY ¶
func SetScrollY(scroll_y float)
SetScrollY set scrolling amount [0 .. GetScrollMaxY()]
func SetStateStorage ¶
func SetStateStorage(storage *ImGuiStorage)
replace current window storage with our own (if you want to manipulate it yourself, typically clear subsection of it)
func SetTabItemClosed ¶
func SetTabItemClosed(tab_or_docked_window_label string)
notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name. [Public] This is call is 100% optional but it allows to remove some one-frame glitches when a tab has been unexpectedly removed. To use it to need to call the function SetTabItemClosed() between BeginTabBar() and EndTabBar(). Tabs closed by the close button will automatically be flagged to avoid this issue.
func SetTooltip ¶
SetTooltip set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip().
func SetWindowClipRectBeforeSetChannel ¶
func SetWindowClipRectBeforeSetChannel(window *ImGuiWindow, clip_rect *ImRect)
[Internal] Small optimization to avoid calls to PopClipRect/SetCurrentChannel/PushClipRect in sequences, they would meddle many times with the underlying ImDrawCmd. Instead, we do a preemptive overwrite of clipping rectangle _without_ altering the command-buffer and let the subsequent single call to SetCurrentChannel() does it things once.
func SetWindowCollapsed ¶
(not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
func SetWindowConditionAllowFlags ¶
func SetWindowConditionAllowFlags(window *ImGuiWindow, flags ImGuiCond, enabled bool)
func SetWindowFocus ¶
func SetWindowFocus()
(not recommended) set current window to be focused / top-most. prefer using SetNextWindowFocus().
func SetWindowFontScale ¶
func SetWindowFontScale(scale float)
[OBSOLETE] set font scale. Adjust IO.FontGlobalScale if you want to scale all windows. This is an old API! For correct scaling, prefer to reload font + rebuild ImFontAtlas + call style.ScaleAllSizes().
func SetWindowHitTestHole ¶
func SetWindowHitTestHole(window *ImGuiWindow, pos *ImVec2, size *ImVec2)
func SetWindowPos ¶
(not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
func SetWindowSize ¶
(not recommended) set current window size - call within Begin()/End(). set to ImVec2(0, 0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
func SetupViewportDrawData ¶
func SetupViewportDrawData(viewport *ImGuiViewportP, draw_lists *[]*ImDrawList)
func ShadeVertsLinearColorGradientKeepAlpha ¶
func ShadeVertsLinearColorGradientKeepAlpha(draw_list *ImDrawList, vert_start_idx int, vert_end_idx int, gradient_p0 ImVec2, gradient_p1 ImVec2, col0 ImU32, col1 ImU32)
ShadeVertsLinearColorGradientKeepAlpha Generic linear color gradient, write to RGB fields, leave A untouched.
func ShadeVertsLinearUV ¶
func ShadeVertsLinearUV(t *ImDrawList, vert_start_idx int, vert_end_idx int, a *ImVec2, b *ImVec2, uv_a *ImVec2, uv_b *ImVec2, clamp bool)
ShadeVertsLinearUV Distribute UV over (a, b) rectangle
func ShowDemoWindow ¶
func ShowDemoWindow(p_open *bool)
ShowDemoWindow Demonstrate most Dear ImGui features (this is big function!) You may execute this function to experiment with the UI and understand what it does. You may then search for keywords in the code when you are interested by a specific feature. create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!
func ShowFontAtlas ¶
func ShowFontAtlas(atlas *ImFontAtlas)
ShowFontAtlas [DEBUG] List fonts in a font atlas and display its texture
func ShowFontSelector ¶
func ShowFontSelector(label string)
func ShowMetricsWindow ¶
func ShowMetricsWindow(p_open *bool)
ShowMetricsWindow create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.
func ShowStyleEditor ¶
func ShowStyleEditor(ref *ImGuiStyle)
func ShowStyleSelector ¶
func ShrinkWidths ¶
func ShrinkWidths(items []ImGuiShrinkWidthItem, count int, width_excess float)
Shrink excess width from a set of item, by removing width from the larger items first. Set items Width to -1.0f to disable shrinking this item.
func Shutdown ¶
func Shutdown(context *ImGuiContext)
Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().
func SliderAngle ¶
func SliderAngle(label string, v_rad *float, v_degrees_min float, v_degrees_max float, format string, flags ImGuiSliderFlags) bool
func SliderBehavior ¶
func SliderBehavior(bb *ImRect, id ImGuiID, data_type ImGuiDataType, p_v any, p_min any, p_max any, format string, flags ImGuiSliderFlags, out_grab_bb *ImRect) bool
For 32-bit and larger types, slider bounds are limited to half the natural type range. So e.g. an integer Slider between INT_MAX-10 and INT_MAX will fail, but an integer Slider between INT_MAX/2-10 and INT_MAX/2 will be ok. It would be possible to lift that limitation with some work but it doesn't seem to be worth it for sliders.
func SliderFloat ¶
func SliderFloat(label string, v *float, v_min float, v_max float, format string, flags ImGuiSliderFlags) bool
func SliderFloat2 ¶
func SliderFloat2(label string, v *[2]float, v_min float, v_max float, format string, flags ImGuiSliderFlags) bool
func SliderFloat3 ¶
func SliderFloat3(label string, v *[3]float, v_min float, v_max float, format string, flags ImGuiSliderFlags) bool
func SliderFloat4 ¶
func SliderFloat4(label string, v *[4]float, v_min float, v_max float, format string, flags ImGuiSliderFlags) bool
func SliderInt ¶
func SliderInt(label string, v *int, v_min int, v_max int, format string, flags ImGuiSliderFlags) bool
func SliderInt2 ¶
func SliderInt2(label string, v [2]int, v_min int, v_max int, format string, flags ImGuiSliderFlags) bool
func SliderInt3 ¶
func SliderInt3(label string, v [3]int, v_min int, v_max int, format string, flags ImGuiSliderFlags) bool
func SliderInt4 ¶
func SliderInt4(label string, v [4]int, v_min int, v_max int, format string, flags ImGuiSliderFlags) bool
func SliderScalar ¶
func SliderScalar(label string, data_type ImGuiDataType, p_data any, p_min any, p_max any, format string, flags ImGuiSliderFlags) bool
Note: p_data, p_min and p_max are _pointers_ to a memory address holding the data. For a slider, they are all required. Read code of e.g. SliderFloat(), SliderInt() etc. or examples in 'Demo.Widgets.Data Types' to understand how to use this function directly.
func SliderScalarN ¶
func SliderScalarN(label string, data_type ImGuiDataType, p_data []float, p_min float, p_max float, format string, flags ImGuiSliderFlags) bool
Add multiple sliders on 1 line for compact edition of multiple components
func SmallButton ¶
Small buttons fits within text without additional vertical spacing. button with FramePadding=(0,0) to easily embed within text
func SplitterBehavior ¶
func StartLockWheelingWindow ¶
func StartLockWheelingWindow(window *ImGuiWindow)
func StartMouseMovingWindow ¶
func StartMouseMovingWindow(window *ImGuiWindow)
func StyleColorsClassic ¶
func StyleColorsClassic(style *ImGuiStyle)
func StyleColorsDark ¶
func StyleColorsDark(style *ImGuiStyle)
func StyleColorsLight ¶
func StyleColorsLight(style *ImGuiStyle)
StyleColorsLight Those light colors are better suited with a thicker font than the default one + FrameBorder
func TabBarCalcMaxTabWidth ¶
func TabBarCalcMaxTabWidth() float
func TabBarCloseTab ¶
func TabBarCloseTab(tab_bar *ImGuiTabBar, tab *ImGuiTabItem)
Called on manual closure attempt
func TabBarLayout ¶
func TabBarLayout(tab_bar *ImGuiTabBar)
This is called only once a frame before by the first call to ItemTab() The reason we're not calling it in BeginTabBar() is to leave a chance to the user to call the SetTabItemClosed() functions.
func TabBarProcessReorder ¶
func TabBarProcessReorder(tab_bar *ImGuiTabBar) bool
func TabBarQueueReorder ¶
func TabBarQueueReorder(tab_bar *ImGuiTabBar, tab *ImGuiTabItem, offset int)
func TabBarQueueReorderFromMousePos ¶
func TabBarQueueReorderFromMousePos(tab_bar *ImGuiTabBar, src_tab *ImGuiTabItem, mouse_pos ImVec2)
func TabBarRemoveTab ¶
func TabBarRemoveTab(tab_bar *ImGuiTabBar, tab_id ImGuiID)
The *TabId fields be already set by the docking system _before_ the actual TabItem was created, so we clear them regardless.
func TabBarScrollClamp ¶
func TabBarScrollClamp(tab_bar *ImGuiTabBar, scrolling float) float
func TabBarScrollToTab ¶
func TabBarScrollToTab(tab_bar *ImGuiTabBar, tab_id ImGuiID, sections [3]ImGuiTabBarSection)
Note: we may scroll to tab that are not selected! e.g. using keyboard arrow keys
func TabItemBackground ¶
func TabItemBackground(draw_list *ImDrawList, bb *ImRect, flags ImGuiTabItemFlags, col ImU32)
func TabItemButton ¶
func TabItemButton(label string, flags ImGuiTabItemFlags) bool
create a Tab behaving like a button. return true when clicked. cannot be selected in the tab bar.
func TabItemEx ¶
func TabItemEx(tab_bar *ImGuiTabBar, label string, p_open *bool, flags ImGuiTabItemFlags) bool
func TabItemGetSectionIdx ¶
func TabItemGetSectionIdx(tab *ImGuiTabItem) int
func TabItemLabelAndCloseButton ¶
func TabItemLabelAndCloseButton(draw_list *ImDrawList, bb *ImRect, flags ImGuiTabItemFlags, frame_padding ImVec2, label string, tab_id ImGuiID, close_button_id ImGuiID, is_contents_visible bool, out_just_closed *bool, out_text_clipped *bool)
Render text label (with custom clipping) + Unsaved Document marker + Close Button logic We tend to lock style.FramePadding for a given tab-bar, hence the 'frame_padding' parameter.
func TableBeginApplyRequests ¶
func TableBeginApplyRequests(table *ImGuiTable)
Apply queued resizing/reordering/hiding requests
func TableBeginCell ¶
func TableBeginCell(table *ImGuiTable, column_n int)
[Internal] Called by TableSetColumnIndex()/TableNextColumn() This is called very frequently, so we need to be mindful of unnecessary overhead. FIXME-TABLE FIXME-OPT: Could probably shortcut some things for non-active or clipped columns.
func TableBeginInitMemory ¶
func TableBeginInitMemory(e *ImGuiTable, columns_count int)
For reference, the average total _allocation count_ for a table is: + 0 (for ImGuiTable instance, we are pooling allocations in g.Tables) + 1 (for table.RawData allocated below) + 1 (for table.ColumnsNames, if names are used) + 1 (for table.Splitter._Channels) + 2 * active_channels_count (for ImDrawCmd and ImDrawIdx buffers inside channels) Where active_channels_count is variable but often == columns_count or columns_count + 1, see TableSetupDrawChannels() for details. Unused channels don't perform their +2 allocations.
func TableDrawBorders ¶
func TableDrawBorders(table *ImGuiTable)
FIXME-TABLE: This is a mess, need to redesign how we render borders (as some are also done in TableEndRow)
func TableDrawContextMenu ¶
func TableDrawContextMenu(table *ImGuiTable)
Output context menu into current window (generally a popup) FIXME-TABLE: Ideally this should be writable by the user. Full programmatic access to that data?
func TableEndCell ¶
func TableEndCell(table *ImGuiTable)
[Internal] Called by TableNextRow()/TableSetColumnIndex()/TableNextColumn()
func TableFixColumnSortDirection ¶
func TableFixColumnSortDirection(table *ImGuiTable, column *ImGuiTableColumn)
Fix sort direction if currently set on a value which is unavailable (e.g. activating NoSortAscending/NoSortDescending)
func TableGcCompactSettings ¶
func TableGcCompactSettings()
Compact and remove unused settings data (currently only used by TestEngine)
func TableGcCompactTransientBuffers ¶
func TableGcCompactTransientBuffers(table *ImGuiTable)
Free up/compact internal Table buffers for when it gets unused
func TableGcCompactTransientBuffersTempData ¶
func TableGcCompactTransientBuffersTempData(temp_data *ImGuiTableTempData)
func TableGetColumnCount ¶
func TableGetColumnCount() int
TableGetColumnCount Tables: Miscellaneous functions - Functions args 'column_n int' treat the default value of -1 as the same as passing the current column index. return number of columns (value passed to BeginTable)
func TableGetColumnIndex ¶
func TableGetColumnIndex() int
TableGetColumnIndex return current column index.
func TableGetColumnName ¶
func TableGetColumnName(column_n int) string
TableGetColumnName return "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.
func TableGetColumnWidthAuto ¶
func TableGetColumnWidthAuto(table *ImGuiTable, column *ImGuiTableColumn) float
Note this is meant to be stored in column.WidthAuto, please generally use the WidthAuto field
func TableGetHeaderRowHeight ¶
func TableGetHeaderRowHeight() float
func TableGetHoveredColumn ¶
func TableGetHoveredColumn() int
May use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. Return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered. Return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
func TableGetMaxColumnWidth ¶
func TableGetMaxColumnWidth(table *ImGuiTable, column_n int) float
Maximum column content width given current layout. Use column.MinX so this value on a per-column basis.
func TableGetRowIndex ¶
func TableGetRowIndex() int
TableGetRowIndex [Public] Note: for row coloring we use .RowBgColorCounter which is the same value without counting header rows return current row index.
func TableHeader ¶
func TableHeader(label string)
TableHeader Emit a column header (text + optional sort order) We cpu-clip text here so that all columns headers can be merged into a same draw call. Note that because of how we cpu-clip and display sorting indicators, you _cannot_ use SameLine() after a TableHeader() submit one header cell manually (rarely used)
func TableHeadersRow ¶
func TableHeadersRow()
TableHeadersRow [Public] This is a helper to output TableHeader() calls based on the column names declared in TableSetupColumn(). The intent is that advanced users willing to create customized headers would not need to use this helper and can create their own! For example: TableHeader() may be preceeded by Checkbox() or other custom widgets. See 'Demo.Tables.Custom headers' for a demonstration of implementing a custom version of this. This code is constructed to not make much use of internal functions, as it is intended to be a template to copy. FIXME-TABLE: TableOpenContextMenu() and TableGetHeaderRowHeight() are not public. submit all headers cells based on data provided to TableSetupColumn() + submit context menu
func TableMergeDrawChannels ¶
func TableMergeDrawChannels(table *ImGuiTable)
This function reorder draw channels based on matching clip rectangle, to facilitate merging them. Called by EndTable(). For simplicity we call it TableMergeDrawChannels() but in fact it only reorder channels + overwrite ClipRect, actual merging is done by table.DrawSplitter.Merge() which is called right after TableMergeDrawChannels().
Columns where the contents didn't stray off their local clip rectangle can be merged. To achieve this we merge their clip rect and make them contiguous in the channel list, so they can be merged by the call to DrawSplitter.Merge() following to the call to this function. We reorder draw commands by arranging them into a maximum of 4 distinct groups:
1 group: 2 groups: 2 groups: 4 groups: [ 0. ] no freeze [ 0. ] row freeze [ 01 ] col freeze [ 01 ] row+col freeze [ .. ] or no scroll [ 2. ] and v-scroll [ .. ] and h-scroll [ 23 ] and v+h-scroll
Each column itself can use 1 channel (row freeze disabled) or 2 channels (row freeze enabled). When the contents of a column didn't stray off its limit, we move its channels into the corresponding group based on its position (within frozen rows/columns groups or not). At the end of the operation our 1-4 groups will each have a ImDrawCmd using the same ClipRect. This function assume that each column are pointing to a distinct draw channel, otherwise merge_group.ChannelsCount will not match set bit count of merge_group.ChannelsMask.
Column channels will not be merged into one of the 1-4 groups in the following cases:
- The contents stray off its clipping rectangle (we only compare the MaxX value, not the MinX value). Direct ImDrawList calls won't be taken into account by default, if you use them make sure the ImGui:: bounds matches, by e.g. calling SetCursorScreenPos().
- The channel uses more than one draw command itself. We drop all our attempt at merging stuff here.. we could do better but it's going to be rare and probably not worth the hassle.
Columns for which the draw channel(s) haven't been merged with other will use their own ImDrawCmd.
This function is particularly tricky to understand.. take a breath.
func TableNextColumn ¶
func TableNextColumn() bool
TableNextColumn [Public] Append into the next column, wrap and create a new row when already on last column append into the first cell of a new row. append into the next column (or first column of next row if currently in last column). Return true when column is visible.
func TableNextRow ¶
func TableNextRow(row_flags ImGuiTableRowFlags, row_min_height float)
TableNextRow [Public] Starts into the first cell of a new row
func TableOpenContextMenu ¶
func TableOpenContextMenu(column_n int)
Tables: Candidates for public API
func TablePopBackgroundChannel ¶
func TablePopBackgroundChannel()
func TablePushBackgroundChannel ¶
func TablePushBackgroundChannel()
Bg2 is used by Selectable (and possibly other widgets) to render to the background. Unlike our Bg0/1 channel which we uses for RowBg/CellBg/Borders and where we guarantee all shapes to be CPU-clipped, the Bg2 channel being widgets-facing will rely on regular ClipRect.
func TableRemove ¶
func TableRemove(table *ImGuiTable)
Remove Table (currently only used by TestEngine)
func TableResetSettings ¶
func TableResetSettings(table *ImGuiTable)
Restore initial state of table (with or without saved settings)
func TableSaveSettings ¶
func TableSaveSettings(table *ImGuiTable)
func TableSetBgColor ¶
func TableSetBgColor(target ImGuiTableBgTarget, color ImU32, column_n int)
TableSetBgColor change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details.
func TableSetColumnEnabled ¶
func TableSetColumnEnabled(column_n int, enabled bool)
TableSetColumnEnabled Change user accessible enabled/disabled state of a column (often perceived as "showing/hiding" from users point of view) Note that end-user can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody) - Require table to have the ImGuiTableFlags_Hideable flag because we are manipulating user accessible state. - Request will be applied during next layout, which happens on the first call to TableNextRow() after BeginTable(). - For the getter you can test (TableGetColumnFlags() & ImGuiTableColumnFlags_IsEnabled) != 0. - Alternative: the ImGuiTableColumnFlags_Disabled is an overriding/master disable flag which will also hide the column from context menu. change user accessible enabled/disabled state of a column. Set to false to hide the column. User can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody)
func TableSetColumnIndex ¶
func TableSetColumnIndex(column_n int) bool
TableSetColumnIndex [Public] Append into a specific column append into the specified column. Return true when column is visible.
func TableSetColumnSortDirection ¶
func TableSetColumnSortDirection(column_n int, sort_direction ImGuiSortDirection, append_to_sort_specs bool)
Note that the NoSortAscending/NoSortDescending flags are processed in TableSortSpecsSanitize(), and they may change/revert the value of SortDirection. We could technically also do it here but it would be unnecessary and duplicate code.
func TableSetColumnWidth ¶
func TableSetColumnWidth(column_n int, width float)
'width' = inner column width, without padding
func TableSetColumnWidthAutoAll ¶
func TableSetColumnWidthAutoAll(table *ImGuiTable)
func TableSetColumnWidthAutoSingle ¶
func TableSetColumnWidthAutoSingle(table *ImGuiTable, column_n int)
Disable clipping then auto-fit, will take 2 frames (we don't take a shortcut for unclipped columns to reduce inconsistencies when e.g. resizing multiple columns)
func TableSettingsCalcChunkSize ¶
func TableSettingsCalcChunkSize(columns_count int) size_t
func TableSettingsHandler_ApplyAll ¶
func TableSettingsHandler_ApplyAll(ctx *ImGuiContext, _ *ImGuiSettingsHandler)
Apply to existing windows (if any)
func TableSettingsHandler_ClearAll ¶
func TableSettingsHandler_ClearAll(ctx *ImGuiContext, _ *ImGuiSettingsHandler)
func TableSettingsHandler_ReadLine ¶
func TableSettingsHandler_ReadLine(ctx *ImGuiContext, _ *ImGuiSettingsHandler, entry any, line string)
func TableSettingsHandler_ReadOpen ¶
func TableSettingsHandler_ReadOpen(ctx *ImGuiContext, _ *ImGuiSettingsHandler, name string) any
func TableSettingsHandler_WriteAll ¶
func TableSettingsHandler_WriteAll(ctx *ImGuiContext, handler *ImGuiSettingsHandler, buf *ImGuiTextBuffer)
func TableSettingsInit ¶
func TableSettingsInit(settings *ImGuiTableSettings, id ImGuiID, columns_count, columns_count_max int)
Clear and initialize empty settings instance
func TableSettingsInstallHandler ¶
func TableSettingsInstallHandler(context *ImGuiContext)
func TableSetupColumn ¶
func TableSetupColumn(label string, flags ImGuiTableColumnFlags, init_width_or_weight float, user_id ImGuiID)
TableSetupColumn Tables: Headers & Columns declaration
- Use TableSetupColumn() to specify label, resizing policy, default width/weight, id, various other flags etc.
- Use TableHeadersRow() to create a header row and automatically submit a TableHeader() for each column. Headers are required to perform: reordering, sorting, and opening the context menu. The context menu can also be made available in columns body using ImGuiTableFlags_ContextMenuInBody.
- You may manually submit headers using TableNextRow() + TableHeader() calls, but this is only useful in some advanced use cases (e.g. adding custom widgets in header row).
- Use TableSetupScrollFreeze() to lock columns/rows so they stay visible when scrolled.
See "COLUMN SIZING POLICIES" comments at the top of this file If (init_width_or_weight <= 0.0f) it is ignored
func TableSetupColumnFlags ¶
func TableSetupColumnFlags(table *ImGuiTable, column *ImGuiTableColumn, flags_in ImGuiTableColumnFlags)
Adjust flags: default width mode + stretch columns are not allowed when auto extending
func TableSetupDrawChannels ¶
func TableSetupDrawChannels(table *ImGuiTable)
Allocate draw channels. Called by TableUpdateLayout()
- We allocate them following storage order instead of display order so reordering columns won't needlessly increase overall dormant memory cost.
- We isolate headers draw commands in their own channels instead of just altering clip rects. This is in order to facilitate merging of draw commands.
- After crossing FreezeRowsCount, all columns see their current draw channel changed to a second set of channels.
- We only use the dummy draw channel so we can push a null clipping rectangle into it without affecting other channels, while simplifying per-row/per-cell overhead. It will be empty and discarded when merged.
- We allocate 1 or 2 background draw channels. This is because we know TablePushBackgroundChannel() is only used for horizontal spanning. If we allowed vertical spanning we'd need one background draw channel per merge group (1-4).
Draw channel allocation (before merging): - NoClip -. 2+D+1 channels: bg0/1 + bg2 + foreground (same clip rect == always 1 draw call) - Clip -. 2+D+N channels - FreezeRows -. 2+D+N*2 (unless scrolling value is zero) - FreezeRows || FreezeColunns -. 3+D+N*2 (unless scrolling value is zero) Where D is 1 if any column is clipped or hidden (dummy channel) otherwise 0.
func TableSetupScrollFreeze ¶
func TableSetupScrollFreeze(columns int, rows int)
TableSetupScrollFreeze [Public] lock columns/rows so they stay visible when scrolled.
func TableSortSpecsBuild ¶
func TableSortSpecsBuild(table *ImGuiTable)
func TableSortSpecsSanitize ¶
func TableSortSpecsSanitize(table *ImGuiTable)
func TableUpdateBorders ¶
func TableUpdateBorders(table *ImGuiTable)
Process hit-testing on resizing borders. Actual size change will be applied in EndTable()
- Set table.HoveredColumnBorder with a short delay/timer to reduce feedback noise
- Submit ahead of table contents and header, use ImGuiButtonFlags_AllowItemOverlap to prioritize widgets overlapping the same area.
func TableUpdateColumnsWeightFromWidth ¶
func TableUpdateColumnsWeightFromWidth(table *ImGuiTable)
func TableUpdateLayout ¶
func TableUpdateLayout(table *ImGuiTable)
Layout columns for the frame. This is in essence the followup to BeginTable(). Runs on the first call to TableNextRow(), to give a chance for TableSetupColumn() to be called first. FIXME-TABLE: Our width (and therefore our WorkRect) will be minimal in the first frame for _WidthAuto columns. Increase feedback side-effect with widgets relying on WorkRect.Max.x... Maybe provide a default distribution for _WidthAuto columns?
func TempInputIsActive ¶
func TempInputScalar ¶
func TempInputScalar(bb *ImRect, id ImGuiID, label string, data_type ImGuiDataType, p_data any, format string, p_clamp_min any, p_clamp_max any) bool
Note that Drag/Slider functions are only forwarding the min/max values clamping values if the ImGuiSliderFlags_AlwaysClamp flag is set! This is intended: this way we allow CTRL+Click manual input to set a value out of bounds, for maximum flexibility. However this may not be ideal for all uses, as some user code may break on out of bound values.
func TempInputText ¶
func TempInputText(bb *ImRect, id ImGuiID, label string, buf *[]byte, flags ImGuiInputTextFlags) bool
Create text input in place of another active widget (e.g. used when doing a CTRL+Click on drag/slider widgets) FIXME: Facilitate using this in variety of other situations.
func TextColored ¶
TextColored shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor() {panic("not implemented")}
func TextDisabled ¶
shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, ...); PopStyleColor() {panic("not implemented")}
func TextEx ¶
func TextEx(text string, flags ImGuiTextFlags)
func TextUnformatted ¶
func TextUnformatted(text string)
Widgets: Text raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text.
func TextWrapped ¶
shortcut for PushTextWrapPos(0.0); Text(fmt, ...); PopTextWrapPos() {panic("not implemented")}. Note that this won't work on an auto-resizing window if there's no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize().
func TreeNodeBehavior ¶
func TreeNodeBehavior(id ImGuiID, flags ImGuiTreeNodeFlags, label string) bool
func TreeNodeBehaviorIsOpen ¶
func TreeNodeBehaviorIsOpen(id ImGuiID, flags ImGuiTreeNodeFlags) bool
Consume previous SetNextItemOpen() data, if any. May return true when logging
func TreeNodeEx ¶
func TreeNodeEx(str_id string, flags ImGuiTreeNodeFlags, format string, args ...any) bool
func TreeNodeF ¶
helper variation to easily decorelate the id from the displayed string. Read the FAQ about why and how to use ID. to align arbitrary text at the same level as a TreeNode() you can use Bullet().
func TreeNodeInterfaceEx ¶
func TreeNodeInterfaceEx(ptr_id any, flags ImGuiTreeNodeFlags, format string, args ...any) bool
func TreePush ¶
func TreePush(str_id string)
~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired.
func TreePushInterface ¶
func TreePushInterface(ptr_id any)
func TreePushOverrideID ¶
func TreePushOverrideID(id ImGuiID)
func Unindent ¶
func Unindent(indent_w float)
move content position back to the left, by indent_w, or style.IndentSpacing if indent_w <= 0
func UnpackBitVectorToFlatIndexList ¶
func UnpackBitVectorToFlatIndexList(in *ImBitVector, out *[]int)
func UpdateDebugToolItemPicker ¶
func UpdateDebugToolItemPicker()
UpdateDebugToolItemPicker [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack.
func UpdateHoveredWindowAndCaptureFlags ¶
func UpdateHoveredWindowAndCaptureFlags()
The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app)
func UpdateMouseInputs ¶
func UpdateMouseInputs()
func UpdateMouseMovingWindowEndFrame ¶
func UpdateMouseMovingWindowEndFrame()
func UpdateMouseMovingWindowNewFrame ¶
func UpdateMouseMovingWindowNewFrame()
Handle mouse moving window Note: moving window with the navigation keys (Square + d-pad / CTRL+TAB + Arrows) are processed in NavUpdateWindowing() FIXME: We don't have strong guarantee that g.MovingWindow stay synched with g.ActiveId == g.MovingWindow.MoveId. This is currently enforced by the fact that BeginDragDropSource() is setting all g.ActiveIdUsingXXXX flags to inhibit navigation inputs, but if we should more thoroughly test cases where g.ActiveId or g.MovingWindow gets changed and not the other.
func UpdateMouseWheel ¶
func UpdateMouseWheel()
func UpdateTabFocus ¶
func UpdateTabFocus()
func UpdateWindowManualResize ¶
func UpdateWindowManualResize(window *ImGuiWindow, size_auto_fit *ImVec2, border_held *int, resize_grip_count int, resize_grip_col *[4]ImU32, visibility_rect *ImRect) bool
Handle resize for: Resize Grips, Borders, Gamepad Return true when using auto-fit (double click on resize grip)
func UpdateWindowParentAndRootLinks ¶
func UpdateWindowParentAndRootLinks(window *ImGuiWindow, flags ImGuiWindowFlags, parent_window *ImGuiWindow)
func VSliderFloat ¶
func VSliderFloat(label string, size ImVec2, v *float, v_min float, v_max float, format string, flags ImGuiSliderFlags) bool
func VSliderInt ¶
func VSliderInt(label string, size ImVec2, v *int, v_min int, v_max int, format string, flags ImGuiSliderFlags) bool
func VSliderScalar ¶
func VSliderScalar(label string, size ImVec2, data_type ImGuiDataType, p_data any, p_min any, p_max any, format string, flags ImGuiSliderFlags) bool
func WindowSettingsHandler_ApplyAll ¶
func WindowSettingsHandler_ApplyAll(ctx *ImGuiContext, _ *ImGuiSettingsHandler)
WindowSettingsHandler_ApplyAll Apply to existing windows (if any)
func WindowSettingsHandler_ClearAll ¶
func WindowSettingsHandler_ClearAll(ctx *ImGuiContext, _ *ImGuiSettingsHandler)
func WindowSettingsHandler_ReadLine ¶
func WindowSettingsHandler_ReadLine(_ *ImGuiContext, _ *ImGuiSettingsHandler, entry any, line string)
func WindowSettingsHandler_ReadOpen ¶
func WindowSettingsHandler_ReadOpen(_ *ImGuiContext, _ *ImGuiSettingsHandler, name string) any
func WindowSettingsHandler_WriteAll ¶
func WindowSettingsHandler_WriteAll(ctx *ImGuiContext, handler *ImGuiSettingsHandler, buf *ImGuiTextBuffer)
Types ¶
type ImBitVector ¶
type ImBitVector []ImU32
func (*ImBitVector) Clear ¶
func (this *ImBitVector) Clear()
func (*ImBitVector) ClearBit ¶
func (this *ImBitVector) ClearBit(n int)
func (*ImBitVector) Create ¶
func (this *ImBitVector) Create(sz int)
func (*ImBitVector) SetBit ¶
func (this *ImBitVector) SetBit(n int)
func (ImBitVector) SetBitRange ¶
func (this ImBitVector) SetBitRange(n, n2 int)
func (*ImBitVector) TestBit ¶
func (this *ImBitVector) TestBit(n int) bool
type ImDrawCallback ¶
type ImDrawCallback func(parent_list *ImDrawList, cmd *ImDrawCmd)
ImDrawCallback ImDrawCallback: Draw callbacks for advanced uses [configurable type: override in imconfig.h] NB: You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering, you can poke into the draw list for that! Draw callback may be useful for example to:
A) Change your GPU render state, B) render a complex 3D scene inside a UI element without an intermediate texture/render target, etc.
The expected behavior from your rendering function is 'if (cmd.UserCallback != NULL) { cmd) cmd.UserCallback(parent_list, } else { RenderTriangles() }' If you want to override the signature of ImDrawCallback, you can simply use e.g. '#define ImDrawCallback MyDrawCallback' (in imconfig.h) + update rendering backend accordingly.
type ImDrawChannel ¶
type ImDrawChannel struct {
// contains filtered or unexported fields
}
ImDrawChannel [Internal] For use by ImDrawListSplitter
type ImDrawCmd ¶
type ImDrawCmd struct { ClipRect ImVec4 // 4*4 // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in "viewport" coordinates TextureId ImTextureID // 4-8 // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas. VtxOffset uint // 4 // Start offset in vertex buffer. ImGuiBackendFlags_RendererHasVtxOffset: always 0, otherwise may be >0 to support meshes larger than 64K vertices with 16-bit indices. IdxOffset uint // 4 // Start offset in index buffer. Always equal to sum of ElemCount drawn so far. ElemCount uint // 4 // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[]. UserCallback ImDrawCallback // 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally. UserCallbackData any // 4-8 // The draw callback code can access this. }
ImDrawCmd Typically, 1 command = 1 GPU draw call (unless command is a callback)
- VtxOffset/IdxOffset: When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' is enabled, those fields allow us to render meshes larger than 64K vertices while keeping 16-bit indices. Pre-1.71 backends will typically ignore the VtxOffset/IdxOffset fields.
- The ClipRect/TextureId/VtxOffset fields must be contiguous as we memcmp() them together (this is asserted for).
func (*ImDrawCmd) GetTexID ¶
func (this *ImDrawCmd) GetTexID() ImTextureID
func (*ImDrawCmd) HeaderCopyFromHeader ¶
func (this *ImDrawCmd) HeaderCopyFromHeader(other ImDrawCmdHeader)
func (*ImDrawCmd) HeaderEquals ¶
func (*ImDrawCmd) HeaderEqualsHeader ¶
func (this *ImDrawCmd) HeaderEqualsHeader(other *ImDrawCmdHeader) bool
type ImDrawCmdHeader ¶
type ImDrawCmdHeader struct { ClipRect ImVec4 TextureId ImTextureID VtxOffset uint }
ImDrawCmdHeader [Internal] For use by ImDrawList
type ImDrawData ¶
type ImDrawData struct { Valid bool // Only valid after Render() is called and before the next NewFrame() is called. CmdListsCount int // Number of ImDrawList* to render TotalIdxCount int // For convenience, sum of all ImDrawList's IdxBuffer.Size TotalVtxCount int // For convenience, sum of all ImDrawList's VtxBuffer.Size CmdLists []*ImDrawList // Array of ImDrawList* to render. The ImDrawList are owned by ImGuiContext and only pointed to from here. DisplayPos ImVec2 // Top-left position of the viewport to render (== top-left of the orthogonal projection matrix to use) (== GetMainViewport()->Pos for the main viewport, == (0.0) in most single-viewport applications) DisplaySize ImVec2 // Size of the viewport to render (== GetMainViewport()->Size for the main viewport, == io.DisplaySize in most single-viewport applications) FramebufferScale ImVec2 // Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display. }
ImDrawData All draw data to render a Dear ImGui frame (NB: the style and the naming convention here is a little inconsistent, we currently preserve them for backward compatibility purpose, as this is one of the oldest structure exposed by the library! Basically, ImDrawList == CmdList)
func GetDrawData ¶
func GetDrawData() *ImDrawData
GetDrawData Pass this to your backend rendering function! Valid after Render() and until the next call to NewFrame()
func (*ImDrawData) Clear ¶
func (this *ImDrawData) Clear()
func (*ImDrawData) DeIndexAllBuffers ¶
func (this *ImDrawData) DeIndexAllBuffers()
DeIndexAllBuffers Functions Helper to convert all buffers from indexed to non-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
func (*ImDrawData) ScaleClipRects ¶
func (this *ImDrawData) ScaleClipRects(fb_scale *ImVec2)
ScaleClipRects Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than draw_data.DisplaySize, or if there is a difference between your window resolution and framebuffer resolution.
type ImDrawDataBuilder ¶
type ImDrawDataBuilder [2][]*ImDrawList
func (*ImDrawDataBuilder) Clear ¶
func (b *ImDrawDataBuilder) Clear()
func (*ImDrawDataBuilder) FlattenIntoSingleLayer ¶
func (b *ImDrawDataBuilder) FlattenIntoSingleLayer()
func (*ImDrawDataBuilder) GetDrawListCount ¶
func (b *ImDrawDataBuilder) GetDrawListCount() int
type ImDrawFlags ¶
type ImDrawFlags int // -> enum ImDrawFlags_ // Flags: for ImDrawList functions
func FixRectCornerFlags ¶
func FixRectCornerFlags(flags ImDrawFlags) ImDrawFlags
type ImDrawIdx ¶
type ImDrawIdx uint16 // Default: 16-bit (for maximum compatibility with renderer backends)
type ImDrawList ¶
type ImDrawList struct { // This is what you have to render CmdBuffer []ImDrawCmd // Draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback. IdxBuffer []ImDrawIdx // Index buffer. Each command consume ImDrawCmd::ElemCount of those VtxBuffer []ImDrawVert // Vertex buffer. Flags ImDrawListFlags // Flags, you may poke into these to adjust anti-aliasing settings per-primitive. // contains filtered or unexported fields }
ImDrawList Draw command list This is the low-level list of polygons that ImGui:: functions are filling. At the end of the frame, all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering. Each dear imgui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to access the current window draw list and draw custom primitives. You can interleave normal ImGui:: calls and adding primitives to the current draw list. In single viewport mode, top-left is == GetMainViewport()->Pos (generally 0,0), bottom-right is == GetMainViewport()->Pos+Size (generally io.DisplaySize). You are totally free to apply whatever transformation matrix to want to the data (depending on the use of the transformation you may want to apply it to ClipRect as well!) Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui:: functions), if you use this API a lot consider coarse culling your drawn objects.
func GetBackgroundDrawList ¶
func GetBackgroundDrawList(viewport *ImGuiViewport) *ImDrawList
this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
func GetForegroundDrawList ¶
func GetForegroundDrawList(viewport *ImGuiViewport) *ImDrawList
this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.
func GetForegroundDrawListViewport ¶
func GetForegroundDrawListViewport(viewport *ImGuiViewport) *ImDrawList
GetForegroundDrawListViewport get foreground draw list for the given viewport. this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.
func GetViewportDrawList ¶
func GetViewportDrawList(viewport *ImGuiViewportP, drawlist_no size_t, drawlist_name string) *ImDrawList
func GetWindowDrawList ¶
func GetWindowDrawList() *ImDrawList
get draw list associated to the current window, to append your own drawing primitives
func NewImDrawList ¶
func NewImDrawList(shared_data *ImDrawListSharedData) ImDrawList
func (*ImDrawList) AddBezierCubic ¶
func (l *ImDrawList) AddBezierCubic(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, p4 ImVec2, col ImU32, thickness float, num_segments int)
AddBezierCubic Cubic Bezier takes 4 controls points
func (*ImDrawList) AddBezierQuadratic ¶
func (l *ImDrawList) AddBezierQuadratic(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, col ImU32, thickness float, num_segments int)
AddBezierQuadratic Quadratic Bezier takes 3 controls points
func (*ImDrawList) AddCallback ¶
func (l *ImDrawList) AddCallback(callback ImDrawCallback, callback_data any)
AddCallback Advanced Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles.
func (*ImDrawList) AddCircle ¶
func (l *ImDrawList) AddCircle(center ImVec2, radius float, col ImU32, num_segments int, thickness float)
func (*ImDrawList) AddCircleFilled ¶
func (l *ImDrawList) AddCircleFilled(center ImVec2, radius float, col ImU32, num_segments int)
func (*ImDrawList) AddConvexPolyFilled ¶
func (l *ImDrawList) AddConvexPolyFilled(points []ImVec2, points_count int, col ImU32)
AddConvexPolyFilled We intentionally avoid using ImVec2 and its math operators here to reduce cost to a minimum for debug/non-inlined builds.
func (*ImDrawList) AddDrawCmd ¶
func (l *ImDrawList) AddDrawCmd()
AddDrawCmd This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible
func (*ImDrawList) AddImage ¶
func (l *ImDrawList) AddImage(user_texture_id ImTextureID, p_min ImVec2, p_max ImVec2, uv_min *ImVec2, uv_max *ImVec2, col ImU32)
func (*ImDrawList) AddImageQuad ¶
func (*ImDrawList) AddImageRounded ¶
func (l *ImDrawList) AddImageRounded(user_texture_id ImTextureID, p_min ImVec2, p_max ImVec2, uv_min, uv_max *ImVec2, col ImU32, rounding float, flags ImDrawFlags)
func (*ImDrawList) AddLine ¶
func (l *ImDrawList) AddLine(p1 *ImVec2, p2 *ImVec2, col ImU32, thickness float)
AddLine Primitives
- For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
- For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred). In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12. In future versions we will use textures to provide cheaper and higher-quality circles. Use AddNgon() and AddNgonFilled() functions if you need to guaranteed a specific number of sides.
func (*ImDrawList) AddNgon ¶
func (l *ImDrawList) AddNgon(center ImVec2, radius float, col ImU32, num_segments int, thickness float)
AddNgon Guaranteed to honor 'num_segments'
func (*ImDrawList) AddNgonFilled ¶
func (l *ImDrawList) AddNgonFilled(center ImVec2, radius float, col ImU32, num_segments int)
AddNgonFilled Guaranteed to honor 'num_segments'
func (*ImDrawList) AddPolyline ¶
func (l *ImDrawList) AddPolyline(points []ImVec2, points_count int, col ImU32, flags ImDrawFlags, thickness float)
AddPolyline TODO: Thickness anti-aliased lines cap are missing their AA fringe. We avoid using the ImVec2 math operators here to reduce cost to a minimum for debug/non-inlined builds.
func (*ImDrawList) AddQuadFilled ¶
func (*ImDrawList) AddRect ¶
func (l *ImDrawList) AddRect(p_min ImVec2, p_max ImVec2, col ImU32, rounding float, flags ImDrawFlags, thickness float)
AddRect p_min = upper-left, p_max = lower-right Note we don't render 1 pixels sized rectangles properly.
func (*ImDrawList) AddRectFilled ¶
func (l *ImDrawList) AddRectFilled(p_min, p_max ImVec2, col ImU32, rounding float, flags ImDrawFlags)
func (*ImDrawList) AddRectFilledMultiColor ¶
func (l *ImDrawList) AddRectFilledMultiColor(p_min ImVec2, p_max ImVec2, col_upr_left, col_upr_right, col_bot_right, col_bot_left ImU32)
AddRectFilledMultiColor p_min = upper-left, p_max = lower-right
func (*ImDrawList) AddTriangle ¶
func (l *ImDrawList) AddTriangle(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, col ImU32, thickness float)
func (*ImDrawList) AddTriangleFilled ¶
func (l *ImDrawList) AddTriangleFilled(p1 *ImVec2, p2 *ImVec2, p3 ImVec2, col ImU32)
func (*ImDrawList) ChannelsMerge ¶
func (l *ImDrawList) ChannelsMerge()
func (*ImDrawList) ChannelsSetCurrent ¶
func (l *ImDrawList) ChannelsSetCurrent(n int)
func (*ImDrawList) ChannelsSplit ¶
func (l *ImDrawList) ChannelsSplit(count int)
ChannelsSplit Advanced: Channels
- Use to split render into layers. By switching channels to can render out-of-order (e.g. submit FG primitives before BG primitives)
- Use to minimize draw calls (e.g. if going back-and-forth between multiple clipping rectangles, prefer to append into separate channels then merge at the end)
- FIXME-OBSOLETE: This API shouldn't have been in ImDrawList in the first place! Prefer using your own persistent instance of ImDrawListSplitter as you can stack them. Using the ImDrawList::ChannelsXXXX you cannot stack a split over another.
func (*ImDrawList) CloneOutput ¶
func (l *ImDrawList) CloneOutput() *ImDrawList
CloneOutput Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer.
func (*ImDrawList) GetClipRectMax ¶
func (l *ImDrawList) GetClipRectMax() ImVec2
func (*ImDrawList) GetClipRectMin ¶
func (l *ImDrawList) GetClipRectMin() ImVec2
func (*ImDrawList) PathArcTo ¶
func (l *ImDrawList) PathArcTo(center ImVec2, radius, a_min, a_max float, num_segments int)
func (*ImDrawList) PathArcToFast ¶
func (l *ImDrawList) PathArcToFast(center ImVec2, radius float, a_min_sample, a_max_sample int)
func (*ImDrawList) PathArcToFastEx ¶
func (l *ImDrawList) PathArcToFastEx(center ImVec2, radius float, a_min_sample, a_max_sample, a_step int)
func (*ImDrawList) PathBezierCubicCurveTo ¶
func (l *ImDrawList) PathBezierCubicCurveTo(p2 *ImVec2, p3 ImVec2, p4 ImVec2, num_segments int)
PathBezierCubicCurveTo Cubic Bezier (4 control points)
func (*ImDrawList) PathBezierQuadraticCurveTo ¶
func (l *ImDrawList) PathBezierQuadraticCurveTo(p2 *ImVec2, p3 ImVec2, num_segments int)
PathBezierQuadraticCurveTo Quadratic Bezier (3 control points)
func (*ImDrawList) PathClear ¶
func (l *ImDrawList) PathClear()
PathClear Stateful path API, add points then finish with PathFillConvex() or PathStroke()
func (*ImDrawList) PathFillConvex ¶
func (l *ImDrawList) PathFillConvex(col ImU32)
PathFillConvex Note: Anti-aliased filling requires points to be in clockwise order.
func (*ImDrawList) PathLineTo ¶
func (l *ImDrawList) PathLineTo(pos ImVec2)
func (*ImDrawList) PathLineToMergeDuplicate ¶
func (l *ImDrawList) PathLineToMergeDuplicate(pos ImVec2)
func (*ImDrawList) PathRect ¶
func (l *ImDrawList) PathRect(a, b *ImVec2, rounding float, flags ImDrawFlags)
func (*ImDrawList) PathStroke ¶
func (l *ImDrawList) PathStroke(col ImU32, flags ImDrawFlags, thickness float)
func (*ImDrawList) PopClipRect ¶
func (l *ImDrawList) PopClipRect()
func (*ImDrawList) PopTextureID ¶
func (l *ImDrawList) PopTextureID()
func (*ImDrawList) PrimQuadUV ¶
func (l *ImDrawList) PrimQuadUV(a, b, c, d *ImVec2, uv_a, uv_b, uv_c, uv_d *ImVec2, col ImU32)
func (*ImDrawList) PrimRect ¶
func (l *ImDrawList) PrimRect(a, c *ImVec2, col ImU32)
PrimRect Fully unrolled with inline call to keep our debug builds decently fast.
func (*ImDrawList) PrimRectUV ¶
func (l *ImDrawList) PrimRectUV(a, c, uv_a, uv_c *ImVec2, col ImU32)
func (*ImDrawList) PrimReserve ¶
func (l *ImDrawList) PrimReserve(idx_count, vtx_count int)
PrimReserve Advanced: Primitives allocations - We render triangles (three vertices) - All primitives needs to be reserved via PrimReserve() beforehand. Reserve space for a number of vertices and indices. You must finish filling your reserved data before calling PrimReserve() again, as it may reallocate or submit the intermediate results. PrimUnreserve() can be used to release unused allocations.
func (*ImDrawList) PrimUnreserve ¶
func (l *ImDrawList) PrimUnreserve(idx_count, vtx_count int)
PrimUnreserve Release the a number of reserved vertices/indices from the end of the last reservation made with PrimReserve().
func (*ImDrawList) PrimWriteIdx ¶
func (l *ImDrawList) PrimWriteIdx(idx ImDrawIdx)
func (*ImDrawList) PrimWriteVtx ¶
func (l *ImDrawList) PrimWriteVtx(pos ImVec2, uv *ImVec2, col ImU32)
func (*ImDrawList) PushClipRect ¶
func (l *ImDrawList) PushClipRect(cr_min, cr_max ImVec2, intersect_with_current_clip_rect bool)
func (*ImDrawList) PushClipRectFullScreen ¶
func (l *ImDrawList) PushClipRectFullScreen()
PushClipRectFullScreen Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
func (*ImDrawList) PushTextureID ¶
func (l *ImDrawList) PushTextureID(texture_id ImTextureID)
type ImDrawListFlags ¶
type ImDrawListFlags int // -> enum ImDrawListFlags_ // Flags: for ImDrawList instance
const ( ImDrawListFlags_None ImDrawListFlags = 0 ImDrawListFlags_AntiAliasedLines ImDrawListFlags = 1 << 0 // Enable anti-aliased lines/borders (*2 the number of triangles for 1.0f wide line or lines thin enough to be drawn using textures, otherwise *3 the number of triangles) ImDrawListFlags_AntiAliasedLinesUseTex ImDrawListFlags = 1 << 1 // Enable anti-aliased lines/borders using textures when possible. Require backend to render with bilinear filtering. ImDrawListFlags_AntiAliasedFill ImDrawListFlags = 1 << 2 // Enable anti-aliased edge around filled shapes (rounded rectangles, circles). ImDrawListFlags_AllowVtxOffset ImDrawListFlags = 1 << 3 // Can emit 'VtxOffset > 0' to allow large meshes. Set when 'ImGuiBackendFlags_RendererHasVtxOffset' is enabled. )
Flags for ImDrawList instance. Those are set automatically by ImGui:: functions from ImGuiIO settings, and generally not manipulated directly. It is however possible to temporarily alter flags between calls to ImDrawList:: functions.
type ImDrawListSharedData ¶
type ImDrawListSharedData struct {}
func GetDrawListSharedData ¶
func GetDrawListSharedData() *ImDrawListSharedData
you may use this when creating your own ImDrawList instances.
func NewImDrawListSharedData ¶
func NewImDrawListSharedData() ImDrawListSharedData
func (*ImDrawListSharedData) SetCircleTessellationMaxError ¶
func (this *ImDrawListSharedData) SetCircleTessellationMaxError(max_error float)
type ImDrawListSplitter ¶
type ImDrawListSplitter struct {
// contains filtered or unexported fields
}
Split/Merge functions are used to split the draw list into different layers which can be drawn into out of order. This is used by the Columns/Tables API, so items of each column can be batched together in a same draw call.
func (*ImDrawListSplitter) Clear ¶
func (this *ImDrawListSplitter) Clear()
func (*ImDrawListSplitter) ClearFreeMemory ¶
func (this *ImDrawListSplitter) ClearFreeMemory()
func (*ImDrawListSplitter) Merge ¶
func (this *ImDrawListSplitter) Merge(draw_list *ImDrawList)
func (*ImDrawListSplitter) SetCurrentChannel ¶
func (this *ImDrawListSplitter) SetCurrentChannel(draw_list *ImDrawList, idx int)
func (*ImDrawListSplitter) Split ¶
func (this *ImDrawListSplitter) Split(draw_list *ImDrawList, channels_count int)
type ImDrawVert ¶
type ImFileHandle ¶
func ImFileOpen ¶
func ImFileOpen(filename string, mode string) ImFileHandle
type ImFont ¶
type ImFont struct { // Members: Hot ~20/24 bytes (for CalcTextSize) IndexAdvanceX []float // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this this info, and are often bottleneck in large UI). FallbackAdvanceX float // 4 // out // = FallbackGlyph->AdvanceX FontSize float // 4 // in // // Height of characters/line, set during loading (don't change after loading) // Members: Hot ~28/40 bytes (for CalcTextSize + render loop) IndexLookup []ImWchar // 12-16 // out // // Sparse. Index glyphs by Unicode code-point. Glyphs []ImFontGlyph // 12-16 // out // // All glyphs. FallbackGlyph *ImFontGlyph // 4-8 // out // = FindGlyph(FontFallbackChar) // Members: Cold ~32/40 bytes ContainerAtlas *ImFontAtlas // 4-8 // out // // What we has been loaded into ConfigData []ImFontConfig // 4-8 // in // // Pointer within ContainerAtlas->ConfigData ConfigDataCount short // 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont. FallbackChar ImWchar // 2 // out // = FFFD/'?' // Character used if a glyph isn't found. EllipsisChar ImWchar // 2 // out // = '...' // Character used for ellipsis rendering. DotChar ImWchar // 2 // out // = '.' // Character used for ellipsis rendering (if a single '...' character isn't found) DirtyLookupTables bool // 1 // out // Scale float // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale() Ascent, Descent float // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] MetricsTotalSurface int // 4 // out // // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs) Used4kPagesMap [(IM_UNICODE_CODEPOINT_MAX + 1) / 4096 / 8]ImU8 // 2 bytes if ImWchar=ImWchar16, 34 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints. }
ImFont Font runtime data and rendering ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32().
func GetDefaultFont ¶
func GetDefaultFont() *ImFont
func (*ImFont) AddGlyph ¶
func (f *ImFont) AddGlyph(cfg *ImFontConfig, codepoint ImWchar, x0, y0, x1, y1, u0, v0, u1, v1, advance_x float)
AddGlyph x0/y0/x1/y1 are offset from the character upper-left layout position, in pixels. Therefore x0/y0 are often fairly close to zero. Not to be mistaken with texture coordinates, which are held by u0/v0/u1/v1 in normalized format (0.0..1.0 on each texture axis). 'cfg' is not necessarily == 'this.ConfigData' because multiple source fonts+configs can be used to build one target font.
func (*ImFont) AddRemapChar ¶
AddRemapChar Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.
func (*ImFont) BuildLookupTable ¶
func (f *ImFont) BuildLookupTable()
func (*ImFont) CalcTextSizeA ¶
func (*ImFont) CalcWordWrapPositionA ¶
CalcWordWrapPositionA 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
func (*ImFont) ClearOutputData ¶
func (f *ImFont) ClearOutputData()
func (*ImFont) FindGlyph ¶
func (f *ImFont) FindGlyph(c ImWchar) *ImFontGlyph
func (*ImFont) FindGlyphNoFallback ¶
func (f *ImFont) FindGlyphNoFallback(c ImWchar) *ImFontGlyph
func (*ImFont) GetCharAdvance ¶
func (*ImFont) GetDebugName ¶
func (*ImFont) IsGlyphRangeUnused ¶
IsGlyphRangeUnused API is designed this way to avoid exposing the 4K page size e.g. use with IsGlyphRangeUnused(0, 255)
func (*ImFont) RenderChar ¶
func (f *ImFont) RenderChar(draw_list *ImDrawList, size float, pos ImVec2, col ImU32, c ImWchar)
func (*ImFont) RenderText ¶
func (*ImFont) SetGlyphVisible ¶
type ImFontAtlas ¶
type ImFontAtlas struct { Flags ImFontAtlasFlags // Build flags (see ImFontAtlasFlags_) TexID ImTextureID // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure. TexDesiredWidth int // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height. TexGlyphPadding int // Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0. Locked bool // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert. // [Internal] // NB: Access texture data via GetTexData*() calls! Which will setup a default font for you. TexReady bool // Set when texture was built matching current font input TexPixelsUseColors bool // Tell whether our texture data is known to use colors (rather than just alpha channel), in order to help backend select a format. TexPixelsAlpha8 []byte // 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight TexPixelsRGBA32 []uint // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4 TexWidth int // Texture width calculated during Build(). TexHeight int // Texture height calculated during Build(). TexUvScale ImVec2 // = (1.0f/TexWidth, 1.0f/TexHeight) TexUvWhitePixel ImVec2 // Texture coordinates to a white pixel Fonts []*ImFont // Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font. CustomRects []ImFontAtlasCustomRect // Rectangles for packing custom texture data into the atlas. ConfigData []ImFontConfig // Configuration data TexUvLines [IM_DRAWLIST_TEX_LINES_WIDTH_MAX + 1]ImVec4 // UVs for baked anti-aliased lines // [Internal] Font builder FontBuilderIO *ImFontBuilderIO // Opaque interface to a font builder (default to stb_truetype, can be changed to use FreeType by defining IMGUI_ENABLE_FREETYPE). FontBuilderFlags uint // Shared flags (for all fonts) for custom font builder. THIS IS BUILD IMPLEMENTATION DEPENDENT. Per-font override is also available in ImFontConfig. // [Internal] Packing data PackIdMouseCursors int // Custom texture rectangle ID for white pixel and mouse cursors PackIdLines int // Custom texture rectangle ID for baked anti-aliased lines }
ImFontAtlas Load and rasterize multiple TTF/OTF fonts into a same texture. The font atlas will build a single texture holding:
- One or more fonts.
- Custom graphics data needed to render the shapes needed by Dear ImGui.
- Mouse cursor shapes for software cursor rendering (unless setting 'Flags |= ImFontAtlasFlags_NoMouseCursors' in the font atlas).
It is the user-code responsibility to setup/build the atlas, then upload the pixel data into a texture accessible by your graphics api.
- Optionally, call any of the AddFont*** functions. If you don't call any, the default font embedded in the code will be loaded for you.
- Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data.
- Upload the pixels data into a texture within your graphics system (see imgui_impl_xxxx.cpp examples)
- Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture in a format natural to your graphics API. This value will be passed back to you during rendering to identify the texture. Read FAQ entry about ImTextureID for more details.
Common pitfalls:
- If you pass a 'glyph_ranges' array to AddFont*** functions, you need to make sure that your array persist up until the atlas is build (when calling GetTexData*** or Build()). We only copy the pointer, not the data.
- Important: By default, AddFontFromMemoryTTF() takes ownership of the data. Even though we are not writing to it, we will free the pointer on destruction. You can set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed,
- Even though many functions are suffixed with "TTF", OTF data is supported just as well.
- This is an old API and it is currently awkward for those and and various other reasons! We will address them in the future!
func NewImFontAtlas ¶
func NewImFontAtlas() ImFontAtlas
func (*ImFontAtlas) AddCustomRectFontGlyph ¶
func (atlas *ImFontAtlas) AddCustomRectFontGlyph(font *ImFont, id ImWchar, width, height int, advance_x float, offset *ImVec2) int
func (*ImFontAtlas) AddCustomRectRegular ¶
func (atlas *ImFontAtlas) AddCustomRectRegular(width, height int) int
AddCustomRectRegular You can request arbitrary rectangles to be packed into the atlas, for your own purposes.
- After calling Build(), you can query the rectangle position and render your pixels.
- If you render colored output, set 'atlas->TexPixelsUseColors = true' as this may help some backends decide of prefered texture format.
- You can also request your rectangles to be mapped as font glyph (given a font + Unicode point), so you can render e.g. custom colorful icons and use them as regular glyphs.
- Read docs/FONTS.md for more details about using colorful icons.
- Note: this API may be redesigned later in order to support multi-monitor varying DPI settings.
func (*ImFontAtlas) AddFont ¶
func (atlas *ImFontAtlas) AddFont(font_cfg *ImFontConfig) *ImFont
func (*ImFontAtlas) AddFontDefault ¶
func (atlas *ImFontAtlas) AddFontDefault(font_cfg_template *ImFontConfig) *ImFont
AddFontDefault Load embedded ProggyClean.ttf at size 13, disable oversampling
func (*ImFontAtlas) AddFontFromFileTTF ¶
func (atlas *ImFontAtlas) AddFontFromFileTTF(filename string, size_pixels float, font_cfg_template *ImFontConfig, glyph_ranges []ImWchar) *ImFont
func (*ImFontAtlas) AddFontFromMemoryTTF ¶
func (atlas *ImFontAtlas) AddFontFromMemoryTTF(ttf_data []byte, ttf_size int, size_pixels float, font_cfg_template *ImFontConfig, glyph_ranges []ImWchar) *ImFont
func (*ImFontAtlas) Build ¶
func (atlas *ImFontAtlas) Build() bool
Build atlas, retrieve pixel data. User is in charge of copying the pixels into graphics memory (e.g. create a texture with your engine). Then store your texture handle with SetTexID(). The pitch is always = Width * BytesPerPixels (1 or 4) Building in RGBA32 format is provided for convenience and compatibility, but note that unless you manually manipulate or copy color data into the texture (e.g. when using the AddCustomRect*** api), then the RGB pixels emitted will always be white (~75% of memory/bandwidth waste. Build pixels data. This is called automatically for you by the GetTexData*** functions.
func (*ImFontAtlas) CalcCustomRectUV ¶
func (atlas *ImFontAtlas) CalcCustomRectUV(rect *ImFontAtlasCustomRect, out_uv_min, out_uv_max *ImVec2)
CalcCustomRectUV [Internal]
func (*ImFontAtlas) ClearFonts ¶
func (atlas *ImFontAtlas) ClearFonts()
ClearFonts Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory. Clear output font data (glyphs storage, UV coordinates).
func (*ImFontAtlas) ClearInputData ¶
func (atlas *ImFontAtlas) ClearInputData()
ClearInputData Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas. Set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed. 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter. Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.
func (*ImFontAtlas) ClearTexData ¶
func (atlas *ImFontAtlas) ClearTexData()
func (*ImFontAtlas) GetCustomRectByIndex ¶
func (atlas *ImFontAtlas) GetCustomRectByIndex(index int) *ImFontAtlasCustomRect
func (*ImFontAtlas) GetGlyphRangesChineseFull ¶
func (atlas *ImFontAtlas) GetGlyphRangesChineseFull() []ImWchar
GetGlyphRangesChineseFull Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
func (*ImFontAtlas) GetGlyphRangesChineseSimplifiedCommon ¶
func (atlas *ImFontAtlas) GetGlyphRangesChineseSimplifiedCommon() []ImWchar
GetGlyphRangesChineseSimplifiedCommon Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese
func (*ImFontAtlas) GetGlyphRangesCyrillic ¶
func (atlas *ImFontAtlas) GetGlyphRangesCyrillic() []ImWchar
GetGlyphRangesCyrillic Default + about 400 Cyrillic characters
func (*ImFontAtlas) GetGlyphRangesDefault ¶
func (atlas *ImFontAtlas) GetGlyphRangesDefault() []ImWchar
GetGlyphRangesDefault Retrieve list of range (2 int per range, values are inclusive)
func (*ImFontAtlas) GetGlyphRangesJapanese ¶
func (atlas *ImFontAtlas) GetGlyphRangesJapanese() []ImWchar
GetGlyphRangesJapanese Default + Hiragana, Katakana, Half-Width, Selection of 2999 Ideographs
func (*ImFontAtlas) GetGlyphRangesKorean ¶
func (atlas *ImFontAtlas) GetGlyphRangesKorean() []ImWchar
GetGlyphRangesKorean Default + Korean characters
func (*ImFontAtlas) GetGlyphRangesThai ¶
func (atlas *ImFontAtlas) GetGlyphRangesThai() []ImWchar
GetGlyphRangesThai Default + Thai characters
func (*ImFontAtlas) GetGlyphRangesVietnamese ¶
func (atlas *ImFontAtlas) GetGlyphRangesVietnamese() []ImWchar
GetGlyphRangesVietnamese Default + Vietnamese characters
func (*ImFontAtlas) GetMouseCursorTexData ¶
func (atlas *ImFontAtlas) GetMouseCursorTexData(cursor_type ImGuiMouseCursor, out_offset, out_size *ImVec2, out_uv_border *[2]ImVec2, out_uv_fill *[2]ImVec2) bool
func (*ImFontAtlas) GetTexDataAsAlpha8 ¶
func (atlas *ImFontAtlas) GetTexDataAsAlpha8(out_pixels *[]byte, out_width, out_height, out_bytes_per_pixel *int)
GetTexDataAsAlpha8 1 byte per-pixel
func (*ImFontAtlas) GetTexDataAsRGBA32 ¶
func (atlas *ImFontAtlas) GetTexDataAsRGBA32(out_pixels *[]uint32, out_width, out_height, out_bytes_per_pixel *int)
GetTexDataAsRGBA32 4 bytes-per-pixel
func (*ImFontAtlas) IsBuilt ¶
func (atlas *ImFontAtlas) IsBuilt() bool
func (*ImFontAtlas) SetTexID ¶
func (atlas *ImFontAtlas) SetTexID(id ImTextureID)
type ImFontAtlasCustomRect ¶
type ImFontAtlasCustomRect struct {
Width, Height uint16 // Input // Desired rectangle dimension
X, Y uint16 // Output // Packed position in Atlas
GlyphID uint // Input // For custom font glyphs only (ID < 0x110000)
GlyphAdvanceX float // Input // For custom font glyphs only: glyph xadvance
GlyphOffset ImVec2 // Input // For custom font glyphs only: glyph display offset
Font *ImFont // Input // For custom font glyphs only: target font
}
ImFontAtlasCustomRect See ImFontAtlas::AddCustomRectXXX functions.
func NewImFontAtlasCustomRect ¶
func NewImFontAtlasCustomRect() ImFontAtlasCustomRect
func (ImFontAtlasCustomRect) IsPacked ¶
func (r ImFontAtlasCustomRect) IsPacked() bool
type ImFontAtlasFlags ¶
type ImFontAtlasFlags int // -> enum ImFontAtlasFlags_ // Flags: for ImFontAtlas build
const ( ImFontAtlasFlags_None ImFontAtlasFlags = 0 ImFontAtlasFlags_NoPowerOfTwoHeight ImFontAtlasFlags = 1 << 0 // Don't round the height to next power of two ImFontAtlasFlags_NoMouseCursors ImFontAtlasFlags = 1 << 1 // Don't build software mouse cursors into the atlas (save a little texture memory) ImFontAtlasFlags_NoBakedLines ImFontAtlasFlags = 1 << 2 // Don't build thick line textures into the atlas (save a little texture memory). The AntiAliasedLinesUseTex features uses them, otherwise they will be rendered using polygons (more expensive for CPU/GPU). )
type ImFontBuildDstData ¶
type ImFontBuildDstData struct { SrcCount int // Number of source fonts targeting this destination font. GlyphsHighest int GlyphsCount int GlyphsSet ImBitVector // This is used to resolve collision when multiple sources are merged into a same destination font. }
ImFontBuildDstData Temporary data for one destination ImFont* (multiple source fonts can be merged into one destination ImFont)
type ImFontBuildSrcData ¶
type ImFontBuildSrcData struct { FontInfo stbtt.FontInfo PackRange [1]stbtt.PackRange // Hold the list of codepoints to pack (essentially points to Codepoints.Data) Rects []stbrp.Rect // Rectangle to pack. We first fill in their size and the packer will give us their position. PackedChars []stbtt.PackedChar // Output glyphs SrcRanges []ImWchar // Ranges as requested by user (user is allowed to request too much, e.g. 0x0020..0xFFFF) DstIndex int // Index into atlas.Fonts[] and dst_tmp_array[] GlyphsHighest int // Highest requested codepoint GlyphsCount int // Glyph count (excluding missing glyphs and glyphs already set by an earlier source font) GlyphsSet ImBitVector // Glyph bit map (random access, 1-bit per codepoint. This will be a maximum of 8KB) GlyphsList []int // Glyph codepoints list (flattened version of GlyphsMap) }
ImFontBuildSrcData Temporary data for one source font u tiple source fonts can be merged into one destination ImFont) (C doesn't allow instancing ImVectr>wth function-local types so we declare the type here.)
type ImFontBuilderIO ¶
type ImFontBuilderIO struct {
FontBuilder_Build func(atlas *ImFontAtlas) bool
}
ImFontBuilderIO This structure is likely to evolve as we add support for incremental atlas updates
func ImFontAtlasGetBuilderForStbTruetype ¶
func ImFontAtlasGetBuilderForStbTruetype() *ImFontBuilderIO
type ImFontConfig ¶
type ImFontConfig struct { FontData []byte // // TTF/OTF data FontDataSize int // // TTF/OTF data size FontDataOwnedByAtlas bool // true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself). FontNo int // 0 // Index of font within TTF/OTF file SizePixels float // // Size in pixels for rasterizer (more or less maps to the resulting font height). OversampleH int // 3 // Rasterize at higher quality for sub-pixel positioning. Note the difference between 2 and 3 is minimal so you can reduce this to 2 to save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details. OversampleV int // 1 // Rasterize at higher quality for sub-pixel positioning. This is not really useful as we don't use sub-pixel positions on the Y axis. PixelSnapH bool // false // Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1. GlyphExtraSpacing ImVec2 // 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now. GlyphOffset ImVec2 // 0, 0 // Offset all glyphs from this font input. GlyphRanges []ImWchar // NULL // Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. GlyphMinAdvanceX float // 0 // Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font GlyphMaxAdvanceX float // FLT_MAX // Maximum AdvanceX for glyphs MergeMode bool // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights. FontBuilderFlags uint // 0 // Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure. RasterizerMultiply float // 1.0f // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable. EllipsisChar ImWchar // -1 // Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used. // [Internal] Name string DstFont *ImFont }
func NewImFontConfig ¶
func NewImFontConfig() ImFontConfig
type ImFontGlyph ¶
type ImFontGlyph struct { Colored uint // Flag to indicate glyph is colored and should generally ignore tinting (make it usable with no shift on little-endian as this is used in loops) Visible uint // Flag to indicate glyph has no visible pixels (e.g. space). Allow early out when rendering. Codepoint uint // 0x0000..0x10FFFF AdvanceX float // Distance to next character (= data from font + ImFontConfig::GlyphExtraSpacing.x baked in) X0, Y0, X1, Y1 float // Glyph corners U0, V0, U1, V1 float // Texture coordinates }
ImFontGlyph Hold rendering data for one glyph. (Note: some language parsers may fail to convert the 31+1 bitfield members, in this case maybe drop store a single u32 or we can rework this)
func NewImFontGlyph ¶
func NewImFontGlyph() ImFontGlyph
type ImFontGlyphRangesBuilder ¶
type ImFontGlyphRangesBuilder []ImU32
ImFontGlyphRangesBuilder Helper to build glyph ranges from text/string data. Feed your application strings/characters to it then call BuildRanges(). This is essentially a tightly packed of vector of 64k booleans = 8KB storage.
func NewImFontGlyphRangesBuilder ¶
func NewImFontGlyphRangesBuilder() ImFontGlyphRangesBuilder
func (ImFontGlyphRangesBuilder) AddChar ¶
func (b ImFontGlyphRangesBuilder) AddChar(c ImWchar)
func (ImFontGlyphRangesBuilder) AddRanges ¶
func (b ImFontGlyphRangesBuilder) AddRanges(ranges []ImWchar)
AddRanges Add ranges, e.g. builder.AddRanges(ImFontAtlas::GetGlyphRangesDefault()) to force add all of ASCII/Latin+Ext
func (ImFontGlyphRangesBuilder) AddText ¶
func (b ImFontGlyphRangesBuilder) AddText(text string)
AddText Add string (each character of the UTF-8 string are added)
func (ImFontGlyphRangesBuilder) BuildRanges ¶
func (b ImFontGlyphRangesBuilder) BuildRanges(out_ranges *[]ImWchar)
BuildRanges Output new ranges
func (ImFontGlyphRangesBuilder) GetBit ¶
func (b ImFontGlyphRangesBuilder) GetBit(n uintptr) bool
func (ImFontGlyphRangesBuilder) SetBit ¶
func (b ImFontGlyphRangesBuilder) SetBit(n uintptr)
type ImGuiBackendFlags ¶
type ImGuiBackendFlags int // -> enum ImGuiBackendFlags_ // Flags: for io.BackendFlags
const ( ImGuiBackendFlags_None ImGuiBackendFlags = 0 ImGuiBackendFlags_HasGamepad ImGuiBackendFlags = 1 << 0 // Backend Platform supports gamepad and currently has one connected. ImGuiBackendFlags_HasMouseCursors ImGuiBackendFlags = 1 << 1 // Backend Platform supports honoring GetMouseCursor() value to change the OS cursor shape. ImGuiBackendFlags_HasSetMousePos ImGuiBackendFlags = 1 << 2 // Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set). ImGuiBackendFlags_RendererHasVtxOffset ImGuiBackendFlags = 1 << 3 // Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices. )
Backend capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom backend.
type ImGuiButtonFlags ¶
type ImGuiButtonFlags int // -> enum ImGuiButtonFlags_ // Flags: for InvisibleButton()
const ( ImGuiButtonFlags_None ImGuiButtonFlags = 0 ImGuiButtonFlags_MouseButtonLeft ImGuiButtonFlags = 1 << 0 // React on left mouse button (default) ImGuiButtonFlags_MouseButtonRight ImGuiButtonFlags = 1 << 1 // React on right mouse button ImGuiButtonFlags_MouseButtonMiddle ImGuiButtonFlags = 1 << 2 // React on center mouse button // [Internal] ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft )
Flags for InvisibleButton() [extended in imgui_internal.h]
const ( ImGuiButtonFlags_PressedOnClick ImGuiButtonFlags = 1 << 4 // return true on click (mouse down event) ImGuiButtonFlags_PressedOnClickRelease ImGuiButtonFlags = 1 << 5 // [Default] return true on click + release on same item <-- this is what the majority of Button are using ImGuiButtonFlags_PressedOnClickReleaseAnywhere ImGuiButtonFlags = 1 << 6 // return true on click + release even if the release event is not done while hovering the item ImGuiButtonFlags_PressedOnRelease ImGuiButtonFlags = 1 << 7 // return true on release (default requires click+release) ImGuiButtonFlags_PressedOnDoubleClick ImGuiButtonFlags = 1 << 8 // return true on double-click (default requires click+release) ImGuiButtonFlags_PressedOnDragDropHold ImGuiButtonFlags = 1 << 9 // return true when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers) ImGuiButtonFlags_Repeat ImGuiButtonFlags = 1 << 10 // hold to repeat ImGuiButtonFlags_FlattenChildren ImGuiButtonFlags = 1 << 11 // allow interactions even if a child window is overlapping ImGuiButtonFlags_AllowItemOverlap ImGuiButtonFlags = 1 << 12 // require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap() ImGuiButtonFlags_DontClosePopups ImGuiButtonFlags = 1 << 13 // disable automatically closing parent popup on press // [UNUSED] //ImGuiButtonFlags_Disabled ImGuiButtonFlags= 1 << 14 // disable interactions -> use BeginDisabled() or ImGuiItemFlags_Disabled ImGuiButtonFlags_AlignTextBaseLine ImGuiButtonFlags = 1 << 15 // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine ImGuiButtonFlags_NoKeyModifiers ImGuiButtonFlags = 1 << 16 // disable mouse interaction if a key modifier is held ImGuiButtonFlags_NoHoldingActiveId ImGuiButtonFlags = 1 << 17 // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only) ImGuiButtonFlags_NoHoveredOnFocus ImGuiButtonFlags = 1 << 19 // don't report as hovered when nav focus is on this item ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease )
Extend ImGuiButtonFlags_
type ImGuiCol ¶
type ImGuiCol int // -> enum ImGuiCol_ // Enum: A color identifier for styling
ImGuiCol Enums/Flags (declared as for int compatibility with old C++, to allow using as flags without overhead, and to not pollute the top of this file)
- Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists! In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
const ( ImGuiCol_Text ImGuiCol = iota ImGuiCol_TextDisabled ImGuiCol_WindowBg // Background of normal windows ImGuiCol_ChildBg // Background of child windows ImGuiCol_PopupBg // Background of popups, menus, tooltips windows ImGuiCol_Border ImGuiCol_BorderShadow ImGuiCol_FrameBg // Background of checkbox, radio button, plot, slider, text input ImGuiCol_FrameBgHovered ImGuiCol_FrameBgActive ImGuiCol_TitleBg ImGuiCol_TitleBgActive ImGuiCol_TitleBgCollapsed ImGuiCol_MenuBarBg ImGuiCol_ScrollbarBg ImGuiCol_ScrollbarGrab ImGuiCol_ScrollbarGrabHovered ImGuiCol_ScrollbarGrabActive ImGuiCol_CheckMark ImGuiCol_SliderGrab ImGuiCol_SliderGrabActive ImGuiCol_Button ImGuiCol_ButtonHovered ImGuiCol_ButtonActive ImGuiCol_Header // Header* colors are used for CollapsingHeader, TreeNode, Selectable, MenuItem ImGuiCol_HeaderHovered ImGuiCol_HeaderActive ImGuiCol_Separator ImGuiCol_SeparatorHovered ImGuiCol_SeparatorActive ImGuiCol_ResizeGrip ImGuiCol_ResizeGripHovered ImGuiCol_ResizeGripActive ImGuiCol_Tab ImGuiCol_TabHovered ImGuiCol_TabActive ImGuiCol_TabUnfocused ImGuiCol_TabUnfocusedActive ImGuiCol_PlotLines ImGuiCol_PlotLinesHovered ImGuiCol_PlotHistogram ImGuiCol_PlotHistogramHovered ImGuiCol_TableHeaderBg // Table header background ImGuiCol_TableBorderStrong // Table outer and header borders (prefer using Alpha=1.0 here) ImGuiCol_TableBorderLight // Table inner borders (prefer using Alpha=1.0 here) ImGuiCol_TableRowBg // Table row background (even rows) ImGuiCol_TableRowBgAlt // Table row background (odd rows) ImGuiCol_TextSelectedBg ImGuiCol_DragDropTarget ImGuiCol_ModalWindowDimBg // Darken/colorize entire screen behind a modal window, when one is active ImGuiCol_COUNT )
Enumeration for PushStyleColor() / PopStyleColor()
func GetWindowBgColorIdxFromFlags ¶
func GetWindowBgColorIdxFromFlags(flags ImGuiWindowFlags) ImGuiCol
type ImGuiColorEditFlags ¶
type ImGuiColorEditFlags int // -> enum ImGuiColorEditFlags_ // Flags: for ColorEdit4(), ColorPicker4() etc.
const ( ImGuiColorEditFlags_None ImGuiColorEditFlags = 0 ImGuiColorEditFlags_NoAlpha ImGuiColorEditFlags = 1 << 1 // // ColorEdit, ColorPicker, ColorButton: ignore Alpha component (will only read 3 components from the input pointer). ImGuiColorEditFlags_NoPicker ImGuiColorEditFlags = 1 << 2 // // ColorEdit: disable picker when clicking on color square. ImGuiColorEditFlags_NoOptions ImGuiColorEditFlags = 1 << 3 // // ColorEdit: disable toggling options menu when right-clicking on inputs/small preview. ImGuiColorEditFlags_NoSmallPreview ImGuiColorEditFlags = 1 << 4 // // ColorEdit, ColorPicker: disable color square preview next to the inputs. (e.g. to show only the inputs) ImGuiColorEditFlags_NoInputs ImGuiColorEditFlags = 1 << 5 // // ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview color square). ImGuiColorEditFlags_NoTooltip ImGuiColorEditFlags = 1 << 6 // // ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview. ImGuiColorEditFlags_NoLabel ImGuiColorEditFlags = 1 << 7 // // ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker). ImGuiColorEditFlags_NoSidePreview ImGuiColorEditFlags = 1 << 8 // // ColorPicker: disable bigger color preview on right side of the picker, use small color square preview instead. ImGuiColorEditFlags_NoDragDrop ImGuiColorEditFlags = 1 << 9 // // ColorEdit: disable drag and drop target. ColorButton: disable drag and drop source. ImGuiColorEditFlags_NoBorder ImGuiColorEditFlags = 1 << 10 // // ColorButton: disable border (which is enforced by default) // User Options (right-click on widget to change some of them). ImGuiColorEditFlags_AlphaBar ImGuiColorEditFlags = 1 << 16 // // ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker. ImGuiColorEditFlags_AlphaPreview ImGuiColorEditFlags = 1 << 17 // // ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque. ImGuiColorEditFlags_AlphaPreviewHalf ImGuiColorEditFlags = 1 << 18 // // ColorEdit, ColorPicker, ColorButton: display half opaque / half checkerboard, instead of opaque. ImGuiColorEditFlags_HDR ImGuiColorEditFlags = 1 << 19 // // (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well). ImGuiColorEditFlags_DisplayRGB ImGuiColorEditFlags = 1 << 20 // [Display] // ColorEdit: override _display_ type among RGB/HSV/Hex. ColorPicker: select any combination using one or more of RGB/HSV/Hex. ImGuiColorEditFlags_DisplayHSV ImGuiColorEditFlags = 1 << 21 // [Display] // " ImGuiColorEditFlags_DisplayHex ImGuiColorEditFlags = 1 << 22 // [Display] // " ImGuiColorEditFlags_Uint8 ImGuiColorEditFlags = 1 << 23 // [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0..255. ImGuiColorEditFlags_Float ImGuiColorEditFlags = 1 << 24 // [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers. ImGuiColorEditFlags_PickerHueBar ImGuiColorEditFlags = 1 << 25 // [Picker] // ColorPicker: bar for Hue, rectangle for Sat/Value. ImGuiColorEditFlags_PickerHueWheel ImGuiColorEditFlags = 1 << 26 // [Picker] // ColorPicker: wheel for Hue, triangle for Sat/Value. ImGuiColorEditFlags_InputRGB ImGuiColorEditFlags = 1 << 27 // [Input] // ColorEdit, ColorPicker: input and output data in RGB format. ImGuiColorEditFlags_InputHSV ImGuiColorEditFlags = 1 << 28 // [Input] // ColorEdit, ColorPicker: input and output data in HSV format. // Defaults Options. You can set application defaults using SetColorEditOptions(). The intent is that you probably don't want to // override them in most of your calls. Let the user choose via the option menu and/or call SetColorEditOptions() once during startup. ImGuiColorEditFlags_DefaultOptions_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_PickerHueBar // [Internal] Masks ImGuiColorEditFlags_DisplayMask_ = ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHex ImGuiColorEditFlags_DataTypeMask_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_Float ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV )
Flags for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton()
type ImGuiColorMod ¶
ImGuiColorMod Stacked color modifier, backup of modified data so we can restore it
type ImGuiComboFlags ¶
type ImGuiComboFlags int // -> enum ImGuiComboFlags_ // Flags: for BeginCombo()
const ( ImGuiComboFlags_None ImGuiComboFlags = 0 ImGuiComboFlags_PopupAlignLeft ImGuiComboFlags = 1 << 0 // Align the popup toward the left by default ImGuiComboFlags_HeightSmall ImGuiComboFlags = 1 << 1 // Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo() ImGuiComboFlags_HeightRegular ImGuiComboFlags = 1 << 2 // Max ~8 items visible (default) ImGuiComboFlags_HeightLarge ImGuiComboFlags = 1 << 3 // Max ~20 items visible ImGuiComboFlags_HeightLargest ImGuiComboFlags = 1 << 4 // As many fitting items as possible ImGuiComboFlags_NoArrowButton ImGuiComboFlags = 1 << 5 // Display on the preview box without the square arrow button ImGuiComboFlags_NoPreview ImGuiComboFlags = 1 << 6 // Display only a square arrow button ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest )
Flags for ImGui::BeginCombo()
const (
ImGuiComboFlags_CustomPreview ImGuiComboFlags = 1 << 20 // enable BeginComboPreview()
)
Extend ImGuiComboFlags_
type ImGuiComboPreviewData ¶
type ImGuiComboPreviewData struct { PreviewRect ImRect BackupCursorPos ImVec2 BackupCursorMaxPos ImVec2 BackupCursorPosPrevLine ImVec2 BackupPrevLineTextBaseOffset float BackupLayout ImGuiLayoutType }
ImGuiComboPreviewData Storage data for BeginComboPreview()/EndComboPreview()
type ImGuiCond ¶
type ImGuiCond int // -> enum ImGuiCond_ // Enum: A condition for many Set*() functions
const ( ImGuiCond_None ImGuiCond = 0 // No condition (always set the variable), same as _Always ImGuiCond_Always ImGuiCond = 1 << 0 // No condition (always set the variable) ImGuiCond_Once ImGuiCond = 1 << 1 // Set the variable once per runtime session (only the first call will succeed) ImGuiCond_FirstUseEver ImGuiCond = 1 << 2 // Set the variable if the object/window has no persistently saved data (no entry in .ini file) ImGuiCond_Appearing ImGuiCond = 1 << 3 // Set the variable if the object/window is appearing after being hidden/inactive (or the first time) )
Enumeration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions Represent a condition. Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.
type ImGuiConfigFlags ¶
type ImGuiConfigFlags int // -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags
const ( ImGuiConfigFlags_None ImGuiConfigFlags = 0 ImGuiConfigFlags_NoMouse ImGuiConfigFlags = 1 << 4 // Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the backend. ImGuiConfigFlags_NoMouseCursorChange ImGuiConfigFlags = 1 << 5 // Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead. // User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are not used by core Dear ImGui) ImGuiConfigFlags_IsSRGB = 1 << 20 // Application is SRGB-aware. ImGuiConfigFlags_IsTouchScreen = 1 << 21 // Application is using a touch screen instead of a mouse. )
Configuration flags stored in io.ConfigFlags. Set by user/application.
type ImGuiContext ¶
type ImGuiContext struct { Initialized bool IO ImGuiIO Style ImGuiStyle Font *ImFont FontSize float FontBaseSize float Time double FrameCount int FrameCountEnded int FrameCountRendered int WithinFrameScope bool // Set by NewFrame(), cleared by EndFrame() WithinFrameScopeWithImplicitWindow bool // Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed WithinEndChild bool // Set within EndChild() GcCompactAll bool // Windows state Windows []*ImGuiWindow // Windows, sorted in display order, back to front WindowsFocusOrder []*ImGuiWindow // Root windows, sorted in focus order, back to front. WindowsTempSortBuffer []*ImGuiWindow // Temporary buffer used in EndFrame() to reorder windows so parents are kept before their child CurrentWindowStack []ImGuiWindowStackData WindowsById ImGuiStorage // Map window's ImGuiID to *ImGuiWindow WindowsActiveCount int // Number of unique windows submitted by frame WindowsHoverPadding ImVec2 // Padding around resizable windows for which hovering on counts as hovering the window == ImMax(style.TouchExtraPadding, WINDOWS_HOVER_PADDING) CurrentWindow *ImGuiWindow // Window being drawn into HoveredWindow *ImGuiWindow // Window the mouse is hovering. Will typically catch mouse inputs. HoveredWindowUnderMovingWindow *ImGuiWindow // Hovered window ignoring MovingWindow. Only set if MovingWindow is set. MovingWindow *ImGuiWindow // Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindow. WheelingWindow *ImGuiWindow // Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window. WheelingWindowRefMousePos ImVec2 WheelingWindowTimer float // Item/widgets state and tracking information HoveredId ImGuiID // Hovered widget, filled during the frame HoveredIdPreviousFrame ImGuiID HoveredIdAllowOverlap bool HoveredIdUsingMouseWheel bool // Hovered widget will use mouse wheel. Blocks scrolling the underlying window. HoveredIdPreviousFrameUsingMouseWheel bool HoveredIdDisabled bool // At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be true even if HoveredId == 0. HoveredIdTimer float // Measure contiguous hovering time HoveredIdNotActiveTimer float // Measure contiguous hovering time where the item has not been active ActiveId ImGuiID // Active widget ActiveIdIsAlive ImGuiID // Active widget has been seen this frame (we can't use a bool as the ActiveId may change within the frame) ActiveIdTimer float ActiveIdIsJustActivated bool // Set at the time of activation for one frame ActiveIdAllowOverlap bool // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always) ActiveIdNoClearOnFocusLoss bool // Disable losing active id if the active id window gets unfocused. ActiveIdHasBeenPressedBefore bool // Track whether the active id led to a press (this is to allow changing between PressOnClick and PressOnRelease without pressing twice). Used by range_select branch. ActiveIdHasBeenEditedBefore bool // Was the value associated to the widget Edited over the course of the Active state. ActiveIdHasBeenEditedThisFrame bool ActiveIdUsingMouseWheel bool // Active widget will want to read mouse wheel. Blocks scrolling the underlying window. ActiveIdUsingKeyInputMask ImU64 // Active widget will want to read those key inputs. When we grow the ImGuiKey enum we'll need to either to order the enum to make useful keys come first, either redesign this into e.g. a small array. ActiveIdClickOffset ImVec2 // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior) ActiveIdWindow *ImGuiWindow ActiveIdSource ImGuiInputSource // Activating with mouse or nav (gamepad/keyboard) ActiveIdMouseButton ImGuiMouseButton ActiveIdPreviousFrame ImGuiID ActiveIdPreviousFrameIsAlive bool ActiveIdPreviousFrameHasBeenEditedBefore bool ActiveIdPreviousFrameWindow *ImGuiWindow LastActiveId ImGuiID // Store the last non-zero ActiveId, useful for animation. LastActiveIdTimer float // Store the last non-zero ActiveId timer since the beginning of activation, useful for animation. // Next window/item data CurrentItemFlags ImGuiItemFlags // == g.ItemFlagsStack.back() NextItemData ImGuiNextItemData // Storage for SetNextItem** functions LastItemData ImGuiLastItemData // Storage for last submitted item (setup by ItemAdd) NextWindowData ImGuiNextWindowData // Storage for SetNextWindow** functions // Shared stacks ColorStack []ImGuiColorMod // Stack for PushStyleColor()/PopStyleColor() - inherited by Begin() StyleVarStack []ImGuiStyleMod // Stack for PushStyleVar()/PopStyleVar() - inherited by Begin() FontStack []*ImFont // Stack for PushFont()/PopFont() - inherited by Begin() FocusScopeStack []ImGuiID // Stack for PushFocusScope()/PopFocusScope() - not inherited by Begin(), unless child window ItemFlagsStack []ImGuiItemFlags // Stack for PushItemFlag()/PopItemFlag() - inherited by Begin() GroupStack []ImGuiGroupData // Stack for BeginGroup()/EndGroup() - not inherited by Begin() OpenPopupStack []ImGuiPopupData // Which popups are open (persistent) BeginPopupStack []ImGuiPopupData // Which level of BeginPopup() we are in (reset every frame) // Viewports Viewports []*ImGuiViewportP // Active viewports (Size==1 in 'master' branch). Each viewports hold their copy of ImDrawData. // Gamepad/keyboard Navigation // Navigation: Init & Move Requests // Navigation: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize) // Legacy Focus/Tabbing system (older than Nav, active even if Nav is disabled, misnamed. FIXME-NAV: This needs a redesign!) TabFocusRequestCurrWindow *ImGuiWindow // TabFocusRequestNextWindow *ImGuiWindow // TabFocusRequestCurrCounterRegular int // Any item being requested for focus, stored as an index (we on layout to be stable between the frame pressing TAB and the next frame, semi-ouch) TabFocusRequestCurrCounterTabStop int // Tab item being requested for focus, stored as an index TabFocusRequestNextCounterRegular int // Stored for next frame TabFocusRequestNextCounterTabStop int // " TabFocusPressed bool // Set in NewFrame() when user pressed Tab // Render DimBgRatio float // 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list) MouseCursor ImGuiMouseCursor // Drag and Drop DragDropActive bool DragDropWithinSource bool // Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag source. DragDropWithinTarget bool // Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag target. DragDropSourceFlags ImGuiDragDropFlags DragDropSourceFrameCount int DragDropMouseButton ImGuiMouseButton DragDropPayload ImGuiPayload DragDropTargetRect ImRect // Store rectangle of current target candidate (we favor small targets when overlapping) DragDropTargetId ImGuiID DragDropAcceptFlags ImGuiDragDropFlags DragDropAcceptIdCurrRectSurface float // Target item surface (we resolve overlapping targets by prioritizing the smaller surface) DragDropAcceptIdCurr ImGuiID // Target item id (set at the time of accepting the payload) DragDropAcceptIdPrev ImGuiID // Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets) DragDropAcceptFrameCount int // Last time a target expressed a desire to accept the source DragDropHoldJustPressedId ImGuiID // Set when holding a payload just made ButtonBehavior() return a press. DragDropPayloadBufHeap []byte // We don't expose the ImVector<> directly, ImGuiPayload only holds pointer+size DragDropPayloadBufLocal [16]byte // Local buffer for small payloads // Table CurrentTable *ImGuiTable CurrentTableStackIdx int Tables map[ImGuiID]*ImGuiTable TablesTempDataStack []ImGuiTableTempData TablesLastTimeActive map[int]float // Last used timestamp of each tables (SOA, for efficient GC) DrawChannelsTempMergeBuffer []ImDrawChannel // Tab bars CurrentTabBar *ImGuiTabBar TabBars map[ImGuiID]*ImGuiTabBar CurrentTabBarStack []ImGuiPtrOrIndex ShrinkWidthBuffer []ImGuiShrinkWidthItem // Widget state MouseLastValidPos ImVec2 InputTextState ImGuiInputTextState InputTextPasswordFont ImFont TempInputId ImGuiID // Temporary text input when CTRL+clicking on a slider, etc. ColorEditOptions ImGuiColorEditFlags // Store user options for color edit widgets ColorEditLastHue float // Backup of last Hue associated to LastColor[3], so we can restore Hue in lossy RGB<>HSV round trips ColorEditLastSat float // Backup of last Saturation associated to LastColor[3], so we can restore Saturation in lossy RGB<>HSV round trips ColorEditLastColor [3]float ColorPickerRef ImVec4 // Initial/reference color at the time of opening the color picker. ComboPreviewData ImGuiComboPreviewData SliderCurrentAccum float // Accumulated slider delta when using navigation controls. SliderCurrentAccumDirty bool // Has the accumulated slider delta changed since last time we tried to apply it? DragCurrentAccumDirty bool DragCurrentAccum float // Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings DragSpeedDefaultRatio float // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio DisabledAlphaBackup float // Backup for style.Alpha for BeginDisabled() ScrollbarClickDeltaToGrabCenter float // Distance between mouse and center of grab box, normalized in parent space. Use storage? TooltipOverrideCount int TooltipSlowDelay float // Time before slow tooltips appears (FIXME: This is temporary until we merge in tooltip timer+priority work) ClipboardHandlerData []char // If no custom clipboard handler is defined MenusIdSubmittedThisFrame []ImGuiID // A list of menu IDs that were rendered at least once // Platform support PlatformImePos ImVec2 // Cursor position request & last passed to the OS Input Method Editor PlatformImeLastPos ImVec2 PlatformLocaleDecimalPoint char // '.' or *localeconv()->decimal_point // Settings SettingsLoaded bool SettingsDirtyTimer float // Save .ini Settings to memory when time reaches zero SettingsIniData ImGuiTextBuffer // In memory .ini settings SettingsHandlers []ImGuiSettingsHandler // List of .ini settings handlers SettingsWindows []ImGuiWindowSettings // ImGuiWindow .ini settings entries SettingsTables []ImGuiTableSettings // ImGuiTable .ini settings entries Hooks []ImGuiContextHook // Hooks for extensions (e.g. test engine) HookIdNext ImGuiID // Next available HookId // Capture/Logging LogEnabled bool // Currently capturing LogType ImGuiLogType // Capture target LogFile ImFileHandle // If != NULL log to stdout/ file LogBuffer bytes.Buffer // Accumulation buffer when log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators. LogNextPrefix string LogNextSuffix string LogLinePosY float LogLineFirstItem bool LogDepthRef int LogDepthToExpand int LogDepthToExpandDefault int // Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call. // Debug Tools DebugItemPickerActive bool // Item picker is active (started with DebugStartItemPicker()) DebugItemPickerBreakId ImGuiID // Will call IM_DEBUG_BREAK() when encountering this id DebugMetricsConfig ImGuiMetricsConfig // Misc FramerateSecPerFrame [120]float // Calculate estimate of framerate for user over the last 2 seconds. FramerateSecPerFrameIdx int FramerateSecPerFrameCount int FramerateSecPerFrameAccum float WantCaptureMouseNextFrame int // Explicit capture via CaptureKeyboardFromApp()/CaptureMouseFromApp() sets those flags WantCaptureKeyboardNextFrame int WantTextInputNextFrame int TempBuffer string // Temporary text buffer FontAtlasOwnedByContext bool }
var GImGui *ImGuiContext
GImGui Current context pointer. Implicitly used by all Dear ImGui functions. Always assumed to be != nil.
- ImGui::CreateContext() will automatically set this pointer if it is nil. Change to a different context by calling ImGui::SetCurrentContext().
- Important: Dear ImGui functions are not thread-safe because of this pointer. If you want thread-safety to allow N threads to access N different contexts:
- Change this variable to use thread local storage so each thread can refer to a different context, in your imconfig.h: struct ImGuiContext; extern thread_local ImGuiContext* MyImGuiTLS; #define GImGui MyImGuiTLS And then define MyImGuiTLS in one of your cpp files. Note that thread_local is a C++11 keyword, earlier C++ uses compiler-specific keyword.
- Future development aims to make this context pointer explicit to all calls. Also read https://github.com/ocornut/imgui/issues/586
- If you need a finite number of contexts, you may compile and use multiple instances of the ImGui code from a different namespace.
- DLL users: read comments above.
func CreateContext ¶
func CreateContext(shared_font_atlas *ImFontAtlas) *ImGuiContext
Context creation and access
- Each context create its own ImFontAtlas by default. You may instance one yourself and pass it to CreateContext() to share a font atlas between contexts.
- DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions() for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for details.
func GetCurrentContext ¶
func GetCurrentContext() *ImGuiContext
Internal state access - if you want to share Dear ImGui state between modules (e.g. DLL) or allocate it yourself Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module
func NewImGuiContext ¶
func NewImGuiContext(atlas *ImFontAtlas) ImGuiContext
type ImGuiContextHook ¶
type ImGuiContextHook struct { HookId ImGuiID // A unique ID assigned by AddContextHook() Type ImGuiContextHookType Owner ImGuiID Callback ImGuiContextHookCallback UserData any }
type ImGuiContextHookCallback ¶
type ImGuiContextHookCallback func(ctx *ImGuiContext, hook *ImGuiContextHook)
type ImGuiContextHookType ¶
type ImGuiContextHookType int
const ( ImGuiContextHookType_NewFramePre ImGuiContextHookType = iota ImGuiContextHookType_NewFramePost ImGuiContextHookType_EndFramePre ImGuiContextHookType_EndFramePost ImGuiContextHookType_RenderPre ImGuiContextHookType_RenderPost ImGuiContextHookType_Shutdown ImGuiContextHookType_PendingRemoval_ )
type ImGuiDataType ¶
type ImGuiDataType int // -> enum ImGuiDataType_ // Enum: A primary data type
const ( ImGuiDataType_S8 ImGuiDataType = iota // signed char / char (with sensible compilers) ImGuiDataType_U8 // unsigned char ImGuiDataType_S16 // short ImGuiDataType_U16 // unsigned short ImGuiDataType_S32 // int ImGuiDataType_U32 // unsigned int ImGuiDataType_S64 // long long / __int64 ImGuiDataType_U64 // unsigned long long / unsigned __int64 ImGuiDataType_Float // float ImGuiDataType_Double // double ImGuiDataType_COUNT )
A primary data type
type ImGuiDataTypeInfo ¶
type ImGuiDataTypeInfo struct { Size size_t // Size in bytes Name string // Short descriptive name for the type, for debugging PrintFmt string // Default printf format for the type ScanFmt string // Default scanf format for the type }
ImGuiDataTypeInfo Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo().
func DataTypeGetInfo ¶
func DataTypeGetInfo(data_type ImGuiDataType) *ImGuiDataTypeInfo
type ImGuiDataTypeTempStorage ¶
type ImGuiDataTypeTempStorage any
type ImGuiDir ¶
type ImGuiDir int // -> enum ImGuiDir_ // Enum: A cardinal direction
const ( ImGuiDir_None ImGuiDir = -1 ImGuiDir_Left ImGuiDir = 0 ImGuiDir_Right ImGuiDir = 1 ImGuiDir_Up ImGuiDir = 2 ImGuiDir_Down ImGuiDir = 3 ImGuiDir_COUNT ImGuiDir = 4 )
A cardinal direction
type ImGuiDragDropFlags ¶
type ImGuiDragDropFlags int // -> enum ImGuiDragDropFlags_ // Flags: for BeginDragDropSource(), AcceptDragDropPayload()
const ( ImGuiDragDropFlags_None ImGuiDragDropFlags = 0 // BeginDragDropSource() flags ImGuiDragDropFlags_SourceNoPreviewTooltip ImGuiDragDropFlags = 1 << 0 // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disable this behavior. ImGuiDragDropFlags_SourceNoDisableHover ImGuiDragDropFlags = 1 << 1 // By default, when dragging we clear data so that IsItemHovered() will return false, to avoid subsequent user code submitting tooltips. This flag disable this behavior so you can still call IsItemHovered() on the source item. ImGuiDragDropFlags_SourceNoHoldToOpenOthers ImGuiDragDropFlags = 1 << 2 // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item. ImGuiDragDropFlags_SourceAllowNullID ImGuiDragDropFlags = 1 << 3 // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. ImGuiDragDropFlags_SourceExtern ImGuiDragDropFlags = 1 << 4 // External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. ImGuiDragDropFlags_SourceAutoExpirePayload ImGuiDragDropFlags = 1 << 5 // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged) // AcceptDragDropPayload() flags ImGuiDragDropFlags_AcceptBeforeDelivery ImGuiDragDropFlags = 1 << 10 // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. ImGuiDragDropFlags_AcceptNoDrawDefaultRect ImGuiDragDropFlags = 1 << 11 // Do not draw the default highlight rectangle when hovering over target. ImGuiDragDropFlags_AcceptNoPreviewTooltip ImGuiDragDropFlags = 1 << 12 // Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site. ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect // For peeking ahead and inspecting the payload before delivery. )
Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload()
type ImGuiErrorLogCallback ¶
type ImGuiFocusedFlags ¶
type ImGuiFocusedFlags int // -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused()
const ( ImGuiFocusedFlags_None ImGuiFocusedFlags = 0 ImGuiFocusedFlags_ChildWindows ImGuiFocusedFlags = 1 << 0 // IsWindowFocused(): Return true if any children of the window is focused ImGuiFocusedFlags_RootWindow ImGuiFocusedFlags = 1 << 1 // IsWindowFocused(): Test from root window (top most parent of the current hierarchy) ImGuiFocusedFlags_AnyWindow ImGuiFocusedFlags = 1 << 2 // IsWindowFocused(): Return true if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this. Use 'io.WantCaptureMouse' instead! Please read the FAQ! ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows )
Flags for ImGui::IsWindowFocused()
type ImGuiGroupData ¶
type ImGuiGroupData struct { WindowID ImGuiID BackupCursorPos ImVec2 BackupCursorMaxPos ImVec2 BackupIndent ImVec1 BackupGroupOffset ImVec1 BackupCurrLineSize ImVec2 BackupCurrLineTextBaseOffset float BackupActiveIdIsAlive ImGuiID BackupActiveIdPreviousFrameIsAlive bool BackupHoveredIdIsAlive bool EmitItem bool }
ImGuiGroupData Stacked storage data for BeginGroup()/EndGroup()
type ImGuiHoveredFlags ¶
type ImGuiHoveredFlags int // -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
const ( ImGuiHoveredFlags_None ImGuiHoveredFlags = 0 // Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them. ImGuiHoveredFlags_ChildWindows ImGuiHoveredFlags = 1 << 0 // IsWindowHovered() only: Return true if any children of the window is hovered ImGuiHoveredFlags_RootWindow ImGuiHoveredFlags = 1 << 1 // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy) ImGuiHoveredFlags_AnyWindow ImGuiHoveredFlags = 1 << 2 // IsWindowHovered() only: Return true if any window is hovered ImGuiHoveredFlags_AllowWhenBlockedByPopup ImGuiHoveredFlags = 1 << 3 // Return true even if a popup window is normally blocking access to this item/window //ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 4 // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet. ImGuiHoveredFlags_AllowWhenBlockedByActiveItem ImGuiHoveredFlags = 1 << 5 // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns. ImGuiHoveredFlags_AllowWhenOverlapped ImGuiHoveredFlags = 1 << 6 // Return true even if the position is obstructed or overlapped by another window ImGuiHoveredFlags_AllowWhenDisabled ImGuiHoveredFlags = 1 << 7 // Return true even if the item is disabled ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows )
Flags for ImGui::IsItemHovered(), ImGui::IsWindowHovered() Note: if you are trying to check whether your mouse should be dispatched to Dear ImGui or to your app, you should use 'io.WantCaptureMouse' instead! Please read the FAQ! Note: windows with the ImGuiWindowFlags_NoInputs flag are ignored by IsWindowHovered() calls.
type ImGuiID ¶
type ImGuiID = uint // A unique ID used by widgets (typically the result of hashing a stack of string)
ImGuiID Scalar data types
func AddContextHook ¶
func AddContextHook(context *ImGuiContext, hook *ImGuiContextHook) ImGuiID
Generic context hooks No specific ordering/dependency support, will see as needed
func GetActiveID ¶
func GetActiveID() ImGuiID
func GetColumnsID ¶
func GetFocusID ¶
func GetFocusID() ImGuiID
func GetFocusScope ¶
func GetFocusScope() ImGuiID
func GetFocusedFocusScope ¶
func GetFocusedFocusScope() ImGuiID
func GetHoveredID ¶
func GetHoveredID() ImGuiID
func GetIDFromInterface ¶
func GetIDFromString ¶
func GetIDWithSeed ¶
GetIDWithSeed Helper to avoid a common series of PushOverrideID . GetID() . PopID() call (note that when using this pattern, TestEngine's "Stack Tool" will tend to not display the intermediate stack level.
for that to work we would need to do PushOverrideID() . ItemAdd() . PopID() which would alter widget code a little more)
func GetWindowResizeBorderID ¶
func GetWindowResizeBorderID(window *ImGuiWindow, dir ImGuiDir) ImGuiID
Borders (Left, Right, Up, Down)
func GetWindowResizeCornerID ¶
func GetWindowResizeCornerID(window *ImGuiWindow, n int) ImGuiID
0..3: corners (Lower-right, Lower-left, Unused, Unused)
func GetWindowScrollbarID ¶
func GetWindowScrollbarID(window *ImGuiWindow, axis ImGuiAxis) ImGuiID
func ImHashStr ¶
ImHashStr Zero-terminated string hash, with support for ### to reset back to seed value We support a syntax of "label###id" where only "###id" is included in the hash, and only "label" gets displayed. Because this syntax is rarely used we are optimizing for the common case. - If we reach ### in the string we discard the hash so far and reset to the seed. - We don't do 'current += 2; continue;' after handling ### to keep the code smaller/faster (measured ~10% diff in Debug build) FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements.
func TableGetColumnResizeID ¶
func TableGetColumnResizeID(table *ImGuiTable, column_n int, instance_no int) ImGuiID
Return the resizing ID for the right-side of the given column.
type ImGuiIO ¶
type ImGuiIO struct { ConfigFlags ImGuiConfigFlags // = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc. BackendFlags ImGuiBackendFlags // = 0 // See ImGuiBackendFlags_ enum. Set by backend (imgui_impl_xxx files or custom backend) to communicate features supported by the backend. DisplaySize ImVec2 // <unset> // Main display size, in pixels (generally == GetMainViewport()->Size) DeltaTime float // /*= 1.0f*//60.0f // Time elapsed since last frame, in seconds. IniSavingRate float // = 5.0f // Minimum time between saving positions/sizes to .ini file, in seconds. IniFilename string // = "imgui.ini" // Path to .ini file (important: default "imgui.ini" is relative to current working dir!). Set NULL to disable automatic .ini loading/saving or if you want to manually call LoadIniSettingsXXX() / SaveIniSettingsXXX() functions. LogFilename string // = "imgui_log.txt"// Path to .log file (default parameter to ImGui::LogToFile when no file is specified). MouseDoubleClickTime float // = 0.30f // Time for a double-click, in seconds. MouseDoubleClickMaxDist float // = 6.0f // Distance threshold to stay in to validate a double-click, in pixels. MouseDragThreshold float // = 6.0f // Distance threshold before considering we are dragging. KeyMap [ImGuiKey_COUNT]int // <unset> // Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. KeyRepeatDelay float // = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.). KeyRepeatRate float // = 0.050f // When holding a key/button, rate at which it repeats, in seconds. UserData any // = NULL // Store your own data for retrieval by callbacks. Fonts *ImFontAtlas // <auto> // Font atlas: load, rasterize and pack one or more fonts into a single texture. FontGlobalScale float // /*= 1.0f*/ // Global scale all fonts FontAllowUserScaling bool // = false // Allow user scaling text of individual window with CTRL+Wheel. FontDefault *ImFont // = NULL // Font to use on NewFrame(). Use NULL to uses Fonts->Fonts[0]. DisplayFramebufferScale ImVec2 // = (1, 1) // For retina display or other situations where window coordinates are different from framebuffer coordinates. This generally ends up in ImDrawData::FramebufferScale. // Miscellaneous options MouseDrawCursor bool // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations. ConfigMacOSXBehaviors bool // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl. ConfigInputTextCursorBlink bool // = true // Enable blinking cursor (optional as some users consider it to be distracting). ConfigDragClickToInputText bool // = false // [BETA] Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving). Not desirable on devices without a keyboard. ConfigWindowsResizeFromEdges bool // = true // Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag) ConfigWindowsMoveFromTitleBarOnly bool // = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar. ConfigMemoryCompactTimer float // = 60.0f // Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable. // Optional: Platform/Renderer backend name (informational only! will be displayed in About Window) + User data for backend/wrappers to store their own stuff. BackendPlatformName string // = NULL BackendRendererName string // = NULL BackendPlatformUserData any // = NULL // User data for platform backend BackendRendererUserData any // = NULL // User data for renderer backend BackendLanguageUserData any // = NULL // User data for non C++ programming language backend // Optional: Access OS clipboard // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures) GetClipboardTextFn func(user_data any) string SetClipboardTextFn func(user_data any, text string) ClipboardUserData any // Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows) // (default to use native imm32 api on Windows) ImeSetInputScreenPosFn func(x, y int) ImeWindowHandle any // = NULL // (Windows) Set this to your HWND to get automatic IME cursor positioning. MousePos ImVec2 // Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.) MouseDown [5]bool // Mouse buttons: 0=left, 1=right, 2=middle + extras (ImGuiMouseButton_COUNT == 5). Dear ImGui mostly uses left and right buttons. Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API. MouseWheel float // Mouse wheel Vertical: 1 unit scrolls about 5 lines text. MouseWheelH float // Mouse wheel Horizontal. Most users don't have a mouse with an horizontal wheel, may not be filled by all backends. KeyCtrl bool // Keyboard modifier pressed: Control KeyShift bool // Keyboard modifier pressed: Shift KeyAlt bool // Keyboard modifier pressed: Alt KeySuper bool // Keyboard modifier pressed: Cmd/Super/Windows KeysDown [512]bool // Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). WantCaptureMouse bool // Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.). WantCaptureKeyboard bool // Set when Dear ImGui will use keyboard inputs, in this case do not dispatch them to your main game/application (either way, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.). WantTextInput bool // Mobile/console: when set, you may display an on-screen keyboard. This is set by Dear ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active). WantSetMousePos bool // MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled. WantSaveIniSettings bool // When manual .ini load/save is active (io.IniFilename == NULL), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. Important: clear io.WantSaveIniSettings yourself after saving! Framerate float // Rough estimate of application framerate, in frame per second. Solely for convenience. Rolling average estimation based on io.DeltaTime over 120 frames. MetricsRenderVertices int // Vertices output during last call to Render() MetricsRenderIndices int // Indices output during last call to Render() = number of triangles * 3 MetricsRenderWindows int // Number of visible windows MetricsActiveWindows int // Number of active windows MetricsActiveAllocations int // Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts. MouseDelta ImVec2 // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta. WantCaptureMouseUnlessPopupClose bool // Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup. KeyMods ImGuiKeyModFlags // Key mods flags (same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags), updated by NewFrame() KeyModsPrev ImGuiKeyModFlags // Previous key mods MousePosPrev ImVec2 // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid) MouseClickedPos [5]ImVec2 // Position at time of clicking MouseClickedTime [5]double // Time of last click (used to figure out double-click) MouseClicked [5]bool // Mouse button went from !Down to Down MouseDoubleClicked [5]bool // Has mouse button been double-clicked? MouseReleased [5]bool // Mouse button went from Down to !Down MouseDownOwned [5]bool // Track if button was clicked inside a dear imgui window or over void blocked by a popup. We don't request mouse capture from the application if click started outside ImGui bounds. MouseDownOwnedUnlessPopupClose [5]bool //Track if button was clicked inside a dear imgui window. MouseDownWasDoubleClick [5]bool // Track if button down was a double-click MouseDownDuration [5]float // Duration the mouse button has been down (0.0f == just clicked) MouseDownDurationPrev [5]float // Previous time the mouse button has been down MouseDragMaxDistanceAbs [5]ImVec2 // Maximum distance, absolute, on each axis, of how much mouse has traveled from the clicking point MouseDragMaxDistanceSqr [5]float // Squared maximum distance of how much mouse has traveled from the clicking point KeysDownDuration [512]float // Duration the keyboard key has been down (0.0f == just pressed) KeysDownDurationPrev [512]float // Previous duration the key has been down PenPressure float // Touch/Pen pressure (0.0f to 1.0f, should be >0.0f only when MouseDown[0] == true). Helper storage currently unused by Dear ImGui. InputQueueSurrogate ImWchar16 // For AddInputCharacterUTF16 InputQueueCharacters []ImWchar // Queue of _characters_ input (obtained by platform backend). Fill using AddInputCharacter() helper. }
func GetIO ¶
func GetIO() *ImGuiIO
GetIO access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)
func NewImGuiIO ¶
func NewImGuiIO() ImGuiIO
func (*ImGuiIO) AddFocusEvent ¶
Notifies Dear ImGui when hosting platform windows lose or gain input focus
func (*ImGuiIO) AddInputCharacter ¶
Pass in translated ASCII characters for text input. - with glfw you can get those from the callback set in glfwSetCharCallback() - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message
func (*ImGuiIO) AddInputCharacters ¶
func (*ImGuiIO) ClearInputCharacters ¶
func (io *ImGuiIO) ClearInputCharacters()
Clear the text input buffer manually
type ImGuiInputReadMode ¶
type ImGuiInputReadMode int
const ( ImGuiInputReadMode_Down ImGuiInputReadMode = iota ImGuiInputReadMode_Pressed ImGuiInputReadMode_Released ImGuiInputReadMode_Repeat ImGuiInputReadMode_RepeatSlow ImGuiInputReadMode_RepeatFast )
FIXME-NAV: Clarify/expose various repeat delay/rate
type ImGuiInputSource ¶
type ImGuiInputSource int
const ( ImGuiInputSource_None ImGuiInputSource = iota ImGuiInputSource_Mouse ImGuiInputSource_Keyboard ImGuiInputSource_Gamepad ImGuiInputSource_Clipboard // Currently only used by InputText() ImGuiInputSource_COUNT )
type ImGuiInputTextCallback ¶
type ImGuiInputTextCallback func(data *ImGuiInputTextCallbackData) int // Callback function for ImGui::InputText()
ImGuiInputTextCallback Callback and functions types
type ImGuiInputTextCallbackData ¶
type ImGuiInputTextCallbackData struct { EventFlag ImGuiInputTextFlags // One ImGuiInputTextFlags_Callback* // Read-only Flags ImGuiInputTextFlags // What user passed to InputText() // Read-only UserData any // What user passed to InputText() // Read-only // Arguments for the different callback events // - To modify the text buffer in a callback, prefer using the InsertChars() / DeleteChars() function. InsertChars() will take care of calling the resize callback if necessary. // - If you know your edits are not going to resize the underlying buffer allocation, you may modify the contents of 'Buf[]' directly. You need to update 'BufTextLen' accordingly (0 <= BufTextLen < BufSize) and set 'BufDirty” to true so InputText can update its internal state. EventChar ImWchar // Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to EventChar=0 setting EventKey ImGuiKey // Key pressed (Up/Down/TAB) // Read-only // [Completion,History] Buf []byte // Text buffer // Read-write // [Resize] Can replace pointer / [Completion,History,Always] Only write to pointed data, don't replace the actual pointer! BufTextLen int // Text length (in bytes) // Read-write // [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length() BufSize int // Buffer size (in bytes) = capacity+1 // Read-only // [Resize,Completion,History,Always] Include zero-terminator storage. In C land == ARRAYSIZE(my_char_array), in C++ land: string.capacity()+1 BufDirty bool // Set if you modify Buf/BufTextLen! // Write // [Completion,History,Always] CursorPos int // // Read-write // [Completion,History,Always] SelectionStart int // // Read-write // [Completion,History,Always] == to SelectionEnd when no selection) SelectionEnd int // // Read-write // [Completion,History,Always] }
ImGuiInputTextCallbackData Shared state of InputText(), passed as an argument to your callback when a ImGuiInputTextFlags_Callback* flag is used. The callback function should return 0 by default. Callbacks (follow a flag name and see comments in ImGuiInputTextFlags_ declarations for more details) - ImGuiInputTextFlags_CallbackEdit: Callback on buffer edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) - ImGuiInputTextFlags_CallbackAlways: Callback on each iteration - ImGuiInputTextFlags_CallbackCompletion: Callback on pressing TAB - ImGuiInputTextFlags_CallbackHistory: Callback on pressing Up/Down arrows - ImGuiInputTextFlags_CallbackCharFilter: Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard. - ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.
func NewImGuiInputTextCallbackData ¶
func NewImGuiInputTextCallbackData() *ImGuiInputTextCallbackData
func (*ImGuiInputTextCallbackData) ClearSelection ¶
func (this *ImGuiInputTextCallbackData) ClearSelection()
func (*ImGuiInputTextCallbackData) DeleteChars ¶
func (this *ImGuiInputTextCallbackData) DeleteChars(pos, bytes_count int)
DeleteChars Public API to manipulate UTF-8 text We expose UTF-8 to the user (unlike the STB_TEXTEDIT_* functions which are manipulating wchar) FIXME: The existence of this rarely exercised code path is a bit of a nuisance.
func (*ImGuiInputTextCallbackData) HasSelection ¶
func (this *ImGuiInputTextCallbackData) HasSelection() bool
func (*ImGuiInputTextCallbackData) InsertChars ¶
func (this *ImGuiInputTextCallbackData) InsertChars(pos int, new_text string)
func (*ImGuiInputTextCallbackData) SelectAll ¶
func (this *ImGuiInputTextCallbackData) SelectAll()
type ImGuiInputTextFlags ¶
type ImGuiInputTextFlags int // -> enum ImGuiInputTextFlags_ // Flags: for InputText(), InputTextMultiline()
const ( ImGuiInputTextFlags_None ImGuiInputTextFlags = 0 ImGuiInputTextFlags_CharsDecimal ImGuiInputTextFlags = 1 << 0 // Allow 0123456789.+-*/ ImGuiInputTextFlags_CharsHexadecimal ImGuiInputTextFlags = 1 << 1 // Allow 0123456789ABCDEFabcdef ImGuiInputTextFlags_CharsUppercase ImGuiInputTextFlags = 1 << 2 // Turn a..z into A..Z ImGuiInputTextFlags_CharsNoBlank ImGuiInputTextFlags = 1 << 3 // Filter out spaces, tabs ImGuiInputTextFlags_AutoSelectAll ImGuiInputTextFlags = 1 << 4 // Select entire text when first taking mouse focus ImGuiInputTextFlags_EnterReturnsTrue ImGuiInputTextFlags = 1 << 5 // Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider looking at the IsItemDeactivatedAfterEdit() function. ImGuiInputTextFlags_CallbackCompletion ImGuiInputTextFlags = 1 << 6 // Callback on pressing TAB (for completion handling) ImGuiInputTextFlags_CallbackHistory ImGuiInputTextFlags = 1 << 7 // Callback on pressing Up/Down arrows (for history handling) ImGuiInputTextFlags_CallbackAlways ImGuiInputTextFlags = 1 << 8 // Callback on each iteration. User code may query cursor position, modify text buffer. ImGuiInputTextFlags_CallbackCharFilter ImGuiInputTextFlags = 1 << 9 // Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard. ImGuiInputTextFlags_AllowTabInput ImGuiInputTextFlags = 1 << 10 // Pressing TAB input a '\t' character into the text field ImGuiInputTextFlags_CtrlEnterForNewLine ImGuiInputTextFlags = 1 << 11 // In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter, add line with Enter). ImGuiInputTextFlags_NoHorizontalScroll ImGuiInputTextFlags = 1 << 12 // Disable following the cursor horizontally ImGuiInputTextFlags_AlwaysOverwrite ImGuiInputTextFlags = 1 << 13 // Overwrite mode ImGuiInputTextFlags_ReadOnly ImGuiInputTextFlags = 1 << 14 // Read-only mode ImGuiInputTextFlags_Password ImGuiInputTextFlags = 1 << 15 // Password mode, display all characters as '*' ImGuiInputTextFlags_NoUndoRedo ImGuiInputTextFlags = 1 << 16 // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). ImGuiInputTextFlags_CharsScientific ImGuiInputTextFlags = 1 << 17 // Allow 0123456789.+-*/eE (Scientific notation input) ImGuiInputTextFlags_CallbackResize ImGuiInputTextFlags = 1 << 18 // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) ImGuiInputTextFlags_CallbackEdit ImGuiInputTextFlags = 1 << 19 // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active) )
Flags for ImGui::InputText()
const ( // [Internal] ImGuiInputTextFlags_Multiline ImGuiInputTextFlags = 1 << 26 // For internal use by InputTextMultiline() ImGuiInputTextFlags_NoMarkEdited ImGuiInputTextFlags = 1 << 27 // For internal use by functions using InputText() before reformatting data ImGuiInputTextFlags_MergedItem ImGuiInputTextFlags = 1 << 28 // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match. )
Extend ImGuiInputTextFlags_
type ImGuiInputTextState ¶
type ImGuiInputTextState struct { ID ImGuiID // widget id owning the text state CurLenW, CurLenA int // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not. TextW []ImWchar // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer. TextA []char // temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity. InitialTextA []char // backup of end-user buffer at the time of focus (in UTF-8, unaltered) TextAIsValid bool // temporary UTF8 buffer is not initially valid before we make the widget active (until then we pull the data from user argument) BufCapacityA int // end-user buffer capacity ScrollX float // horizontal scrolling/offset Stb STB_TexteditState CursorAnim float // timer for cursor blink, reset on every user action so the cursor reappears immediately CursorFollow bool // set when we want scrolling to follow the current cursor position (not always!) SelectedAllMouseLock bool // after a double-click to select all, we ignore further mouse drags to update selection Edited bool // edited this frame Flags ImGuiInputTextFlags UserCallback ImGuiInputTextCallback UserCallbackData any }
ImGuiInputTextState Internal state of the currently focused/edited text input box For a given item ID, access with ImGui::GetInputTextState()
func GetInputTextState ¶
func GetInputTextState(id ImGuiID) *ImGuiInputTextState
func (*ImGuiInputTextState) ClearSelection ¶
func (s *ImGuiInputTextState) ClearSelection()
func (*ImGuiInputTextState) ClearText ¶
func (s *ImGuiInputTextState) ClearText()
func (*ImGuiInputTextState) CursorAnimReset ¶
func (s *ImGuiInputTextState) CursorAnimReset()
func (*ImGuiInputTextState) CursorClamp ¶
func (s *ImGuiInputTextState) CursorClamp()
func (*ImGuiInputTextState) GetCursorPos ¶
func (s *ImGuiInputTextState) GetCursorPos() int
func (*ImGuiInputTextState) GetRedoAvailCount ¶
func (s *ImGuiInputTextState) GetRedoAvailCount() int
func (*ImGuiInputTextState) GetSelectionEnd ¶
func (s *ImGuiInputTextState) GetSelectionEnd() int
func (*ImGuiInputTextState) GetSelectionStart ¶
func (s *ImGuiInputTextState) GetSelectionStart() int
func (*ImGuiInputTextState) GetUndoAvailCount ¶
func (s *ImGuiInputTextState) GetUndoAvailCount() int
func (*ImGuiInputTextState) HasSelection ¶
func (s *ImGuiInputTextState) HasSelection() bool
func (*ImGuiInputTextState) OnKeyPressed ¶
func (s *ImGuiInputTextState) OnKeyPressed(key int)
func (*ImGuiInputTextState) SelectAll ¶
func (s *ImGuiInputTextState) SelectAll()
type ImGuiItemFlags ¶
type ImGuiItemFlags int // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag()
const ( ImGuiItemFlags_None ImGuiItemFlags = 0 ImGuiItemFlags_NoTabStop ImGuiItemFlags = 1 << 0 // false // Disable keyboard tabbing (FIXME: should merge with _NoNav) ImGuiItemFlags_ButtonRepeat ImGuiItemFlags = 1 << 1 // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings. ImGuiItemFlags_Disabled ImGuiItemFlags = 1 << 2 // false // Disable interactions but doesn't affect visuals. See BeginDisabled()/EndDisabled(). See github.com/ocornut/imgui/issues/211 ImGuiItemFlags_SelectableDontClosePopup ImGuiItemFlags = 1 << 5 // false // Disable MenuItem/Selectable() automatically closing their popup window ImGuiItemFlags_MixedValue ImGuiItemFlags = 1 << 6 // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets) ImGuiItemFlags_ReadOnly ImGuiItemFlags = 1 << 7 // false // [ALPHA] Allow hovering interactions but underlying value is not changed. ImGuiItemFlags_Inputable ImGuiItemFlags = 1 << 8 // false // [WIP] Auto-activate item when focused. Currently only used and supported by a few items before it becomes a generic feature. )
Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin(). This is going to be exposed in imgui.h when stabilized enough.
func GetItemFlags ¶
func GetItemFlags() ImGuiItemFlags
type ImGuiItemStatusFlags ¶
type ImGuiItemStatusFlags int // -> enum ImGuiItemStatusFlags_ // Flags: for DC.LastItemStatusFlags
const ( ImGuiItemStatusFlags_None ImGuiItemStatusFlags = 0 ImGuiItemStatusFlags_HoveredRect ImGuiItemStatusFlags = 1 << 0 // Mouse position is within item rectangle (does NOT mean that the window is in correct z-order and can be hovered!, this is only one part of the most-common IsItemHovered test) ImGuiItemStatusFlags_HasDisplayRect ImGuiItemStatusFlags = 1 << 1 // g.LastItemData.DisplayRect is valid ImGuiItemStatusFlags_Edited ImGuiItemStatusFlags = 1 << 2 // Value exposed by item was edited in the current frame (should match the bool return value of most widgets) ImGuiItemStatusFlags_ToggledSelection ImGuiItemStatusFlags = 1 << 3 // Set when Selectable(), TreeNode() reports toggling a selection. We can't report "Selected", only state changes, in order to easily handle clipping with less issues. ImGuiItemStatusFlags_ToggledOpen ImGuiItemStatusFlags = 1 << 4 // Set when TreeNode() reports toggling their open state. ImGuiItemStatusFlags_HasDeactivated ImGuiItemStatusFlags = 1 << 5 // Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag. ImGuiItemStatusFlags_Deactivated ImGuiItemStatusFlags = 1 << 6 // Only valid if ImGuiItemStatusFlags_HasDeactivated is set. ImGuiItemStatusFlags_HoveredWindow ImGuiItemStatusFlags = 1 << 7 // Override the HoveredWindow test to allow cross-window hover testing. ImGuiItemStatusFlags_FocusedByCode ImGuiItemStatusFlags = 1 << 8 // Set when the Focusable item just got focused from code. ImGuiItemStatusFlags_FocusedByTabbing ImGuiItemStatusFlags = 1 << 9 // Set when the Focusable item just got focused by Tabbing. ImGuiItemStatusFlags_Focused = ImGuiItemStatusFlags_FocusedByCode | ImGuiItemStatusFlags_FocusedByTabbing )
Storage for LastItem data
func GetItemStatusFlags ¶
func GetItemStatusFlags() ImGuiItemStatusFlags
type ImGuiKey ¶
type ImGuiKey int // -> enum ImGuiKey_ // Enum: A key identifier (ImGui-side enum)
const ( ImGuiKey_Tab ImGuiKey = iota ImGuiKey_LeftArrow ImGuiKey_RightArrow ImGuiKey_UpArrow ImGuiKey_DownArrow ImGuiKey_PageUp ImGuiKey_PageDown ImGuiKey_Home ImGuiKey_End ImGuiKey_Insert ImGuiKey_Delete ImGuiKey_Backspace ImGuiKey_Space ImGuiKey_Enter ImGuiKey_Escape ImGuiKey_KeyPadEnter ImGuiKey_A // for text edit CTRL+A: select all ImGuiKey_C // for text edit CTRL+C: copy ImGuiKey_V // for text edit CTRL+V: paste ImGuiKey_X // for text edit CTRL+X: cut ImGuiKey_Y // for text edit CTRL+Y: redo ImGuiKey_Z // for text edit CTRL+Z: undo ImGuiKey_COUNT )
User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
type ImGuiKeyModFlags ¶
type ImGuiKeyModFlags int // -> enum ImGuiKeyModFlags_ // Flags: for io.KeyMods (Ctrl/Shift/Alt/Super)
const ( ImGuiKeyModFlags_None ImGuiKeyModFlags = 0 ImGuiKeyModFlags_Ctrl ImGuiKeyModFlags = 1 << 0 ImGuiKeyModFlags_Shift ImGuiKeyModFlags = 1 << 1 ImGuiKeyModFlags_Alt ImGuiKeyModFlags = 1 << 2 ImGuiKeyModFlags_Super ImGuiKeyModFlags = 1 << 3 )
To test io.KeyMods (which is a combination of individual fields io.KeyCtrl, io.KeyShift, io.KeyAlt set by user/backend)
func GetMergedKeyModFlags ¶
func GetMergedKeyModFlags() ImGuiKeyModFlags
type ImGuiLastItemData ¶
type ImGuiLastItemData struct { ID ImGuiID InFlags ImGuiItemFlags // See ImGuiItemFlags_ StatusFlags ImGuiItemStatusFlags // See ImGuiItemStatusFlags_ Rect ImRect // Full rectangle DisplayRect ImRect // Display rectangle (only if ImGuiItemStatusFlags_HasDisplayRect is set) }
type ImGuiLayoutType ¶
type ImGuiLayoutType int // -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical
ImGuiLayoutType Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
const ( ImGuiLayoutType_Horizontal ImGuiLayoutType = 0 ImGuiLayoutType_Vertical ImGuiLayoutType = 1 )
FIXME: this is in development, not exposed/functional as a generic feature yet. Horizontal/Vertical enums are fixed to 0/1 so they may be used to index ImVec2
type ImGuiListClipper ¶
type ImGuiListClipper struct { DisplayStart int DisplayEnd int // [Internal] ItemsCount int StepNo int ItemsFrozen int ItemsHeight float StartPosY float }
Helper: Manually clip large list of items. If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse clipping based on visibility to save yourself from processing those items at all. The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped. (Dear ImGui already clip items based on their bounds but it needs to measure text size to do so, whereas manual coarse clipping before submission makes this cost and your own data fetching/submission cost almost null) Usage:
clipper ImGuiListClipper
clipper.Begin(1000) // // We have 1000 elements, evenly spaced.
while (clipper.Step()) for (int i clipper.DisplayStart = i clipper.DisplayEnd < i++) ImGui::Text("line number i) %d",
Generally what happens is: - Clipper lets you process the first element (DisplayStart DisplayEnd = 1) regardless of it being visible or not. - User code submit one element. - Clipper can measure the height of the first element - Clipper calculate the actual range of elements to display based on the current clipping rectangle, position the cursor before the first visible element. - User code submit visible elements.
func NewImGuiListClipper ¶
func NewImGuiListClipper() ImGuiListClipper
func (ImGuiListClipper) Begin ¶
func (this ImGuiListClipper) Begin(items_count int, items_height float)
Use case A: Begin() called from constructor with items_height<0, then called again from Step() in StepNo 1 Use case B: Begin() called from constructor with items_height>0 FIXME-LEGACY: Ideally we should remove the Begin/End functions but they are part of the legacy API we still support. This is why some of the code in Step() calling Begin() and reassign some fields, spaghetti style. items_count: Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step) items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
func (ImGuiListClipper) End ¶
func (this ImGuiListClipper) End()
Automatically called on the last call of Step() that returns false.
func (ImGuiListClipper) Step ¶
func (this ImGuiListClipper) Step() bool
type ImGuiLogType ¶
type ImGuiLogType int
const ( ImGuiLogType_None ImGuiLogType = iota ImGuiLogType_TTY ImGuiLogType_File ImGuiLogType_Buffer ImGuiLogType_Clipboard )
type ImGuiMenuColumns ¶
type ImGuiMenuColumns struct { TotalWidth ImU32 NextTotalWidth ImU32 Spacing ImU16 OffsetIcon ImU16 // Always zero for now OffsetLabel ImU16 // Offsets are locked in Update() OffsetShortcut ImU16 OffsetMark ImU16 Widths [4]ImU16 // Width of: Icon, Label, Shortcut, Mark (accumulators for current frame) }
func NewImGuiMenuColumns ¶
func NewImGuiMenuColumns() ImGuiMenuColumns
func (*ImGuiMenuColumns) CalcNextTotalWidth ¶
func (c *ImGuiMenuColumns) CalcNextTotalWidth(update_offsets bool)
func (*ImGuiMenuColumns) DeclColumns ¶
func (c *ImGuiMenuColumns) DeclColumns(w_icon float, w_label float, w_shortcut float, w_mark float) float
func (*ImGuiMenuColumns) Update ¶
func (c *ImGuiMenuColumns) Update(spacing float, window_reappearing bool)
Update Helpers for internal use
type ImGuiMetricsConfig ¶
type ImGuiMetricsConfig struct { ShowWindowsRects bool ShowWindowsBeginOrder bool ShowTablesRects bool ShowDrawCmdMesh bool ShowDrawCmdBoundingBoxes bool ShowWindowsRectsType int ShowTablesRectsType int }
func NewImGuiMetricsConfig ¶
func NewImGuiMetricsConfig() ImGuiMetricsConfig
type ImGuiMouseButton ¶
type ImGuiMouseButton int // -> enum ImGuiMouseButton_ // Enum: A mouse button identifier (0=left, 1=right, 2=middle)
const ( ImGuiMouseButton_Left ImGuiMouseButton = 0 ImGuiMouseButton_Right ImGuiMouseButton = 1 ImGuiMouseButton_Middle ImGuiMouseButton = 2 ImGuiMouseButton_COUNT ImGuiMouseButton = 5 )
Identify a mouse button. Those values are guaranteed to be stable and we frequently use 0/1 directly. Named enums provided for convenience.
type ImGuiMouseCursor ¶
type ImGuiMouseCursor int // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor identifier
const ( ImGuiMouseCursor_None ImGuiMouseCursor = -1 ImGuiMouseCursor_Arrow ImGuiMouseCursor = iota ImGuiMouseCursor_TextInput // When hovering over InputText, etc. ImGuiMouseCursor_ResizeAll // (Unused by Dear ImGui functions) ImGuiMouseCursor_ResizeNS // When hovering over an horizontal border ImGuiMouseCursor_ResizeEW // When hovering over a vertical border or a column ImGuiMouseCursor_ResizeNESW // When hovering over the bottom-left corner of a window ImGuiMouseCursor_ResizeNWSE // When hovering over the bottom-right corner of a window ImGuiMouseCursor_Hand // (Unused by Dear ImGui functions. Use for e.g. hyperlinks) ImGuiMouseCursor_NotAllowed // When hovering something with disallowed interaction. Usually a crossed circle. ImGuiMouseCursor_COUNT )
Enumeration for GetMouseCursor() User code may request backend to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here
func GetMouseCursor ¶
func GetMouseCursor() ImGuiMouseCursor
GetMouseCursor get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
type ImGuiNavDirSourceFlags ¶
type ImGuiNavDirSourceFlags int // -> enum ImGuiNavDirSourceFlags_ // Flags: for GetNavInputAmount2d()
const ()
type ImGuiNavHighlightFlags ¶
type ImGuiNavHighlightFlags int // -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
const ()
type ImGuiNavInput ¶
type ImGuiNavInput int // -> enum ImGuiNavInput_ // Enum: An input identifier for navigation
const ( // Gamepad Mapping // [Internal] Don't use directly! This is used internally to differentiate keyboard from gamepad inputs for behaviors that require to differentiate them. // Keyboard behavior that have no corresponding gamepad mapping (e.g. CTRL+TAB) will be directly reading from io.KeysDown[] instead of io.NavInputs[]. )
Gamepad/Keyboard navigation Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays. Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Backend: set ImGuiBackendFlags_HasGamepad and fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame(). Read instructions in imgui.cpp for more details. Download PNG/PSD at http://dearimgui.org/controls_sheets.
type ImGuiNavItemData ¶
type ImGuiNavItemData struct {}
func NewImGuiNavItemData ¶
func NewImGuiNavItemData() ImGuiNavItemData
func (*ImGuiNavItemData) Clear ¶
func (d *ImGuiNavItemData) Clear()
type ImGuiNavMoveFlags ¶
type ImGuiNavMoveFlags int // -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests
const ()
type ImGuiNextItemData ¶
type ImGuiNextItemData struct { Flags ImGuiNextItemDataFlags Width float // Set by SetNextItemWidth() FocusScopeId ImGuiID // Set by SetNextItemMultiSelectData() (!= 0 signify value has been set, so it's an alternate version of HasSelectionData, we don't use Flags for this because they are cleared too early. This is mostly used for debugging) OpenCond ImGuiCond // Set by SetNextItemOpen() OpenVal bool // Set by SetNextItemOpen() }
func (*ImGuiNextItemData) ClearFlags ¶
func (d *ImGuiNextItemData) ClearFlags()
type ImGuiNextItemDataFlags ¶
type ImGuiNextItemDataFlags int // -> enum ImGuiNextItemDataFlags_ // Flags: for SetNextItemXXX() functions
const ( ImGuiNextItemDataFlags_None ImGuiNextItemDataFlags = 0 ImGuiNextItemDataFlags_HasWidth ImGuiNextItemDataFlags = 1 << 0 ImGuiNextItemDataFlags_HasOpen ImGuiNextItemDataFlags = 1 << 1 )
type ImGuiNextWindowData ¶
type ImGuiNextWindowData struct { Flags ImGuiNextWindowDataFlags PosCond ImGuiCond SizeCond ImGuiCond CollapsedCond ImGuiCond PosVal ImVec2 PosPivotVal ImVec2 SizeVal ImVec2 ContentSizeVal ImVec2 ScrollVal ImVec2 CollapsedVal bool SizeConstraintRect ImRect SizeCallback ImGuiSizeCallback SizeCallbackUserData any BgAlphaVal float MenuBarOffsetMinVal ImVec2 }
func (*ImGuiNextWindowData) ClearFlags ¶
func (d *ImGuiNextWindowData) ClearFlags()
type ImGuiNextWindowDataFlags ¶
type ImGuiNextWindowDataFlags int // -> enum ImGuiNextWindowDataFlags_// Flags: for SetNextWindowXXX() functions
const ( ImGuiNextWindowDataFlags_None ImGuiNextWindowDataFlags = 0 ImGuiNextWindowDataFlags_HasPos ImGuiNextWindowDataFlags = 1 << 0 ImGuiNextWindowDataFlags_HasSize ImGuiNextWindowDataFlags = 1 << 1 ImGuiNextWindowDataFlags_HasContentSize ImGuiNextWindowDataFlags = 1 << 2 ImGuiNextWindowDataFlags_HasCollapsed ImGuiNextWindowDataFlags = 1 << 3 ImGuiNextWindowDataFlags_HasSizeConstraint ImGuiNextWindowDataFlags = 1 << 4 ImGuiNextWindowDataFlags_HasFocus ImGuiNextWindowDataFlags = 1 << 5 ImGuiNextWindowDataFlags_HasBgAlpha ImGuiNextWindowDataFlags = 1 << 6 ImGuiNextWindowDataFlags_HasScroll ImGuiNextWindowDataFlags = 1 << 7 )
type ImGuiOldColumnData ¶
type ImGuiOldColumnData struct { OffsetNorm float // Column start offset, normalized 0.0 (far left) -> 1.0 (far right) OffsetNormBeforeResize float Flags ImGuiOldColumnFlags // Not exposed ClipRect ImRect }
ImGuiOldColumnData Storage data for a single column for legacy Columns() api
type ImGuiOldColumnFlags ¶
type ImGuiOldColumnFlags int // -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns()
const ( ImGuiOldColumnFlags_None ImGuiOldColumnFlags = 0 ImGuiOldColumnFlags_NoBorder ImGuiOldColumnFlags = 1 << 0 // Disable column dividers ImGuiOldColumnFlags_NoResize ImGuiOldColumnFlags = 1 << 1 // Disable resizing columns when clicking on the dividers ImGuiOldColumnFlags_NoPreserveWidths ImGuiOldColumnFlags = 1 << 2 // Disable column width preservation when adjusting columns ImGuiOldColumnFlags_NoForceWithinWindow ImGuiOldColumnFlags = 1 << 3 // Disable forcing columns to fit within window ImGuiOldColumnFlags_GrowParentContentsSize ImGuiOldColumnFlags = 1 << 4 // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove. )
Flags for internal's BeginColumns(). Prefix using BeginTable() nowadays!
type ImGuiOldColumns ¶
type ImGuiOldColumns struct { ID ImGuiID Flags ImGuiOldColumnFlags IsFirstFrame bool IsBeingResized bool Current int Count int OffMinX, OffMaxX float // Offsets from HostWorkRect.Min.x LineMinY, LineMaxY float HostCursorPosY float // Backup of CursorPos at the time of BeginColumns() HostCursorMaxPosX float // Backup of CursorMaxPos at the time of BeginColumns() HostInitialClipRect ImRect // Backup of ClipRect at the time of BeginColumns() HostBackupClipRect ImRect // Backup of ClipRect during PushColumnsBackground()/PopColumnsBackground() HostBackupParentWorkRect ImRect // Backup of WorkRect at the time of BeginColumns() Columns []ImGuiOldColumnData Splitter ImDrawListSplitter }
func FindOrCreateColumns ¶
func FindOrCreateColumns(window *ImGuiWindow, id ImGuiID) *ImGuiOldColumns
type ImGuiOnceUponAFrame ¶
type ImGuiOnceUponAFrame struct {
RefFrame int
}
ImGuiOnceUponAFrame Helper: Execute a block of code at maximum once a frame. Convenient if you want to quickly create an UI within deep-nested code that runs multiple times every frame. Usage: static oaf ImGuiOnceUponAFrame if (oaf) ImGui::Text("This will be called only once frame") per
func NewImGuiOnceUponAFrame ¶
func NewImGuiOnceUponAFrame() ImGuiOnceUponAFrame
func (ImGuiOnceUponAFrame) Bool ¶
func (this ImGuiOnceUponAFrame) Bool() bool
type ImGuiPayload ¶
type ImGuiPayload struct { // Members Data any // Data (copied and owned by dear imgui) DataSize int // Data size // [Internal] SourceId ImGuiID // Source item id SourceParentId ImGuiID // Source parent id (if available) DataFrameCount int // Data timestamp DataType [32 + 1]byte // Data type tag (short user-supplied string, 32 characters max) Preview bool // Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets) Delivery bool // Set when AcceptDragDropPayload() was called and mouse button is released over the target item. }
ImGuiPayload Data payload for Drag and Drop operations: AcceptDragDropPayload(), GetDragDropPayload()
func AcceptDragDropPayload ¶
func AcceptDragDropPayload(ptype string, flags ImGuiDragDropFlags) *ImGuiPayload
AcceptDragDropPayload accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.
func GetDragDropPayload ¶
func GetDragDropPayload() *ImGuiPayload
GetDragDropPayload peek directly into the current payload from anywhere. may return NULL. use ImGuiPayload::IsDataType() to test for the payload type.
func NewImGuiPayload ¶
func NewImGuiPayload() ImGuiPayload
func (ImGuiPayload) IsDataType ¶
func (this ImGuiPayload) IsDataType(dtype string) bool
func (ImGuiPayload) IsDelivery ¶
func (this ImGuiPayload) IsDelivery() bool
func (ImGuiPayload) IsPreview ¶
func (this ImGuiPayload) IsPreview() bool
type ImGuiPlotArrayGetterData ¶
type ImGuiPlotArrayGetterData struct { Values []float Stride int }
type ImGuiPlotType ¶
type ImGuiPlotType int
const ( ImGuiPlotType_Lines ImGuiPlotType = iota ImGuiPlotType_Histogram )
type ImGuiPopupData ¶
type ImGuiPopupData struct { PopupId ImGuiID // Set on OpenPopup() Window *ImGuiWindow // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup() SourceWindow *ImGuiWindow // Set on OpenPopup() copy of NavWindow at the time of opening the popup OpenFrameCount int // Set on OpenPopup() OpenParentId ImGuiID // Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items) OpenPopupPos ImVec2 // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse) OpenMousePos ImVec2 // Set on OpenPopup(), copy of mouse position at the time of opening popup }
type ImGuiPopupFlags ¶
type ImGuiPopupFlags int // -> enum ImGuiPopupFlags_ // Flags: for OpenPopup*(), BeginPopupContext*(), IsPopupOpen()
const ( ImGuiPopupFlags_None ImGuiPopupFlags = 0 ImGuiPopupFlags_MouseButtonLeft ImGuiPopupFlags = 0 // For BeginPopupContext*(): open on Left Mouse release. Guaranteed to always be == 0 (same as ImGuiMouseButton_Left) ImGuiPopupFlags_MouseButtonRight ImGuiPopupFlags = 1 // For BeginPopupContext*(): open on Right Mouse release. Guaranteed to always be == 1 (same as ImGuiMouseButton_Right) ImGuiPopupFlags_MouseButtonMiddle ImGuiPopupFlags = 2 // For BeginPopupContext*(): open on Middle Mouse release. Guaranteed to always be == 2 (same as ImGuiMouseButton_Middle) ImGuiPopupFlags_MouseButtonMask_ ImGuiPopupFlags = 0x1F ImGuiPopupFlags_MouseButtonDefault_ ImGuiPopupFlags = 1 ImGuiPopupFlags_NoOpenOverExistingPopup ImGuiPopupFlags = 1 << 5 // For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack ImGuiPopupFlags_NoOpenOverItems ImGuiPopupFlags = 1 << 6 // For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space ImGuiPopupFlags_AnyPopupId ImGuiPopupFlags = 1 << 7 // For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup. ImGuiPopupFlags_AnyPopupLevel ImGuiPopupFlags = 1 << 8 // For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level) ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevel )
Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions.
- To be backward compatible with older API which took an 'int mouse_button = 1' argument, we need to treat small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags. It is therefore guaranteed to be legal to pass a mouse button index in ImGuiPopupFlags.
- For the same reason, we exceptionally default the ImGuiPopupFlags argument of BeginPopupContextXXX functions to 1 instead of 0. IMPORTANT: because the default parameter is 1 (==ImGuiPopupFlags_MouseButtonRight), if you rely on the default parameter and want to another another flag, you need to pass in the ImGuiPopupFlags_MouseButtonRight flag.
- Multiple buttons currently cannot be combined/or-ed in those functions (we could allow it later).
type ImGuiPopupPositionPolicy ¶
type ImGuiPopupPositionPolicy int
const ( ImGuiPopupPositionPolicy_Default ImGuiPopupPositionPolicy = iota ImGuiPopupPositionPolicy_ComboBox ImGuiPopupPositionPolicy_Tooltip )
type ImGuiPtrOrIndex ¶
type ImGuiPtrOrIndex struct { Ptr any // Either field can be set, not both. e.g. Dock node tab bars are loose while BeginTabBar() ones are in a pool. Index int // Usually index in a main pool. }
func GetTabBarRefFromTabBar ¶
func GetTabBarRefFromTabBar(tab_bar *ImGuiTabBar) ImGuiPtrOrIndex
func ImGuiIndex ¶
func ImGuiIndex(index int) ImGuiPtrOrIndex
func ImGuiPtr ¶
func ImGuiPtr(ptr any) ImGuiPtrOrIndex
type ImGuiResizeBorderDef ¶
Data for resizing from borders
type ImGuiResizeGripDef ¶
Data for resizing from corner
type ImGuiSelectableFlags ¶
type ImGuiSelectableFlags int // -> enum ImGuiSelectableFlags_ // Flags: for Selectable()
const ( ImGuiSelectableFlags_None ImGuiSelectableFlags = 0 ImGuiSelectableFlags_DontClosePopups ImGuiSelectableFlags = 1 << 0 // Clicking this don't close parent popup window ImGuiSelectableFlags_SpanAllColumns ImGuiSelectableFlags = 1 << 1 // Selectable frame can span all columns (text will still fit in current column) ImGuiSelectableFlags_AllowDoubleClick ImGuiSelectableFlags = 1 << 2 // Generate press events on double clicks too ImGuiSelectableFlags_Disabled ImGuiSelectableFlags = 1 << 3 // Cannot be selected, display grayed out text ImGuiSelectableFlags_AllowItemOverlap ImGuiSelectableFlags = 1 << 4 // (WIP) Hit testing to allow subsequent widgets to overlap this one )
Flags for ImGui::Selectable()
const ( // NB: need to be in sync with last value of ImGuiSelectableFlags_ ImGuiSelectableFlags_NoHoldingActiveID ImGuiSelectableFlags = 1 << 20 ImGuiSelectableFlags_SelectOnClick ImGuiSelectableFlags = 1 << 22 // Override button behavior to react on Click (default is Click+Release) ImGuiSelectableFlags_SelectOnRelease ImGuiSelectableFlags = 1 << 23 // Override button behavior to react on Release (default is Click+Release) ImGuiSelectableFlags_SpanAvailWidth ImGuiSelectableFlags = 1 << 24 // Span all avail width even if we declared less for layout purpose. FIXME: We may be able to remove this (added in 6251d379, 2bcafc86 for menus) ImGuiSelectableFlags_DrawHoveredWhenHeld ImGuiSelectableFlags = 1 << 25 // Always show active when held, even is not hovered. This concept could probably be renamed/formalized somehow. ImGuiSelectableFlags_NoPadWithHalfSpacing ImGuiSelectableFlags = 1 << 27 // Disable padding each side with ItemSpacing * 0.5f )
Extend ImGuiSelectableFlags_
type ImGuiSeparatorFlags ¶
type ImGuiSeparatorFlags int // -> enum ImGuiSeparatorFlags_ // Flags: for SeparatorEx()
const ( ImGuiSeparatorFlags_None ImGuiSeparatorFlags = 0 ImGuiSeparatorFlags_Horizontal ImGuiSeparatorFlags = 1 << 0 // Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar ImGuiSeparatorFlags_Vertical ImGuiSeparatorFlags = 1 << 1 ImGuiSeparatorFlags_SpanAllColumns ImGuiSeparatorFlags = 1 << 2 )
type ImGuiSettingsHandler ¶
type ImGuiSettingsHandler struct { TypeName string // Short description stored in .ini file. Disallowed characters: '[' ']' TypeHash ImGuiID ClearAllFn func(ctx *ImGuiContext, handler *ImGuiSettingsHandler) // Clear all settings data ReadInitFn func(ctx *ImGuiContext, handler *ImGuiSettingsHandler) // Read: Called before reading (in registration order) ReadOpenFn func(ctx *ImGuiContext, handler *ImGuiSettingsHandler, name string) any // Read: Called when entering into a new ini entry e.g. "[Window][Name]" ReadLineFn func(ctx *ImGuiContext, handler *ImGuiSettingsHandler, entry any, line string) // Read: Called for every line of text within an ini entry ApplyAllFn func(ctx *ImGuiContext, handler *ImGuiSettingsHandler) // Read: Called after reading (in registration order) WriteAllFn func(ctx *ImGuiContext, handler *ImGuiSettingsHandler, out_buf *ImGuiTextBuffer) // Write: Output every entries into 'out_buf' UserData any }
func FindSettingsHandler ¶
func FindSettingsHandler(name string) *ImGuiSettingsHandler
type ImGuiShrinkWidthItem ¶
type ImGuiShrinkWidthItem struct { Index int Width float }
type ImGuiSizeCallback ¶
type ImGuiSizeCallback func(data *ImGuiSizeCallbackData) // Callback function for ImGui::SetNextWindowSizeConstraints()
type ImGuiSizeCallbackData ¶
type ImGuiSizeCallbackData struct { UserData any // Read-only. What user passed to SetNextWindowSizeConstraints() Pos ImVec2 // Read-only. Window position, for reference. CurrentSize ImVec2 // Read-only. Current window size. DesiredSize ImVec2 // Read-write. Desired size, based on user's mouse position. Write to this field to restrain resizing. }
ImGuiSizeCallbackData Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin(). NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough.
type ImGuiSliderFlags ¶
type ImGuiSliderFlags int // -> enum ImGuiSliderFlags_ // Flags: for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
const ( ImGuiSliderFlags_None ImGuiSliderFlags = 0 ImGuiSliderFlags_AlwaysClamp ImGuiSliderFlags = 1 << 4 // Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds. ImGuiSliderFlags_Logarithmic ImGuiSliderFlags = 1 << 5 // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits. ImGuiSliderFlags_NoRoundToFormat ImGuiSliderFlags = 1 << 6 // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits) ImGuiSliderFlags_NoInput ImGuiSliderFlags = 1 << 7 // Disable CTRL+Click or Enter key allowing to input text directly into the widget ImGuiSliderFlags_InvalidMask_ ImGuiSliderFlags = 0x7000000F // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed. )
Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc. We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them.
const ( ImGuiSliderFlags_Vertical ImGuiSliderFlags = 1 << 20 // Should this slider be orientated vertically? ImGuiSliderFlags_ReadOnly ImGuiSliderFlags = 1 << 21 )
Extend ImGuiSliderFlags_
type ImGuiSortDirection ¶
type ImGuiSortDirection int // -> enum ImGuiSortDirection_ // Enum: A sorting direction (ascending or descending)
const ( ImGuiSortDirection_None ImGuiSortDirection = 0 ImGuiSortDirection_Ascending ImGuiSortDirection = 1 // Ascending = 0->9, A->Z etc. ImGuiSortDirection_Descending ImGuiSortDirection = 2 // Descending = 9->0, Z->A etc. )
A sorting direction
func TableGetColumnAvailSortDirection ¶
func TableGetColumnAvailSortDirection(column *ImGuiTableColumn, n int) ImGuiSortDirection
func TableGetColumnNextSortDirection ¶
func TableGetColumnNextSortDirection(column *ImGuiTableColumn) ImGuiSortDirection
Calculate next sort direction that would be set after clicking the column - If the PreferSortDescending flag is set, we will default to a Descending direction on the first click. - Note that the PreferSortAscending flag is never checked, it is essentially the default and therefore a no-op.
type ImGuiStackSizes ¶
type ImGuiStackSizes struct { SizeOfIDStack short SizeOfColorStack short SizeOfStyleVarStack short SizeOfFontStack short SizeOfFocusScopeStack short SizeOfGroupStack short SizeOfBeginPopupStack short }
func (*ImGuiStackSizes) CompareWithCurrentState ¶
func (s *ImGuiStackSizes) CompareWithCurrentState()
func (*ImGuiStackSizes) SetToCurrentState ¶
func (s *ImGuiStackSizes) SetToCurrentState()
type ImGuiStorage ¶
ImGuiStorage Helper: Key->Value storage Typically you don't have to worry about this since a storage is held within each Window. We use it to e.g. store collapse state for a tree (Int 0/1) This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame) You can use it as custom user storage for temporary values. Declare your own storage if, for example: - You want to manipulate the open/close state of a particular sub-tree in your interface (tree node uses Int 0/1 to store their state). - You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient) Types are NOT stored, so it is up to you to make sure your Key don't collide with different types.
func GetStateStorage ¶
func GetStateStorage() ImGuiStorage
func (*ImGuiStorage) Clear ¶
func (this *ImGuiStorage) Clear()
func (*ImGuiStorage) GetBool ¶
func (this *ImGuiStorage) GetBool(key ImGuiID, default_val bool) bool
func (*ImGuiStorage) GetFloat ¶
func (this *ImGuiStorage) GetFloat(key ImGuiID, default_val float) float
func (*ImGuiStorage) GetInt ¶
func (this *ImGuiStorage) GetInt(key ImGuiID, default_val int) int
func (*ImGuiStorage) GetInterface ¶
func (this *ImGuiStorage) GetInterface(key ImGuiID) any
func (*ImGuiStorage) SetAllInt ¶
func (this *ImGuiStorage) SetAllInt(val int)
SetAllInt Use on your own storage if you know only integer are being stored (open/close all tree nodes)
func (*ImGuiStorage) SetBool ¶
func (this *ImGuiStorage) SetBool(key ImGuiID, val bool)
func (*ImGuiStorage) SetFloat ¶
func (this *ImGuiStorage) SetFloat(key ImGuiID, val float)
func (*ImGuiStorage) SetInt ¶
func (this *ImGuiStorage) SetInt(key ImGuiID, val int)
func (*ImGuiStorage) SetInterface ¶
func (this *ImGuiStorage) SetInterface(key ImGuiID, val any)
type ImGuiStoragePair ¶
type ImGuiStoragePair struct {
// contains filtered or unexported fields
}
ImGuiStoragePair [Internal]
func (*ImGuiStoragePair) SetFloat ¶
func (this *ImGuiStoragePair) SetFloat(key ImGuiID, val float)
func (*ImGuiStoragePair) SetInt ¶
func (this *ImGuiStoragePair) SetInt(key ImGuiID, val int)
type ImGuiStyle ¶
type ImGuiStyle struct { Alpha float // Global alpha applies to everything in Dear ImGui. DisabledAlpha float // Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha. WindowPadding ImVec2 // Padding within a window. WindowRounding float // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended. WindowBorderSize float // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). WindowMinSize ImVec2 // Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints(). WindowTitleAlign ImVec2 // Alignment for title bar text. Defaults to (0.0,0.5) for left-aligned,vertically centered. ChildRounding float // Radius of child window corners rounding. Set to 0.0f to have rectangular windows. ChildBorderSize float // Thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). PopupRounding float // Radius of popup window corners rounding. (Note that tooltip windows use WindowRounding) PopupBorderSize float // Thickness of border around popup/tooltip windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). FramePadding ImVec2 // Padding within a framed rectangle (used by most widgets). FrameRounding float // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets). FrameBorderSize float // Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). ItemSpacing ImVec2 // Horizontal and vertical spacing between widgets/lines. ItemInnerSpacing ImVec2 // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label). IndentSpacing float // Horizontal indentation when e.g. entering a tree node. Generally :: (FontSize + FramePadding.x*2). CellPadding ImVec2 // Padding within a table cell ScrollbarSize float // Width of the vertical scrollbar, Height of the horizontal scrollbar. ScrollbarRounding float // Radius of grab corners for scrollbar. GrabMinSize float // Minimum width/height of a grab box for slider/scrollbar. GrabRounding float // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. TabRounding float // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs. ButtonTextAlign ImVec2 // Alignment of button text when button is larger than text. Defaults to (0.5, 0.5) (centered). SelectableTextAlign ImVec2 // Alignment of selectable text. Defaults to (0.0, 0.0) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line. ColumnsMinSpacing float // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1). LogSliderDeadzone float // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero. TabBorderSize float // Thickness of border around tabs. TabMinWidthForCloseButton float // Minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected. ColorButtonPosition ImGuiDir // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right. DisplayWindowPadding ImVec2 // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows. DisplaySafeAreaPadding ImVec2 // If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly! MouseCursorScale float // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. AntiAliasedLines bool // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList). AntiAliasedLinesUseTex bool // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering. Latched at the beginning of the frame (copied to ImDrawList). AntiAliasedFill bool // Enable anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList). CurveTessellationTol float // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. CircleTessellationMaxError float // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry. TouchExtraPadding ImVec2 // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! WindowMenuButtonPosition ImGuiDir // Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left. Colors [ImGuiCol_COUNT]ImVec4 }
----------------------------------------------------------------------------- [SECTION] ImGuiStyle ----------------------------------------------------------------------------- You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame(). During the frame, use ImGui::PushStyleVar(ImGuiStyleVar_XXXX)/PopStyleVar() to alter the main style values, and ImGui::PushStyleColor(ImGuiCol_XXX)/PopStyleColor() for colors. -----------------------------------------------------------------------------
func GetStyle ¶
func GetStyle() *ImGuiStyle
access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame!
func NewImGuiStyle ¶
func NewImGuiStyle() ImGuiStyle
func (*ImGuiStyle) ScaleAllSizes ¶
func (style *ImGuiStyle) ScaleAllSizes(scale_factor float)
To scale your entire UI (e.g. if you want your app to use High DPI or generally be DPI aware) you may use this helper function. Scaling the fonts is done separately and is up to you. Important: This operation is lossy because we round all sizes to integer. If you need to change your scale multiples, call this over a freshly initialized ImGuiStyle structure rather than scaling multiple times.
type ImGuiStyleMod ¶
type ImGuiStyleMod struct { VarIdx ImGuiStyleVar BackupValue [2]int }
func NewImGuiStyleModFloat ¶
func NewImGuiStyleModFloat(idx ImGuiStyleVar, v float32) ImGuiStyleMod
func NewImGuiStyleModInt ¶
func NewImGuiStyleModInt(idx ImGuiStyleVar, v int) ImGuiStyleMod
func NewImGuiStyleModVec ¶
func NewImGuiStyleModVec(idx ImGuiStyleVar, v ImVec2) ImGuiStyleMod
func (ImGuiStyleMod) Float ¶
func (mod ImGuiStyleMod) Float() float
func (ImGuiStyleMod) Int ¶
func (mod ImGuiStyleMod) Int() int
func (ImGuiStyleMod) Vec2 ¶
func (mod ImGuiStyleMod) Vec2() ImVec2
type ImGuiStyleVar ¶
type ImGuiStyleVar int // -> enum ImGuiStyleVar_ // Enum: A variable identifier for styling
const ( ImGuiStyleVar_Alpha ImGuiStyleVar = iota // float Alpha ImGuiStyleVar_DisabledAlpha // float DisabledAlpha ImGuiStyleVar_WindowPadding // ImVec2 WindowPadding ImGuiStyleVar_WindowRounding // float WindowRounding ImGuiStyleVar_WindowBorderSize // float WindowBorderSize ImGuiStyleVar_WindowMinSize // ImVec2 WindowMinSize ImGuiStyleVar_WindowTitleAlign // ImVec2 WindowTitleAlign ImGuiStyleVar_ChildRounding // float ChildRounding ImGuiStyleVar_ChildBorderSize // float ChildBorderSize ImGuiStyleVar_PopupRounding // float PopupRounding ImGuiStyleVar_PopupBorderSize // float PopupBorderSize ImGuiStyleVar_FramePadding // ImVec2 FramePadding ImGuiStyleVar_FrameRounding // float FrameRounding ImGuiStyleVar_FrameBorderSize // float FrameBorderSize ImGuiStyleVar_ItemSpacing // ImVec2 ItemSpacing ImGuiStyleVar_ItemInnerSpacing // ImVec2 ItemInnerSpacing ImGuiStyleVar_IndentSpacing // float IndentSpacing ImGuiStyleVar_CellPadding // ImVec2 CellPadding ImGuiStyleVar_ScrollbarSize // float ScrollbarSize ImGuiStyleVar_ScrollbarRounding // float ScrollbarRounding ImGuiStyleVar_GrabMinSize // float GrabMinSize ImGuiStyleVar_GrabRounding // float GrabRounding ImGuiStyleVar_TabRounding // float TabRounding ImGuiStyleVar_ButtonTextAlign // ImVec2 ButtonTextAlign ImGuiStyleVar_SelectableTextAlign // ImVec2 SelectableTextAlign ImGuiStyleVar_COUNT )
Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure.
- The const ( During initialization or between frames, feel free to just poke into ImGuiStyle directly.
- Tip: Use your programming IDE navigation facilities on the names in the _second column_ below to find the actual members and their description. In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot. With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
- When changing this enum, you need to update the associated internal table GStyleVarInfo[] accordingly. This is where we link const (
type ImGuiTabBar ¶
type ImGuiTabBar struct { Tabs []ImGuiTabItem Flags ImGuiTabBarFlags ID ImGuiID // Zero for tab-bars used by docking SelectedTabId ImGuiID // Selected tab/window NextSelectedTabId ImGuiID // Next selected tab/window. Will also trigger a scrolling animation VisibleTabId ImGuiID // Can occasionally be != SelectedTabId (e.g. when previewing contents for CTRL+TAB preview) CurrFrameVisible int // PrevFrameVisible int // BarRect ImRect // CurrTabsContentsHeight float // PrevTabsContentsHeight float // Record the height of contents submitted below the tab bar WidthAllTabs float // Actual width of all tabs (locked during layout) WidthAllTabsIdeal float // Ideal width if all tabs were visible and not clipped ScrollingAnim float // ScrollingTarget float // ScrollingTargetDistToVisibility float // ScrollingSpeed float // ScrollingRectMinX float // ScrollingRectMaxX float // ReorderRequestTabId ImGuiID // ReorderRequestOffset int // BeginCount int // WantLayout bool // VisibleTabWasSubmitted bool // Set to true when a new tab item or button has been added to the tab bar during last frame TabsAddedNew bool // Set to true when a new tab item or button has been added to the tab bar during last frame TabsActiveCount int // Number of tabs submitted this frame. LastTabItemIdx int // Index of last BeginTabItem() tab for use by EndTabItem() ItemSpacingY float // FramePadding ImVec2 // style.FramePadding locked at the time of BeginTabBar() BackupCursorPos ImVec2 // TabsNames []string // For non-docking tab bar we re-append names in a contiguous buffer. }
func GetTabBarFromTabBarRef ¶
func GetTabBarFromTabBarRef(ref ImGuiPtrOrIndex) *ImGuiTabBar
func NewImGuiTabBar ¶
func NewImGuiTabBar() ImGuiTabBar
func (ImGuiTabBar) GetTabName ¶
func (this ImGuiTabBar) GetTabName(tab *ImGuiTabItem) string
func (ImGuiTabBar) GetTabOrder ¶
func (this ImGuiTabBar) GetTabOrder(tab *ImGuiTabItem) int
type ImGuiTabBarFlags ¶
type ImGuiTabBarFlags int // -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar()
const ( ImGuiTabBarFlags_None ImGuiTabBarFlags = 0 ImGuiTabBarFlags_Reorderable ImGuiTabBarFlags = 1 << 0 // Allow manually dragging tabs to re-order them + New tabs are appended at the end of list ImGuiTabBarFlags_AutoSelectNewTabs ImGuiTabBarFlags = 1 << 1 // Automatically select new tabs when they appear ImGuiTabBarFlags_TabListPopupButton ImGuiTabBarFlags = 1 << 2 // Disable buttons to open the tab list popup ImGuiTabBarFlags_NoCloseWithMiddleMouseButton ImGuiTabBarFlags = 1 << 3 // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. ImGuiTabBarFlags_NoTabListScrollingButtons ImGuiTabBarFlags = 1 << 4 // Disable scrolling buttons (apply when fitting policy is ImGuiTabBarFlags_FittingPolicyScroll) ImGuiTabBarFlags_NoTooltip ImGuiTabBarFlags = 1 << 5 // Disable tooltips when hovering a tab ImGuiTabBarFlags_FittingPolicyResizeDown ImGuiTabBarFlags = 1 << 6 // Resize tabs when they don't fit ImGuiTabBarFlags_FittingPolicyScroll ImGuiTabBarFlags = 1 << 7 // Add scroll buttons when tabs don't fit ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown )
Flags for ImGui::BeginTabBar()
const ( ImGuiTabBarFlags_DockNode ImGuiTabBarFlags = 1 << 20 // Part of a dock node [we don't use this in the master branch but it facilitate branch syncing to keep this around] ImGuiTabBarFlags_IsFocused ImGuiTabBarFlags = 1 << 21 ImGuiTabBarFlags_SaveSettings ImGuiTabBarFlags = 1 << 22 // FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs )
Extend ImGuiTabBarFlags_
type ImGuiTabBarSection ¶
type ImGuiTabBarSection struct { TabCount int // Number of tabs in this section. Width float // Sum of width of tabs in this section (after shrinking down) Spacing float // Horizontal spacing at the end of the section. }
type ImGuiTabItem ¶
type ImGuiTabItem struct { ID ImGuiID Flags ImGuiTabItemFlags LastFrameVisible int LastFrameSelected int // This allows us to infer an ordered list of the last activated tabs with little maintenance Offset float // Position relative to beginning of tab Width float // Width currently displayed ContentWidth float // Width of label, stored during BeginTabItem() call NameOffset int // When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames BeginOrder int // BeginTabItem() order, used to re-order tabs after toggling ImGuiTabBarFlags_Reorderable IndexDuringLayout int // Index only used during TabBarLayout() WantClose bool // Marked as closed by SetTabItemClosed() }
func NewImGuiTabItem ¶
func NewImGuiTabItem() ImGuiTabItem
func TabBarFindTabByID ¶
func TabBarFindTabByID(tab_bar *ImGuiTabBar, tab_id ImGuiID) *ImGuiTabItem
func TabBarScrollingButtons ¶
func TabBarScrollingButtons(tab_bar *ImGuiTabBar) *ImGuiTabItem
func TabBarTabListPopupButton ¶
func TabBarTabListPopupButton(tab_bar *ImGuiTabBar) *ImGuiTabItem
type ImGuiTabItemFlags ¶
type ImGuiTabItemFlags int // -> enum ImGuiTabItemFlags_ // Flags: for BeginTabItem()
const ( ImGuiTabItemFlags_None ImGuiTabItemFlags = 0 ImGuiTabItemFlags_UnsavedDocument ImGuiTabItemFlags = 1 << 0 // Display a dot next to the title + tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. ImGuiTabItemFlags_SetSelected ImGuiTabItemFlags = 1 << 1 // Trigger flag to programmatically make the tab selected when calling BeginTabItem() ImGuiTabItemFlags_NoCloseWithMiddleMouseButton ImGuiTabItemFlags = 1 << 2 // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. ImGuiTabItemFlags_NoPushId ImGuiTabItemFlags = 1 << 3 // Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem() ImGuiTabItemFlags_NoTooltip ImGuiTabItemFlags = 1 << 4 // Disable tooltip for the given tab ImGuiTabItemFlags_NoReorder ImGuiTabItemFlags = 1 << 5 // Disable reordering this tab or having another tab cross over this tab ImGuiTabItemFlags_Leading ImGuiTabItemFlags = 1 << 6 // Enforce the tab position to the left of the tab bar (after the tab list popup button) ImGuiTabItemFlags_Trailing ImGuiTabItemFlags = 1 << 7 // Enforce the tab position to the right of the tab bar (before the scrolling buttons) )
Flags for ImGui::BeginTabItem()
const ( ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing ImGuiTabItemFlags_NoCloseButton ImGuiTabItemFlags = 1 << 20 // Track whether p_open was set or not (we'll need this info on the next frame to recompute ContentWidth during layout) ImGuiTabItemFlags_Button ImGuiTabItemFlags = 1 << 21 // Used by TabItemButton, change the tab item behavior to mimic a button )
Extend ImGuiTabItemFlags_
type ImGuiTable ¶
type ImGuiTable struct { ID ImGuiID Flags ImGuiTableFlags RawData any // Single allocation to hold Columns[], DisplayOrderToIndex[] and RowCellData[] TempData *ImGuiTableTempData // Transient data while table is active. Point within g.CurrentTableStack[] Columns []ImGuiTableColumn // ImGuiTableColumn Point within RawData[] DisplayOrderToIndex []ImGuiTableColumnIdx // ImGuiTableColumnIdx Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1) RowCellData []ImGuiTableCellData // ImGuiTableCellData Point within RawData[]. Store cells background requests for current row. EnabledMaskByDisplayOrder ImU64 // Column DisplayOrder -> IsEnabled map EnabledMaskByIndex ImU64 // Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data VisibleMaskByIndex ImU64 // Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect) RequestOutputMaskByIndex ImU64 // Column Index -> IsVisible || AutoFit (== expect user to submit items) SettingsLoadedFlags ImGuiTableFlags // Which data were loaded from the .ini file (e.g. when order is not altered we won't save order) SettingsOffset int // Offset in g.SettingsTables LastFrameActive int ColumnsCount int // Number of columns declared in BeginTable() CurrentRow int CurrentColumn int InstanceCurrent ImS16 // Count of BeginTable() calls with same ID in the same frame (generally 0). This is a little bit similar to BeginCount for a window, but multiple table with same ID look are multiple tables, they are just synched. InstanceInteracted ImS16 // Mark which instance (generally 0) of the same ID is being interacted with RowPosY1 float RowPosY2 float RowMinHeight float // Height submitted to TableNextRow() RowTextBaseline float RowIndentOffsetX float RowFlags ImGuiTableRowFlags // Current row flags, see ImGuiTableRowFlags_ LastRowFlags ImGuiTableRowFlags RowBgColorCounter int // Counter for alternating background colors (can be fast-forwarded by e.g clipper), not same as CurrentRow because header rows typically don't increase this. RowBgColor [2]ImU32 // Background color override for current row. BorderColorStrong ImU32 BorderColorLight ImU32 BorderX1 float BorderX2 float HostIndentX float MinColumnWidth float OuterPaddingX float CellPaddingX float // Padding from each borders CellPaddingY float CellSpacingX1 float // Spacing between non-bordered cells CellSpacingX2 float LastOuterHeight float // Outer height from last frame LastFirstRowHeight float // Height of first row from last frame InnerWidth float // User value passed to BeginTable(), see comments at the top of BeginTable() for details. ColumnsGivenWidth float // Sum of current column width ColumnsAutoFitWidth float // Sum of ideal column width in order nothing to be clipped, used for auto-fitting and content width submission in outer window ResizedColumnNextWidth float ResizeLockMinContentsX2 float // Lock minimum contents width while resizing down in order to not create feedback loops. But we allow growing the table. RefScale float // Reference scale to be able to rescale columns on font/dpi changes. OuterRect ImRect // Note: for non-scrolling table, OuterRect.Max.y is often FLT_MAX until EndTable(), unless a height has been specified in BeginTable(). InnerRect ImRect // InnerRect but without decoration. As with OuterRect, for non-scrolling tables, InnerRect.Max.y is WorkRect ImRect InnerClipRect ImRect BgClipRect ImRect // We use this to cpu-clip cell background color fill Bg0ClipRectForDrawCmd ImRect // Actual ImDrawCmd clip rect for BG0/1 channel. This tends to be == OuterWindow->ClipRect at BeginTable() because output in BG0/BG1 is cpu-clipped Bg2ClipRectForDrawCmd ImRect // Actual ImDrawCmd clip rect for BG2 channel. This tends to be a correct, tight-fit, because output to BG2 are done by widgets relying on regular ClipRect. HostClipRect ImRect // This is used to check if we can eventually merge our columns draw calls into the current draw call of the current window. HostBackupInnerClipRect ImRect // Backup of InnerWindow->ClipRect during PushTableBackground()/PopTableBackground() OuterWindow *ImGuiWindow // Parent window for the table InnerWindow *ImGuiWindow // Window holding the table data (== OuterWindow or a child window) ColumnsNames []string // Contiguous buffer holding columns names DrawSplitter *ImDrawListSplitter // Shortcut to TempData->DrawSplitter while in table. Isolate draw commands per columns to avoid switching clip rect constantly SortSpecsSingle ImGuiTableColumnSortSpecs SortSpecsMulti []ImGuiTableColumnSortSpecs // FIXME-OPT: Using a small-vector pattern would be good. SortSpecs ImGuiTableSortSpecs // Public facing sorts specs, this is what we return in TableGetSortSpecs() SortSpecsCount ImGuiTableColumnIdx ColumnsEnabledCount ImGuiTableColumnIdx // Number of enabled columns (<= ColumnsCount) ColumnsEnabledFixedCount ImGuiTableColumnIdx // Number of enabled columns (<= ColumnsCount) DeclColumnsCount ImGuiTableColumnIdx // Count calls to TableSetupColumn() HoveredColumnBody ImGuiTableColumnIdx // Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column! HoveredColumnBorder ImGuiTableColumnIdx // Index of column whose right-border is being hovered (for resizing). AutoFitSingleColumn ImGuiTableColumnIdx // Index of single column requesting auto-fit. ResizedColumn ImGuiTableColumnIdx // Index of column being resized. Reset when InstanceCurrent==0. LastResizedColumn ImGuiTableColumnIdx // Index of column being resized from previous frame. HeldHeaderColumn ImGuiTableColumnIdx // Index of column header being held. ReorderColumn ImGuiTableColumnIdx // Index of column being reordered. (not cleared) ReorderColumnDir ImGuiTableColumnIdx // -1 or +1 LeftMostEnabledColumn ImGuiTableColumnIdx // Index of left-most non-hidden column. RightMostEnabledColumn ImGuiTableColumnIdx // Index of right-most non-hidden column. LeftMostStretchedColumn ImGuiTableColumnIdx // Index of left-most stretched column. RightMostStretchedColumn ImGuiTableColumnIdx // Index of right-most stretched column. ContextPopupColumn ImGuiTableColumnIdx // Column right-clicked on, of -1 if opening context menu from a neutral/empty spot FreezeRowsRequest ImGuiTableColumnIdx // Requested frozen rows count FreezeRowsCount ImGuiTableColumnIdx // Actual frozen row count (== FreezeRowsRequest, or == 0 when no scrolling offset) FreezeColumnsRequest ImGuiTableColumnIdx // Requested frozen columns count FreezeColumnsCount ImGuiTableColumnIdx // Actual frozen columns count (== FreezeColumnsRequest, or == 0 when no scrolling offset) RowCellDataCurrent ImGuiTableColumnIdx // Index of current RowCellData[] entry in current row DummyDrawChannel ImGuiTableDrawChannelIdx // Redirect non-visible columns here. Bg2DrawChannelCurrent ImGuiTableDrawChannelIdx // For Selectable() and other widgets drawing across columns after the freezing line. Index within DrawSplitter.Channels[] Bg2DrawChannelUnfrozen ImGuiTableDrawChannelIdx IsLayoutLocked bool // Set by TableUpdateLayout() which is called when beginning the first row. IsInsideRow bool // Set when inside TableBeginRow()/TableEndRow(). IsInitializing bool IsSortSpecsDirty bool IsUsingHeaders bool // Set when the first row had the ImGuiTableRowFlags_Headers flag. IsContextPopupOpen bool // Set when default context menu is open (also see: ContextPopupColumn, InstanceInteracted). IsSettingsRequestLoad bool IsSettingsDirty bool // Set when table settings have changed and needs to be reported into ImGuiTableSetttings data. IsDefaultDisplayOrder bool // Set when display order is unchanged from default (DisplayOrder contains 0...Count-1) IsResetAllRequest bool IsResetDisplayOrderRequest bool IsUnfrozenRows bool // Set when we got past the frozen row. IsDefaultSizingPolicy bool // Set if user didn't explicitly set a sizing policy in BeginTable() MemoryCompacted bool HostSkipItems bool // Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis }
ImGuiTable FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
func NewImGuiTable ¶
func NewImGuiTable() ImGuiTable
func TableFindByID ¶
func TableFindByID(id ImGuiID) *ImGuiTable
type ImGuiTableBgTarget ¶
type ImGuiTableBgTarget int // -> enum ImGuiTableBgTarget_ // Enum: A color target for TableSetBgColor()
const ( ImGuiTableBgTarget_None ImGuiTableBgTarget = 0 ImGuiTableBgTarget_RowBg0 ImGuiTableBgTarget = 1 // Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used) ImGuiTableBgTarget_RowBg1 ImGuiTableBgTarget = 2 // Set row background color 1 (generally used for selection marking) ImGuiTableBgTarget_CellBg ImGuiTableBgTarget = 3 // Set cell background color (top-most color) )
const ( Background colors are rendering in 3 layers:
- Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set.
- Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set.
- Layer 2: draw with CellBg color if set.
The purpose of the two row/columns layers is to let you decide if a background color changes should override or blend with the existing color. When using ImGuiTableFlags_RowBg on the table, each row has the RowBg0 color automatically set for odd/even rows. If you set the color of RowBg0 target, your color will override the existing RowBg0 color. If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color.
type ImGuiTableCellData ¶
type ImGuiTableCellData struct { BgColor ImU32 // Actual color Column ImGuiTableColumnIdx // Column number }
ImGuiTableCellData Transient cell data stored per row. sizeof() ~ 6
type ImGuiTableColumn ¶
type ImGuiTableColumn struct { Flags ImGuiTableColumnFlags // Flags after some patching (not directly same as provided by user). See ImGuiTableColumnFlags_ WidthGiven float // Final/actual width visible == (MaxX - MinX), locked in TableUpdateLayout(). May be > WidthRequest to honor minimum width, may be < WidthRequest to honor shrinking columns down in tight space. MinX float // Absolute positions MaxX float WidthRequest float // Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout() WidthAuto float // Automatic width StretchWeight float // Master width weight when (Flags & _WidthStretch). Often around ~1.0f initially. InitStretchWeightOrWidth float // Value passed to TableSetupColumn(). For Width it is a content width (_without padding_). ClipRect ImRect // Clipping rectangle for the column UserID ImGuiID // Optional, value passed to TableSetupColumn() WorkMinX float // Contents region min ~(MinX + CellPaddingX + CellSpacingX1) == cursor start position when entering column WorkMaxX float // Contents region max ~(MaxX - CellPaddingX - CellSpacingX2) ItemWidth float // Current item width for the column, preserved across rows ContentMaxXFrozen float // Contents maximum position for frozen rows (apart from headers), from which we can infer content width. TableHeader() automatically softclip itself + report ideal desired size, to avoid creating extraneous draw calls ContentMaxXUnfrozen float ContentMaxXHeadersUsed float // Contents maximum position for headers rows (regardless of freezing). TableHeader() automatically softclip itself + report ideal desired size, to avoid creating extraneous draw calls ContentMaxXHeadersIdeal float NameOffset ImS16 // Offset into parent ColumnsNames[] DisplayOrder ImGuiTableColumnIdx // Index within Table's IndexToDisplayOrder[] (column may be reordered by users) IndexWithinEnabledSet ImGuiTableColumnIdx // Index within enabled/visible set (<= IndexToDisplayOrder) PrevEnabledColumn ImGuiTableColumnIdx // Index of prev enabled/visible column within Columns[], -1 if first enabled/visible column NextEnabledColumn ImGuiTableColumnIdx // Index of next enabled/visible column within Columns[], -1 if last enabled/visible column SortOrder ImGuiTableColumnIdx // Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort DrawChannelCurrent ImGuiTableDrawChannelIdx // Index within DrawSplitter.Channels[] DrawChannelFrozen ImGuiTableDrawChannelIdx // Draw channels for frozen rows (often headers) DrawChannelUnfrozen ImGuiTableDrawChannelIdx // Draw channels for unfrozen rows IsEnabled bool // IsUserEnabled && (Flags & ImGuiTableColumnFlags_Disabled) == 0 IsUserEnabled bool // Is the column not marked Hidden by the user? (unrelated to being off view, e.g. clipped by scrolling). IsUserEnabledNextFrame bool IsVisibleX bool // Is actually in view (e.g. overlapping the host window clipping rectangle, not scrolled). IsVisibleY bool IsRequestOutput bool // Return value for TableSetColumnIndex() / TableNextColumn(): whether we request user to output contents or not. IsSkipItems bool // Do we want item submissions to this column to be completely ignored (no layout will happen). IsPreserveWidthAuto bool AutoFitQueue ImU8 // Queue of 8 values for the next 8 frames to request auto-fit CannotSkipItemsQueue ImU8 // Queue of 8 values for the next 8 frames to disable Clipped/SkipItem SortDirection ImGuiSortDirection //2 //: // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending SortDirectionsAvailCount ImU8 //2 //: // Number of available sort directions (0 to 3) SortDirectionsAvailMask ImU8 //4 //: // Mask of available sort directions (1-bit each) SortDirectionsAvailList ImU8 // Ordered of available sort directions (2-bits each) }
ImGuiTableColumn [Internal] sizeof() ~ 104 We use the terminology "Enabled" to refer to a column that is not Hidden by user/api. We use the terminology "Clipped" to refer to a column that is out of sight because of scrolling/clipping. This is in contrast with some user-facing api such as IsItemVisible() / IsRectVisible() which use "Visible" to mean "not clipped".
func NewImGuiTableColumn ¶
func NewImGuiTableColumn() ImGuiTableColumn
type ImGuiTableColumnFlags ¶
type ImGuiTableColumnFlags int // -> enum ImGuiTableColumnFlags_// Flags: For TableSetupColumn()
const ( // Input configuration flags ImGuiTableColumnFlags_None ImGuiTableColumnFlags = 0 ImGuiTableColumnFlags_Disabled ImGuiTableColumnFlags = 1 << 0 // Overriding/master disable flag: hide column, won't show in context menu (unlike calling TableSetColumnEnabled() which manipulates the user accessible state) ImGuiTableColumnFlags_DefaultHide ImGuiTableColumnFlags = 1 << 1 // Default as a hidden/disabled column. ImGuiTableColumnFlags_DefaultSort ImGuiTableColumnFlags = 1 << 2 // Default as a sorting column. ImGuiTableColumnFlags_WidthStretch ImGuiTableColumnFlags = 1 << 3 // Column will stretch. Preferable with horizontal scrolling disabled (default if table sizing policy is _SizingStretchSame or _SizingStretchProp). ImGuiTableColumnFlags_WidthFixed ImGuiTableColumnFlags = 1 << 4 // Column will not stretch. Preferable with horizontal scrolling enabled (default if table sizing policy is _SizingFixedFit and table is resizable). ImGuiTableColumnFlags_NoResize ImGuiTableColumnFlags = 1 << 5 // Disable manual resizing. ImGuiTableColumnFlags_NoReorder ImGuiTableColumnFlags = 1 << 6 // Disable manual reordering this column, this will also prevent other columns from crossing over this column. ImGuiTableColumnFlags_NoHide ImGuiTableColumnFlags = 1 << 7 // Disable ability to hide/disable this column. ImGuiTableColumnFlags_NoClip ImGuiTableColumnFlags = 1 << 8 // Disable clipping for this column (all NoClip columns will render in a same draw command). ImGuiTableColumnFlags_NoSort ImGuiTableColumnFlags = 1 << 9 // Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table). ImGuiTableColumnFlags_NoSortAscending ImGuiTableColumnFlags = 1 << 10 // Disable ability to sort in the ascending direction. ImGuiTableColumnFlags_NoSortDescending ImGuiTableColumnFlags = 1 << 11 // Disable ability to sort in the descending direction. ImGuiTableColumnFlags_NoHeaderLabel ImGuiTableColumnFlags = 1 << 12 // TableHeadersRow() will not submit label for this column. Convenient for some small columns. Name will still appear in context menu. ImGuiTableColumnFlags_NoHeaderWidth ImGuiTableColumnFlags = 1 << 13 // Disable header text width contribution to automatic column width. ImGuiTableColumnFlags_PreferSortAscending ImGuiTableColumnFlags = 1 << 14 // Make the initial sort direction Ascending when first sorting on this column (default). ImGuiTableColumnFlags_PreferSortDescending ImGuiTableColumnFlags = 1 << 15 // Make the initial sort direction Descending when first sorting on this column. ImGuiTableColumnFlags_IndentEnable ImGuiTableColumnFlags = 1 << 16 // Use current Indent value when entering cell (default for column 0). ImGuiTableColumnFlags_IndentDisable ImGuiTableColumnFlags = 1 << 17 // Ignore current Indent value when entering cell (default for columns > 0). Indentation changes _within_ the cell will still be honored. // Output status flags, read-only via TableGetColumnFlags() ImGuiTableColumnFlags_IsEnabled ImGuiTableColumnFlags = 1 << 24 // Status: is enabled == not hidden by user/api (referred to as "Hide" in _DefaultHide and _NoHide) flags. ImGuiTableColumnFlags_IsVisible ImGuiTableColumnFlags = 1 << 25 // Status: is visible == is enabled AND not clipped by scrolling. ImGuiTableColumnFlags_IsSorted ImGuiTableColumnFlags = 1 << 26 // Status: is currently part of the sort specs ImGuiTableColumnFlags_IsHovered ImGuiTableColumnFlags = 1 << 27 // Status: is hovered by mouse // [Internal] Combinations and masks ImGuiTableColumnFlags_WidthMask_ = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_WidthFixed ImGuiTableColumnFlags_IndentMask_ = ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_IndentDisable ImGuiTableColumnFlags_StatusMask_ = ImGuiTableColumnFlags_IsEnabled | ImGuiTableColumnFlags_IsVisible | ImGuiTableColumnFlags_IsSorted | ImGuiTableColumnFlags_IsHovered ImGuiTableColumnFlags_NoDirectResize_ ImGuiTableColumnFlags = 1 << 30 // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge) )
Flags for ImGui::TableSetupColumn()
func TableGetColumnFlags ¶
func TableGetColumnFlags(column_n int) ImGuiTableColumnFlags
TableGetColumnFlags We allow querying for an extra column in order to poll the IsHovered state of the right-most section return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
type ImGuiTableColumnIdx ¶
type ImGuiTableColumnIdx = ImS8
ImGuiTableColumnIdx Our current column maximum is 64 but we may raise that in the future.
type ImGuiTableColumnSettings ¶
type ImGuiTableColumnSettings struct { WidthOrWeight float UserID ImGuiID Index ImGuiTableColumnIdx DisplayOrder ImGuiTableColumnIdx SortOrder ImGuiTableColumnIdx SortDirection ImU8 IsEnabled ImU8 // "Visible" in ini file IsStretch ImU8 }
ImGuiTableColumnSettings sizeof() ~ 12
func NewImGuiTableColumnSettings ¶
func NewImGuiTableColumnSettings() ImGuiTableColumnSettings
type ImGuiTableColumnSortSpecs ¶
type ImGuiTableColumnSortSpecs struct { ColumnUserID ImGuiID // User id of the column (if specified by a TableSetupColumn() call) ColumnIndex ImS16 // Index of the column SortOrder ImS16 // Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here) SortDirection ImGuiSortDirection // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending (you can use this or SortSign, whichever is more convenient for your sort function) }
ImGuiTableColumnSortSpecs Sorting specification for one column of a table (sizeof == 12 bytes)
func NewImGuiTableColumnSortSpecs ¶
func NewImGuiTableColumnSortSpecs() ImGuiTableColumnSortSpecs
type ImGuiTableDrawChannelIdx ¶
type ImGuiTableDrawChannelIdx = ImU8
type ImGuiTableFlags ¶
type ImGuiTableFlags int // -> enum ImGuiTableFlags_ // Flags: For BeginTable()
const ( // Features ImGuiTableFlags_None ImGuiTableFlags = 0 ImGuiTableFlags_Resizable ImGuiTableFlags = 1 << 0 // Enable resizing columns. ImGuiTableFlags_Reorderable ImGuiTableFlags = 1 << 1 // Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers) ImGuiTableFlags_Hideable ImGuiTableFlags = 1 << 2 // Enable hiding/disabling columns in context menu. ImGuiTableFlags_Sortable ImGuiTableFlags = 1 << 3 // Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see ImGuiTableFlags_SortMulti and ImGuiTableFlags_SortTristate. ImGuiTableFlags_NoSavedSettings ImGuiTableFlags = 1 << 4 // Disable persisting columns order, width and sort settings in the .ini file. ImGuiTableFlags_ContextMenuInBody ImGuiTableFlags = 1 << 5 // Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow(). // Decorations ImGuiTableFlags_RowBg ImGuiTableFlags = 1 << 6 // Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually) ImGuiTableFlags_BordersInnerH ImGuiTableFlags = 1 << 7 // Draw horizontal borders between rows. ImGuiTableFlags_BordersOuterH ImGuiTableFlags = 1 << 8 // Draw horizontal borders at the top and bottom. ImGuiTableFlags_BordersInnerV ImGuiTableFlags = 1 << 9 // Draw vertical borders between columns. ImGuiTableFlags_BordersOuterV ImGuiTableFlags = 1 << 10 // Draw vertical borders on the left and right sides. ImGuiTableFlags_BordersH = ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterH // Draw horizontal borders. ImGuiTableFlags_BordersV = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersOuterV // Draw vertical borders. ImGuiTableFlags_BordersInner = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH // Draw inner borders. ImGuiTableFlags_BordersOuter = ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH // Draw outer borders. ImGuiTableFlags_Borders = ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter // Draw all borders. ImGuiTableFlags_NoBordersInBody ImGuiTableFlags = 1 << 11 // [ALPHA] Disable vertical borders in columns Body (borders will always appears in Headers). -> May move to style ImGuiTableFlags_NoBordersInBodyUntilResize ImGuiTableFlags = 1 << 12 // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers). -> May move to style // Sizing Policy (read above for defaults) ImGuiTableFlags_SizingFixedFit ImGuiTableFlags = 1 << 13 // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width. ImGuiTableFlags_SizingFixedSame ImGuiTableFlags = 2 << 13 // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible. ImGuiTableFlags_SizingStretchProp ImGuiTableFlags = 3 << 13 // Columns default to _WidthStretch with default weights proportional to each columns contents widths. ImGuiTableFlags_SizingStretchSame ImGuiTableFlags = 4 << 13 // Columns default to _WidthStretch with default weights all equal, unless overridden by TableSetupColumn(). // Sizing Extra Options ImGuiTableFlags_NoHostExtendX ImGuiTableFlags = 1 << 16 // Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used. ImGuiTableFlags_NoHostExtendY ImGuiTableFlags = 1 << 17 // Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible. ImGuiTableFlags_NoKeepColumnsVisible ImGuiTableFlags = 1 << 18 // Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable. ImGuiTableFlags_PreciseWidths ImGuiTableFlags = 1 << 19 // Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth. // Clipping ImGuiTableFlags_NoClip ImGuiTableFlags = 1 << 20 // Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze(). // Padding ImGuiTableFlags_PadOuterX ImGuiTableFlags = 1 << 21 // Default if BordersOuterV is on. Enable outer-most padding. Generally desirable if you have headers. ImGuiTableFlags_NoPadOuterX ImGuiTableFlags = 1 << 22 // Default if BordersOuterV is off. Disable outer-most padding. ImGuiTableFlags_NoPadInnerX ImGuiTableFlags = 1 << 23 // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off). // Scrolling ImGuiTableFlags_ScrollX ImGuiTableFlags = 1 << 24 // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX. ImGuiTableFlags_ScrollY ImGuiTableFlags = 1 << 25 // Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. // Sorting ImGuiTableFlags_SortMulti ImGuiTableFlags = 1 << 26 // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1). ImGuiTableFlags_SortTristate ImGuiTableFlags = 1 << 27 // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0). // [Internal] Combinations and masks ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame )
Flags for ImGui::BeginTable() [BETA API] API may evolve slightly! If you use this, please update to the next version when it comes out!
- Important! Sizing policies have complex and subtle side effects, more so than you would expect. Read comments/demos carefully + experiment with live demos to get acquainted with them.
- The DEFAULT sizing policies are:
- Default to ImGuiTableFlags_SizingFixedFit if ScrollX is on, or if host window has ImGuiWindowFlags_AlwaysAutoResize.
- Default to ImGuiTableFlags_SizingStretchSame if ScrollX is off.
- When ScrollX is off:
- Table defaults to ImGuiTableFlags_SizingStretchSame -> all Columns defaults to ImGuiTableColumnFlags_WidthStretch with same weight.
- Columns sizing policy allowed: Stretch (default), Fixed/Auto.
- Fixed Columns will generally obtain their requested width (unless the table cannot fit them all).
- Stretch Columns will share the remaining width.
- Mixed Fixed/Stretch columns is possible but has various side-effects on resizing behaviors. The typical use of mixing sizing policies is: any number of LEADING Fixed columns, followed by one or two TRAILING Stretch columns. (this is because the visible order of columns have subtle but necessary effects on how they react to manual resizing).
- When ScrollX is on:
- Table defaults to ImGuiTableFlags_SizingFixedFit -> all Columns defaults to ImGuiTableColumnFlags_WidthFixed
- Columns sizing policy allowed: Fixed/Auto mostly.
- Fixed Columns can be enlarged as needed. Table will show an horizontal scrollbar if needed.
- When using auto-resizing (non-resizable) fixed columns, querying the content width to use item right-alignment e.g. SetNextItemWidth(-FLT_MIN) doesn't make sense, would create a feedback loop.
- Using Stretch columns OFTEN DOES NOT MAKE SENSE if ScrollX is on, UNLESS you have specified a value for 'inner_width' in BeginTable(). If you specify a value for 'inner_width' then effectively the scrolling space is known and Stretch or mixed Fixed/Stretch columns become meaningful again.
- Read on documentation at the top of imgui_tables.cpp for details.
func TableFixFlags ¶
func TableFixFlags(flags ImGuiTableFlags, outer_window *ImGuiWindow) ImGuiTableFlags
Helper
type ImGuiTableRowFlags ¶
type ImGuiTableRowFlags int // -> enum ImGuiTableRowFlags_ // Flags: For TableNextRow()
const ( ImGuiTableRowFlags_None ImGuiTableRowFlags = 0 ImGuiTableRowFlags_Headers ImGuiTableRowFlags = 1 << 0 // Identify header row (set default background color + width of its contents accounted different for auto column width) )
Flags for ImGui::TableNextRow()
type ImGuiTableSettings ¶
type ImGuiTableSettings struct { ID ImGuiID // Set to 0 to invalidate/delete the setting SaveFlags ImGuiTableFlags // Indicate data we want to save using the Resizable/Reorderable/Sortable/Hideable flags (could be using its own flags..) RefScale float // Reference scale to be able to rescale columns on font/dpi changes. ColumnsCount ImGuiTableColumnIdx ColumnsCountMax ImGuiTableColumnIdx // Maximum number of columns this settings instance can store, we can recycle a settings instance with lower number of columns but not higher WantApply bool // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context) Columns []ImGuiTableColumnSettings }
ImGuiTableSettings This is designed to be stored in a single ImChunkStream (1 header followed by N ImGuiTableColumnSettings, etc.)
func TableGetBoundSettings ¶
func TableGetBoundSettings(table *ImGuiTable) *ImGuiTableSettings
Get settings for a given table, NULL if none
func TableSettingsCreate ¶
func TableSettingsCreate(id ImGuiID, columns_count int) *ImGuiTableSettings
func TableSettingsFindByID ¶
func TableSettingsFindByID(id ImGuiID) *ImGuiTableSettings
Find existing settings
type ImGuiTableSortSpecs ¶
type ImGuiTableSortSpecs struct { Specs []ImGuiTableColumnSortSpecs // Pointer to sort spec array. SpecsCount int // Sort spec count. Most often 1. May be > 1 when ImGuiTableFlags_SortMulti is enabled. May be == 0 when ImGuiTableFlags_SortTristate is enabled. SpecsDirty bool // Set to true when specs have changed since last time! Use this to sort again, then clear the flag. }
ImGuiTableSortSpecs Sorting specifications for a table (often handling sort specs for a single column, occasionally more) Obtained by calling TableGetSortSpecs(). When 'SpecsDirty == true' you can sort your data. It will be true with sorting specs have changed since last call, or the first time. Make sure to set 'SpecsDirty = false' after sorting, else you may wastefully sort your data every frame!
func TableGetSortSpecs ¶
func TableGetSortSpecs() *ImGuiTableSortSpecs
TableGetSortSpecs Tables: Sorting
- Call TableGetSortSpecs() to retrieve latest sort specs for the table. NULL when not sorting.
- When 'SpecsDirty == true' you should sort your data. It will be true when sorting specs have changed since last call, or the first time. Make sure to set 'SpecsDirty/*= g*/,else you may wastefully sort your data every frame!
- Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable().
get latest sort specs for the table (NULL if not sorting).
type ImGuiTableTempData ¶
type ImGuiTableTempData struct { TableIndex int // Index in g.Tables.Buf[] pool LastTimeActive float32 // Last timestamp this structure was used UserOuterSize ImVec2 // outer_size.x passed to BeginTable() DrawSplitter ImDrawListSplitter HostBackupWorkRect ImRect // Backup of InnerWindow->WorkRect at the end of BeginTable() HostBackupParentWorkRect ImRect // Backup of InnerWindow->ParentWorkRect at the end of BeginTable() HostBackupPrevLineSize ImVec2 // Backup of InnerWindow->DC.PrevLineSize at the end of BeginTable() HostBackupCurrLineSize ImVec2 // Backup of InnerWindow->DC.CurrLineSize at the end of BeginTable() HostBackupCursorMaxPos ImVec2 // Backup of InnerWindow->DC.CursorMaxPos at the end of BeginTable() HostBackupColumnsOffset ImVec1 // Backup of OuterWindow->DC.ColumnsOffset at the end of BeginTable() HostBackupItemWidth float32 // Backup of OuterWindow->DC.ItemWidth at the end of BeginTable() HostBackupItemWidthStackSize int // Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable() }
ImGuiTableTempData Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table). - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure. - We also leave out of this structure data that tend to be particularly useful for debugging/metrics.
func NewImGuiTableTempData ¶
func NewImGuiTableTempData() ImGuiTableTempData
type ImGuiTextBuffer ¶
type ImGuiTextBuffer []byte
Helper: Growable text buffer for logging/accumulating text (this could be called 'ImGuiTextBuilder' / 'ImGuiStringBuilder')
type ImGuiTextFilter ¶
Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
func NewImGuiTextFilter ¶
func NewImGuiTextFilter(default_filter string) ImGuiTextFilter
func (*ImGuiTextFilter) Build ¶
func (this *ImGuiTextFilter) Build()
func (*ImGuiTextFilter) Clear ¶
func (this *ImGuiTextFilter) Clear()
func (*ImGuiTextFilter) Draw ¶
func (this *ImGuiTextFilter) Draw(label string, width float) bool
func (*ImGuiTextFilter) IsActive ¶
func (this *ImGuiTextFilter) IsActive() bool
func (*ImGuiTextFilter) PassFilter ¶
func (this *ImGuiTextFilter) PassFilter(text string) bool
Helper calling InputText+Build
type ImGuiTextFlags ¶
type ImGuiTextFlags int // -> enum ImGuiTextFlags_ // Flags: for TextEx()
const ( ImGuiTextFlags_None ImGuiTextFlags = 0 ImGuiTextFlags_NoWidthForLargeClippedText ImGuiTextFlags = 1 << 0 )
type ImGuiTooltipFlags ¶
type ImGuiTooltipFlags int // -> enum ImGuiTooltipFlags_ // Flags: for BeginTooltipEx()
const ( ImGuiTooltipFlags_None ImGuiTooltipFlags = 0 ImGuiTooltipFlags_OverridePreviousTooltip ImGuiTooltipFlags = 1 << 0 // Override will clear/ignore previously submitted tooltip (defaults to append) )
type ImGuiTreeNodeFlags ¶
type ImGuiTreeNodeFlags int // -> enum ImGuiTreeNodeFlags_ // Flags: for TreeNode(), TreeNodeEx(), CollapsingHeader()
const ( ImGuiTreeNodeFlags_None ImGuiTreeNodeFlags = 0 ImGuiTreeNodeFlags_Selected ImGuiTreeNodeFlags = 1 << 0 // Draw as selected ImGuiTreeNodeFlags_Framed ImGuiTreeNodeFlags = 1 << 1 // Draw frame with background (e.g. for CollapsingHeader) ImGuiTreeNodeFlags_AllowItemOverlap ImGuiTreeNodeFlags = 1 << 2 // Hit testing to allow subsequent widgets to overlap this one ImGuiTreeNodeFlags_NoTreePushOnOpen ImGuiTreeNodeFlags = 1 << 3 // Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack ImGuiTreeNodeFlags_NoAutoOpenOnLog ImGuiTreeNodeFlags = 1 << 4 // Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes) ImGuiTreeNodeFlags_DefaultOpen ImGuiTreeNodeFlags = 1 << 5 // Default node to be open ImGuiTreeNodeFlags_OpenOnDoubleClick ImGuiTreeNodeFlags = 1 << 6 // Need double-click to open node ImGuiTreeNodeFlags_OpenOnArrow ImGuiTreeNodeFlags = 1 << 7 // Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open. ImGuiTreeNodeFlags_Leaf ImGuiTreeNodeFlags = 1 << 8 // No collapsing, no arrow (use as a convenience for leaf nodes). ImGuiTreeNodeFlags_Bullet ImGuiTreeNodeFlags = 1 << 9 // Display a bullet instead of arrow ImGuiTreeNodeFlags_FramePadding ImGuiTreeNodeFlags = 1 << 10 // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding(). ImGuiTreeNodeFlags_SpanAvailWidth ImGuiTreeNodeFlags = 1 << 11 // Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line. In the future we may refactor the hit system to be front-to-back, allowing natural overlaps and then this can become the default. ImGuiTreeNodeFlags_SpanFullWidth ImGuiTreeNodeFlags = 1 << 12 // Extend hit box to the left-most and right-most edges (bypass the indented area). //ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14// FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog )
Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()
const (
ImGuiTreeNodeFlags_ClipLabelForTrailingButton ImGuiTreeNodeFlags = 1 << 20
)
Extend ImGuiTreeNodeFlags_
type ImGuiViewport ¶
type ImGuiViewport struct { Flags ImGuiViewportFlags // See ImGuiViewportFlags_ Pos ImVec2 // Main Area: Position of the viewport (Dear ImGui coordinates are the same as OS desktop/native coordinates) Size ImVec2 // Main Area: Size of the viewport. WorkPos ImVec2 // Work Area: Position of the viewport minus task bars, menus bars, status bars (>= Pos) WorkSize ImVec2 // Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size) DrawListsLastFrame [2]int // Last frame number the background (0) and foreground (1) draw lists were used DrawLists [2]*ImDrawList // Convenience background (0) and foreground (1) draw lists. We use them to draw software mouser cursor when io.MouseDrawCursor is set and to draw most debug overlays. DrawDataP ImDrawData DrawDataBuilder ImDrawDataBuilder WorkOffsetMin ImVec2 // Work Area: Offset from Pos to top-left corner of Work Area. Generally (0,0) or (0,+main_menu_bar_height). Work Area is Full Area but without menu-bars/status-bars (so WorkArea always fit inside Pos/Size!) WorkOffsetMax ImVec2 // Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height). BuildWorkOffsetMin ImVec2 // Work Area: Offset being built during current frame. Generally >= 0.0f. BuildWorkOffsetMax ImVec2 // Work Area: Offset being built during current frame. Generally <= 0.0f. }
ImGuiViewport - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows. - In 'docking' branch with multi-viewport enabled, we extend this concept to have multiple active viewports. - In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode. - About Main Area vs Work Area:
- Main Area = entire viewport.
- Work Area = entire viewport minus sections used by main menu bars (for platform windows), or by task bar (for platform monitor).
- Windows are generally trying to stay within the Work Area of their host viewport.
func GetMainViewport ¶
func GetMainViewport() *ImGuiViewport
GetMainViewport Viewports - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows. - In 'docking' branch with multi-viewport enabled, we extend this concept to have multiple active viewports. - In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode.
func (*ImGuiViewport) GetWorkCenter ¶
func (p *ImGuiViewport) GetWorkCenter() ImVec2
type ImGuiViewportFlags ¶
type ImGuiViewportFlags int // -> enum ImGuiViewportFlags_ // Flags: for ImGuiViewport
const ( ImGuiViewportFlags_None ImGuiViewportFlags = 0 ImGuiViewportFlags_IsPlatformWindow ImGuiViewportFlags = 1 << 0 // Represent a Platform Window ImGuiViewportFlags_IsPlatformMonitor ImGuiViewportFlags = 1 << 1 // Represent a Platform Monitor (unused yet) ImGuiViewportFlags_OwnedByApp ImGuiViewportFlags = 1 << 2 // Platform Window: is created/managed by the application (rather than a dear imgui backend) )
Flags stored in ImGuiViewport::Flags, giving indications to the platform backends.
type ImGuiViewportP ¶
type ImGuiViewportP = ImGuiViewport
ImGuiViewportP ImGuiViewport Private/Internals fields (cardinal sin: we are using inheritance!) Every instance of ImGuiViewport is in fact a ImGuiViewportP.
func NewImGuiViewportP ¶
func NewImGuiViewportP() ImGuiViewportP
func (*ImGuiViewportP) CalcWorkRectPos ¶
func (p *ImGuiViewportP) CalcWorkRectPos(off_min *ImVec2) ImVec2
func (*ImGuiViewportP) CalcWorkRectSize ¶
func (p *ImGuiViewportP) CalcWorkRectSize(off_min *ImVec2, off_max *ImVec2) ImVec2
func (*ImGuiViewportP) GetBuildWorkRect ¶
func (p *ImGuiViewportP) GetBuildWorkRect() ImRect
func (*ImGuiViewportP) GetMainRect ¶
func (p *ImGuiViewportP) GetMainRect() ImRect
func (*ImGuiViewportP) GetWorkRect ¶
func (p *ImGuiViewportP) GetWorkRect() ImRect
func (*ImGuiViewportP) UpdateWorkRect ¶
func (p *ImGuiViewportP) UpdateWorkRect()
type ImGuiWindow ¶
type ImGuiWindow struct { Name string // Window name, owned by the window. ID ImGuiID // == ImHashStr(Name) Flags ImGuiWindowFlags // See enum ImGuiWindowFlags_ Pos ImVec2 // Position (always rounded-up to nearest pixel) Size ImVec2 // Current size (==SizeFull or collapsed title bar size) SizeFull ImVec2 // Size when non collapsed ContentSize ImVec2 // Size of contents/scrollable client area (calculated from the extents reach of the cursor) from previous frame. Does not include window decoration or window padding. ContentSizeIdeal ImVec2 ContentSizeExplicit ImVec2 // Size of contents/scrollable client area explicitly request by the user via SetNextWindowContentSize(). WindowPadding ImVec2 // Window padding at the time of begin. WindowRounding float // Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc. WindowBorderSize float // Window border size at the time of begin. MoveId ImGuiID // == window->GetID("#MOVE") ChildId ImGuiID // ID of corresponding item in parent window (for navigation to return from child window to parent window) Scroll ImVec2 // Current scrolling position ScrollMax ImVec2 // Scrollable maximum position ScrollTarget ImVec2 // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change) ScrollTargetCenterRatio ImVec2 // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered ScrollTargetEdgeSnapDist ImVec2 // 0.0f = no snapping, >0.0f snapping threshold ScrollbarSizes ImVec2 // Size taken by each scrollbars on their smaller axis. Pay attention! ScrollbarSizes.x == width of the vertical scrollbar, ScrollbarSizes.y = height of the horizontal scrollbar. ScrollbarX, ScrollbarY bool // Are scrollbars visible? Active bool // Set to true on Begin(), unless Collapsed WasActive bool WriteAccessed bool // Set to true when any widget access the current window Collapsed bool // Set when collapsing window to become only title-bar WantCollapseToggle bool SkipItems bool // Set when items can safely be all clipped (e.g. window not visible or collapsed) Appearing bool // Set during the frame where the window is appearing (or re-appearing) Hidden bool // Do not display (== HiddenFrames*** > 0) IsFallbackWindow bool // Set on the "Debug##Default" window. HasCloseButton bool // Set when the window has a close button (p_open != NULL) ResizeBorderHeld int8 // Current border being held for resize (-1: none, otherwise 0-3) BeginCount short // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs) BeginOrderWithinParent short // Begin() order within immediate parent window, if we are a child window. Otherwise 0. BeginOrderWithinContext short // Begin() order within entire imgui context. This is mostly used for debugging submission order related issues. FocusOrder short // Order within WindowsFocusOrder[], altered when windows are focused. PopupId ImGuiID // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling) AutoFitFramesX, AutoFitFramesY ImS8 AutoFitChildAxises ImS8 AutoFitOnlyGrows bool AutoPosLastDirection ImGuiDir HiddenFramesCanSkipItems ImS8 // Hide the window for N frames HiddenFramesCannotSkipItems ImS8 // Hide the window for N frames while allowing items to be submitted so we can measure their size HiddenFramesForRenderOnly ImS8 // Hide the window until frame N at Render() time only DisableInputsFrames ImS8 // Disable window interactions for N frames SetWindowPosAllowFlags ImGuiCond //8 : // store acceptable condition flags for SetNextWindowPos() use. SetWindowSizeAllowFlags ImGuiCond //8 : // store acceptable condition flags for SetNextWindowSize() use. SetWindowCollapsedAllowFlags ImGuiCond //8: // store acceptable condition flags for SetNextWindowCollapsed() use. SetWindowPosVal ImVec2 // store window position when using a non-zero Pivot (position set needs to be processed when we know the window size) SetWindowPosPivot ImVec2 // store window pivot for positioning. ImVec2(0, 0) when positioning fromcorner top-left ImVec2(0.5f, 0.5f)centering for ImVec2(1, 1) for bottom right. IDStack []ImGuiID // ID stack. ID are hashes seeded with the value at the top of the stack. (In theory this should be in the TempData structure) DC ImGuiWindowTempData // Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name. // The best way to understand what those rectangles are is to use the 'Metrics->Tools->Show Windows Rectangles' viewer. // The main 'OuterRect', omitted as a field, is window->Rect(). OuterRectClipped ImRect // == Window->Rect() just after setup in Begin(). == window->Rect() for root window. InnerRect ImRect // Inner rectangle (omit title bar, menu bar, scroll bar) InnerClipRect ImRect // == InnerRect shrunk by WindowPadding*0.5f on each side, clipped within viewport or parent clip rect. WorkRect ImRect // Initially covers the whole scrolling region. Reduced by containers e.g columns/tables when active. Shrunk by WindowPadding*1.0f on each side. This is meant to replace ContentRegionRect over time (from 1.71+ onward). ParentWorkRect ImRect // Backup of WorkRect before entering a container such as columns/tables. Used by e.g. SpanAllColumns functions to easily access. Stacked containers are responsible for maintaining this. // FIXME-WORKRECT: Could be a stack? ClipRect ImRect // Current clipping/scissoring rectangle, evolve as we are using PushClipRect(), etc. == DrawList->clip_rect_stack.back(). ContentRegionRect ImRect // FIXME: This is currently confusing/misleading. It is essentially WorkRect but not handling of scrolling. We currently rely on it as right/bottom aligned sizing operation need some size to rely on. HitTestHoleSize ImVec2ih // Define an optional rectangular hole where mouse will pass-through the window. HitTestHoleOffset ImVec2ih LastFrameActive int // Last frame number the window was Active. LastTimeActive float // Last timestamp the window was Active (using float as we don't need high precision there) ItemWidthDefault float StateStorage ImGuiStorage ColumnsStorage []ImGuiOldColumns FontWindowScale float // User scale multiplier per-window, via SetWindowFontScale() SettingsOffset int // Offset into SettingsWindows[] (offsets are always valid as we only grow the array from the back) DrawList *ImDrawList // == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer) DrawListInst ImDrawList ParentWindow *ImGuiWindow // If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL. RootWindow *ImGuiWindow // Point to ourself or first ancestor that is not a child window == Top-level window. RootWindowForTitleBarHighlight *ImGuiWindow // Point to ourself or first ancestor which will display TitleBgActive color when this window is active. MemoryDrawListIdxCapacity int // Backup of last idx/vtx count, so when waking up the window we can preallocate and avoid iterative alloc/copy MemoryDrawListVtxCapacity int MemoryCompacted bool // Set when window extraneous data have been garbage collected }
func CreateNewWindow ¶
func CreateNewWindow(name string, flags ImGuiWindowFlags) *ImGuiWindow
func FindWindowByID ¶
func FindWindowByID(id ImGuiID) *ImGuiWindow
func FindWindowByName ¶
func FindWindowByName(e string) *ImGuiWindow
func FindWindowNavFocusable ¶
func FindWindowNavFocusable(i_start, i_stop, dir int) *ImGuiWindow
func GetCurrentWindow ¶
func GetCurrentWindow() *ImGuiWindow
func GetCurrentWindowRead ¶
func GetCurrentWindowRead() *ImGuiWindow
Windows We should always have a CurrentWindow in the stack (there is an implicit "Debug" window) If this ever crash because g.CurrentWindow is NULL it means that either - ImGui::NewFrame() has never been called, which is illegal. - You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
func GetTopMostPopupModal ¶
func GetTopMostPopupModal() *ImGuiWindow
func NavRestoreLastChildNavWindow ¶
func NavRestoreLastChildNavWindow(window *ImGuiWindow) *ImGuiWindow
NavRestoreLastChildNavWindow Restore the last focused child. Call when we are expected to land on the Main Layer (0) after FocusWindow()
func NewImGuiWindow ¶
func NewImGuiWindow(context *ImGuiContext, name string) *ImGuiWindow
func (*ImGuiWindow) CalcFontSize ¶
func (w *ImGuiWindow) CalcFontSize() float
func (*ImGuiWindow) GetIDFromRectangle ¶
func (w *ImGuiWindow) GetIDFromRectangle(r_abs ImRect) ImGuiID
GetIDFromRectangle This is only used in rare/specific situations to manufacture an ID out of nowhere.
func (*ImGuiWindow) GetIDInt ¶
func (w *ImGuiWindow) GetIDInt(n int) ImGuiID
func (*ImGuiWindow) GetIDInterface ¶
func (w *ImGuiWindow) GetIDInterface(ptr any) ImGuiID
func (*ImGuiWindow) GetIDNoKeepAlive ¶
func (w *ImGuiWindow) GetIDNoKeepAlive(str string) ImGuiID
func (*ImGuiWindow) GetIDNoKeepAliveInt ¶
func (w *ImGuiWindow) GetIDNoKeepAliveInt(n int) ImGuiID
func (*ImGuiWindow) GetIDNoKeepAliveInterface ¶
func (w *ImGuiWindow) GetIDNoKeepAliveInterface(ptr any) ImGuiID
func (*ImGuiWindow) GetIDs ¶
func (w *ImGuiWindow) GetIDs(str string) ImGuiID
func (*ImGuiWindow) MenuBarHeight ¶
func (w *ImGuiWindow) MenuBarHeight() float
func (*ImGuiWindow) MenuBarRect ¶
func (w *ImGuiWindow) MenuBarRect() ImRect
func (*ImGuiWindow) Rect ¶
func (w *ImGuiWindow) Rect() ImRect
func (*ImGuiWindow) TitleBarHeight ¶
func (w *ImGuiWindow) TitleBarHeight() float
func (*ImGuiWindow) TitleBarRect ¶
func (w *ImGuiWindow) TitleBarRect() ImRect
type ImGuiWindowFlags ¶
type ImGuiWindowFlags int // -> enum ImGuiWindowFlags_ // Flags: for Begin(), BeginChild()
const ( ImGuiWindowFlags_None ImGuiWindowFlags = 0 ImGuiWindowFlags_NoTitleBar ImGuiWindowFlags = 1 << 0 // Disable title-bar ImGuiWindowFlags_NoResize ImGuiWindowFlags = 1 << 1 // Disable user resizing with the lower-right grip ImGuiWindowFlags_NoMove ImGuiWindowFlags = 1 << 2 // Disable user moving the window ImGuiWindowFlags_NoScrollbar ImGuiWindowFlags = 1 << 3 // Disable scrollbars (window can still scroll with mouse or programmatically) ImGuiWindowFlags_NoScrollWithMouse ImGuiWindowFlags = 1 << 4 // Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set. ImGuiWindowFlags_NoCollapse ImGuiWindowFlags = 1 << 5 // Disable user collapsing window by double-clicking on it ImGuiWindowFlags_AlwaysAutoResize ImGuiWindowFlags = 1 << 6 // Resize every window to its content every frame ImGuiWindowFlags_NoBackground ImGuiWindowFlags = 1 << 7 // Disable drawing background color (WindowBg, etc.) and outside border. Similar as using SetNextWindowBgAlpha(0.0f). ImGuiWindowFlags_NoSavedSettings ImGuiWindowFlags = 1 << 8 // Never load/save settings in .ini file ImGuiWindowFlags_NoMouseInputs ImGuiWindowFlags = 1 << 9 // Disable catching mouse, hovering test with pass through. ImGuiWindowFlags_MenuBar ImGuiWindowFlags = 1 << 10 // Has a menu-bar ImGuiWindowFlags_HorizontalScrollbar ImGuiWindowFlags = 1 << 11 // Allow horizontal scrollbar to appear (off by default). You may use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section. ImGuiWindowFlags_NoFocusOnAppearing ImGuiWindowFlags = 1 << 12 // Disable taking focus when transitioning from hidden to visible state ImGuiWindowFlags_NoBringToFrontOnFocus ImGuiWindowFlags = 1 << 13 // Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus) ImGuiWindowFlags_AlwaysVerticalScrollbar ImGuiWindowFlags = 1 << 14 // Always show vertical scrollbar (even if ContentSize.y < Size.y) ImGuiWindowFlags_AlwaysHorizontalScrollbar ImGuiWindowFlags = 1 << 15 // Always show horizontal scrollbar (even if ContentSize.x < Size.x) ImGuiWindowFlags_AlwaysUseWindowPadding ImGuiWindowFlags = 1 << 16 // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient) ImGuiWindowFlags_UnsavedDocument ImGuiWindowFlags = 1 << 20 // Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. ImGuiWindowFlags_NoDecoration = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus // [Internal] ImGuiWindowFlags_ChildWindow ImGuiWindowFlags = 1 << 24 // Don't use! For internal use by BeginChild() ImGuiWindowFlags_Tooltip ImGuiWindowFlags = 1 << 25 // Don't use! For internal use by BeginTooltip() ImGuiWindowFlags_Popup ImGuiWindowFlags = 1 << 26 // Don't use! For internal use by BeginPopup() ImGuiWindowFlags_Modal ImGuiWindowFlags = 1 << 27 // Don't use! For internal use by BeginPopupModal() ImGuiWindowFlags_ChildMenu ImGuiWindowFlags = 1 << 28 // Don't use! For internal use by BeginMenu() )
Flags for ImGui::Begin()
type ImGuiWindowSettings ¶
type ImGuiWindowSettings struct { ID ImGuiID Pos ImVec2ih Size ImVec2ih Collapsed bool WantApply bool // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context) // contains filtered or unexported fields }
ImGuiWindowSettings Windows data saved in imgui.ini file Because we never destroy or rename ImGuiWindowSettings, we can store the names in a separate buffer easily. (this is designed to be stored in a ImChunkStream buffer, with the variable-length Name following our structure)
func CreateNewWindowSettings ¶
func CreateNewWindowSettings(name string) *ImGuiWindowSettings
func FindOrCreateWindowSettings ¶
func FindOrCreateWindowSettings(name string) *ImGuiWindowSettings
func FindWindowSettings ¶
func FindWindowSettings(id ImGuiID) *ImGuiWindowSettings
func (*ImGuiWindowSettings) GetName ¶
func (s *ImGuiWindowSettings) GetName() string
type ImGuiWindowStackData ¶
type ImGuiWindowStackData struct { Window *ImGuiWindow ParentLastItemDataBackup ImGuiLastItemData }
ImGuiWindowStackData Data saved for each window pushed into the stack
type ImGuiWindowTempData ¶
type ImGuiWindowTempData struct { // Layout CursorPos ImVec2 // Current emitting position, in absolute coordinates. CursorPosPrevLine ImVec2 // Previous line emitting position CursorStartPos ImVec2 // Initial position after Begin(), generally == window->Pos CursorMaxPos ImVec2 // Used to implicitly calculate ContentSize at the beginning of next frame, for auto-resize IdealMaxPos ImVec2 // Implicitly calculate the size of our contents, always extending. Saved/restored as ImVec2(FLT_MAX, FLT_MAX) is we don't fit in those constraints. CurrLineSize ImVec2 // Current line size PrevLineSize ImVec2 // Size of previous line CurrLineTextBaseOffset float32 // Baseline offset from top of line to top of text after rescaling for text height PrevLineTextBaseOffset float32 // Baseline offset from top of line to top of text before rescaling for text height Indent ImVec1 // Indentation / start position from left of window (increased by TreePush/TreePop, etc.) ColumnsOffset ImVec1 // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API. GroupOffset ImVec1 // Offset to the current group (if any) // Keyboard/Gamepad navigation // Miscellaneous MenuBarAppending bool // FIXME: Remove this MenuBarOffset ImVec2 // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs. MenuColumns ImGuiMenuColumns // Simplified columns storage for menu items measurement TreeDepth int // Current tree depth. TreeJumpToParentOnPopMask ImU32 // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31.. Could be turned into a ImU64 if necessary. ChildWindows []*ImGuiWindow StateStorage ImGuiStorage CurrentColumns *ImGuiOldColumns CurrentTableIdx int LayoutType ImGuiLayoutType ParentLayoutType ImGuiLayoutType FocusCounterRegular int FocusCounterTabStop int // Local parameters stacks // We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings. ItemWidth float // Current item width (>0.0: width in pixels, <0.0: align xx pixels to the right of window) TextWrapPos float // Current text wrap position ItemWidthStack []float TextWrapPosStack []float StackSizesOnBegin ImGuiStackSizes }
ImGuiWindowTempData Transient per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the DC variable name in ImGuiWindow. (That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered..) (This doesn't need a constructor because we zero-clear it as part of ImGuiWindow and all frame-temporary data are setup on Begin)
type ImRect ¶
func GetPopupAllowedExtentRect ¶
func GetPopupAllowedExtentRect(*ImGuiWindow) ImRect
GetPopupAllowedExtentRect Note that this is used for popups, which can overlap the non work-area of individual viewports.
func GetResizeBorderRect ¶
func GetResizeBorderRect(window *ImGuiWindow, border_n int, perp_padding, thickness float) ImRect
func GetWindowScrollbarRect ¶
func GetWindowScrollbarRect(window *ImGuiWindow, axis ImGuiAxis) ImRect
Return scrollbar rectangle, must only be called for corresponding axis if window.ScrollbarX/Y is set.
func ImRectFromVec4 ¶
func TableGetCellBgRect ¶
func TableGetCellBgRect(table *ImGuiTable, column_n int) ImRect
Return the cell rectangle based on currently known height.
- Important: we generally don't know our row height until the end of the row, so Max.y will be incorrect in many situations. The only case where this is correct is if we provided a min_row_height to TableNextRow() and don't go below it.
- Important: if ImGuiTableFlags_PadOuterX is set but ImGuiTableFlags_PadInnerX is not set, the outer-most left and right columns report a small offset so their CellBgRect can extend up to the outer border.
func (*ImRect) ClipWithFull ¶
func (*ImRect) ContainsRect ¶
func (*ImRect) ContainsVec ¶
func (*ImRect) IsInverted ¶
func (*ImRect) TranslateX ¶
func (this *ImRect) TranslateX(dx float)
func (*ImRect) TranslateY ¶
func (this *ImRect) TranslateY(dy float)
type ImTextureID ¶
type ImTextureID uintptr // Default: store a pointer or an integer fitting in a pointer (most renderer backends are ok with that)
type ImU32 ¶
type ImU32 = uint // 32-bit uinteger (often used to store packed colors)
func ColorConvertFloat4ToU32 ¶
func GetColorU32FromID ¶
retrieve given style color with style alpha applied and optional extra alpha multiplier, packed as a 32-bit value suitable for ImDrawList
func GetColorU32FromInt ¶
retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
func GetColorU32FromVec ¶
retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
func ImAlphaBlendColors ¶
func TabBarCalcTabID ¶
func TabBarCalcTabID(tab_bar *ImGuiTabBar, label string) ImU32
Dockables uses Name/ID in the global namespace. Non-dockable items use the ID stack.
type ImU64 ¶
type ImU64 = uint64 // 64-bit uinteger (pre and post C++11 with Visual Studio)
func ImFileGetSize ¶
func ImFileGetSize(file ImFileHandle) ImU64
func ImFileRead ¶
func ImFileRead(data []byte, size, count ImU64, file ImFileHandle) ImU64
func ImFileWrite ¶
func ImFileWrite(data []byte, size, count ImU64, file ImFileHandle) ImU64
type ImVec2 ¶
type ImVec2 struct {
// contains filtered or unexported fields
}
func CalcItemSize ¶
[Internal] Calculate full item size given user provided 'size' parameter and default width/height. Default width is often == CalcItemWidth(). Those two functions CalcItemWidth vs CalcItemSize are awkwardly named because they are not fully symmetrical. Note that only CalcItemWidth() is publicly exposed. The 4.0f here may be changed to match CalcItemWidth() and/or BeginChild() (right now we have a mismatch which is harmless but undesirable)
func CalcNextScrollFromScrollTargetAndClamp ¶
func CalcNextScrollFromScrollTargetAndClamp(window *ImGuiWindow) ImVec2
func CalcTextSize ¶
CalcTextSize Text Utilities
func CalcWindowAutoFitSize ¶
func CalcWindowAutoFitSize(window *ImGuiWindow, size_contents *ImVec2) ImVec2
func CalcWindowNextAutoFitSize ¶
func CalcWindowNextAutoFitSize(window *ImGuiWindow) ImVec2
func CalcWindowSizeAfterConstraint ¶
func CalcWindowSizeAfterConstraint(window *ImGuiWindow, size_desired *ImVec2) ImVec2
func FindBestWindowPosForPopup ¶
func FindBestWindowPosForPopup(window *ImGuiWindow) ImVec2
func FindBestWindowPosForPopupEx ¶
func FindBestWindowPosForPopupEx(ref_pos *ImVec2, size *ImVec2, last_dir *ImGuiDir, r_outer *ImRect, r_avoid *ImRect, policy ImGuiPopupPositionPolicy) ImVec2
FindBestWindowPosForPopupEx r_avoid = the rectangle to avoid (e.g. for tooltip it is a rectangle around the mouse cursor which we want to avoid. for popups it's a small point around the cursor.) r_outer = the visible area rectangle, minus safe area padding. If our popup size won't fit because of safe area padding we ignore it. (r_outer is usually equivalent to the viewport rectangle minus padding, but when multi-viewports are enabled and monitor
information are available, it may represent the entire platform monitor from the frame of reference of the current viewport. this allows us to have tooltips/popups displayed out of the parent viewport.)
func GetContentRegionAvail ¶
func GetContentRegionAvail() ImVec2
== GetContentRegionMax() - GetCursorPos()
func GetContentRegionMax ¶
func GetContentRegionMax() ImVec2
current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates FIXME: This is in window space (not screen space!).
func GetContentRegionMaxAbs ¶
func GetContentRegionMaxAbs() ImVec2
[Internal] Absolute coordinate. Saner. This is not exposed until we finishing refactoring work rect features.
func GetCursorPos ¶
func GetCursorPos() ImVec2
cursor position in window coordinates (relative to window position)
func GetCursorScreenPos ¶
func GetCursorScreenPos() ImVec2
cursor position in absolute coordinates (useful to work with ImDrawList API). generally top-left == GetMainViewport()->Pos == (0,0) in single viewport mode, and bottom-right == GetMainViewport()->Pos+Size == io.DisplaySize in single-viewport mode.
func GetCursorStartPos ¶
func GetCursorStartPos() ImVec2
initial cursor position in window coordinates
func GetFontTexUvWhitePixel ¶
func GetFontTexUvWhitePixel() ImVec2
func GetItemRectMax ¶
func GetItemRectMax() ImVec2
GetItemRectMax get lower-right bounding rectangle of the last item (screen space)
func GetItemRectMin ¶
func GetItemRectMin() ImVec2
GetItemRectMin get upper-left bounding rectangle of the last item (screen space)
func GetMouseDragDelta ¶
func GetMouseDragDelta(button ImGuiMouseButton, lock_threshold float) ImVec2
GetMouseDragDelta Return the delta from the initial clicking position while the mouse button is clicked or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once. NB: This is only valid if IsMousePosValid(). backends in theory should always keep mouse position valid when dragging even outside the client window. return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0 until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0, uses io.MouseDraggingThreshold)
func GetMousePos ¶
func GetMousePos() ImVec2
GetMousePos shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
func GetMousePosOnOpeningCurrentPopup ¶
func GetMousePosOnOpeningCurrentPopup() ImVec2
GetMousePosOnOpeningCurrentPopup retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to a user backing that value themselves)
func GetNavInputAmount2d ¶
func GetNavInputAmount2d(dir_sources ImGuiNavDirSourceFlags, mode ImGuiInputReadMode, slow_factor float, fast_factor float) ImVec2
func GetWindowContentRegionMax ¶
func GetWindowContentRegionMax() ImVec2
content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates
func GetWindowContentRegionMin ¶
func GetWindowContentRegionMin() ImVec2
content boundaries min for the full window (roughly (0,0)-Scroll), in window coordinates
func GetWindowPos ¶
func GetWindowPos() ImVec2
get current window position in screen space (useful if you want to do your own drawing via the DrawList API)
func ImBezierCubicCalc ¶
func ImBezierCubicClosestPointCasteljau ¶
ImBezierCubicClosestPointCasteljau tess_tol is generally the same value you would find in ImGui::GetStyle().CurveTessellationTol Because those ImXXX functions are lower-level than ImGui:: we cannot access this value automatically.
func ImBezierQuadraticCalc ¶
func ImClampVec2 ¶
func ImFloorVec ¶
func ImLerpVec2 ¶
func ImLerpVec2WithVec2 ¶
func ImLineClosestPoint ¶
func ImTriangleClosestPoint ¶
func InputTextCalcTextSizeW ¶
func NavCalcPreferredRefPos ¶
func NavCalcPreferredRefPos() ImVec2
func ScrollToBringRectIntoView ¶
func ScrollToBringRectIntoView(window *ImGuiWindow, item_rect *ImRect) ImVec2
func TabItemCalcSize ¶
type ImVec4 ¶
type ImVec4 struct {
// contains filtered or unexported fields
}
ImVec4 4D vector used to store clipping rectangles, colors etc. [Compile-time configurable type]
func ColorConvertU32ToFloat4 ¶
ColorConvertU32ToFloat4 Color Utilities
func GetStyleColorVec4 ¶
retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwise use GetColorU32() to get style color with style alpha baked in.
func ImLerpVec4 ¶
type ImWchar ¶
type ImWchar = rune // ImWchar [configurable type: override in imconfig.h with '#define IMGUI_USE_WCHAR32' to support Unicode planes 1-16]
func FindFirstExistingGlyph ¶
type ImWchar16 ¶
type ImWchar16 = uint16 // A single decoded U16 character/code point. We encode them as multi bytes UTF-8 when used in strings.
ImWchar16 Character types (we generally use UTF-8 encoded string in the API. This is storage specifically for a decoded character used for keyboard input and display)
type ImWchar32 ¶
type ImWchar32 = int // A single decoded U32 character/code point. We encode them as multi bytes UTF-8 when used in strings.
type STB_TEXTEDIT_CHARTYPE ¶
type STB_TEXTEDIT_CHARTYPE = ImWchar
func STB_TEXTEDIT_GETCHAR ¶
func STB_TEXTEDIT_GETCHAR(obj *STB_TEXTEDIT_STRING, idx int) STB_TEXTEDIT_CHARTYPE
func STB_TEXTEDIT_KEYTOTEXT ¶
func STB_TEXTEDIT_KEYTOTEXT(key STB_TEXTEDIT_KEYTYPE) STB_TEXTEDIT_CHARTYPE
type STB_TEXTEDIT_KEYTYPE ¶
type STB_TEXTEDIT_KEYTYPE int
type STB_TEXTEDIT_POSITIONTYPE ¶
type STB_TEXTEDIT_POSITIONTYPE = int
type STB_TEXTEDIT_STRING ¶
type STB_TEXTEDIT_STRING = ImGuiInputTextState
type STB_TexteditState ¶
type STB_TexteditState struct {
// contains filtered or unexported fields
}
type StbFindState ¶
type StbFindState struct {
// contains filtered or unexported fields
}
type StbTexteditRow ¶
type StbTexteditRow struct {
// contains filtered or unexported fields
}
StbTexteditRow ////////////////////////////////////////////////////////////////////// Result of layout query, used by stb_textedit to determine where the text in each row is. result of layout query
type StbUndoRecord ¶
type StbUndoRecord struct {
// contains filtered or unexported fields
}
type StbUndoState ¶
type StbUndoState struct {
// contains filtered or unexported fields
}
Source Files ¶
- atlas.go
- clipboard.go
- color.go
- context.go
- cpp.go
- debug.go
- demo.go
- disabled.go
- dragdrop.go
- drawing.go
- drawlist.go
- drawlist_splitter.go
- enums.go
- font.go
- font_glyphs.go
- fontatlas.go
- frame.go
- funcs.go
- garbage.go
- helpers.go
- id_stack.go
- imstb_textedit.go
- internal.go
- internal_funcs.go
- keyboard.go
- layout.go
- listclipper.go
- logging.go
- math.go
- misc.utillities.go
- mouse.go
- navigation.go
- popups.go
- rendering.go
- rendering.text.go
- scrolling.go
- settings.go
- shading.go
- spacing.go
- storage.go
- style.go
- styles.go
- tables.columns.go
- tables.internal.go
- tables.public.go
- tabs.go
- text.go
- textfilters.go
- tooltips.go
- types.go
- viewports.go
- widgets.behaviour.go
- widgets.button.go
- widgets.checkbox.go
- widgets.colorpicker.go
- widgets.combo.go
- widgets.drag.go
- widgets.go
- widgets.helpers.go
- widgets.image.go
- widgets.input.go
- widgets.input.scalar.go
- widgets.interface.go
- widgets.listbox.go
- widgets.menu.go
- widgets.plotting.go
- widgets.progress.go
- widgets.query.go
- widgets.seperator.go
- widgets.slider.go
- widgets.tabbar.go
- widgets.text.go
- widgets.tree.go
- windows.begin.go
- windows.children.go
- windows.focus.go
- windows.go
- windows.helpers.go
- windows.mut.go
- windows.queries.go
- windows.render.go
- windows.resize.go
- windows.scroll.go