@ -123,7 +123,7 @@ int main(int argc, char** argv)
// Setup Dear ImGui style
ImGui::StyleColorsDark();
//ImGui::StyleColorsClassic();
//ImGui::StyleColorsLight();
// Setup Platform/Renderer backends
// FIXME: Consider reworking this example to install our own GLUT funcs + forward calls ImGui_ImplGLUT_XXX ones, instead of using ImGui_ImplGLUT_InstallFuncs().
g.NavWindowingAccumDeltaSize=ImMax(g.NavWindowingAccumDeltaSize,visibility_rect.Min-window->Pos-window->Size);// We need Pos+Size >= visibility_rect.Min, so Size >= visibility_rect.Min - Pos, so size_delta >= visibility_rect.Min - window->Pos - window->Size
// FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck.
// FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck.
// Important: unlike legacy IsKeyPressed(ImGuiKey, bool repeat=true) which DEFAULT to repeat, this requires EXPLICIT repeat.
// [Internal] 2022/07: Do not call this directly! It is a temporary entry point which we will soon replace with an overload for IsKeyPressed() when we introduce key ownership.
IM_ASSERT(io.NavInputs[n]==0.0f&&"Backend needs to either only use io.AddKeyEvent()/io.AddKeyAnalogEvent(), either only fill legacy io.NavInputs[]. Not both!");
#define NAV_MAP_KEY(_KEY, _NAV_INPUT, _ACTIVATE_NAV) do { io.NavInputs[_NAV_INPUT] = io.KeysData[_KEY - ImGuiKey_KeysData_OFFSET].AnalogValue; if (_ACTIVATE_NAV && io.NavInputs[_NAV_INPUT] > 0.0f) { g.NavInputSource = ImGuiInputSource_Gamepad; } } while (0)
// Single press toggles NavLayer, long press with L/R apply actual focus on release (until then the window was merely rendered top-most)
if(!IsNavInputDown(ImGuiNavInput_Menu))
if(!IsKeyDown(ImGuiKey_NavGamepadMenu))
{
g.NavWindowingToggleLayer&=(g.NavWindowingHighlightAlpha<1.0f);// Once button was held long enough we don't consider it a tap-to-toggle-layer press anymore.
constfloatmove_speed=ImFloor(NAV_MOVE_SPEED*io.DeltaTime*ImMin(io.DisplayFramebufferScale.x,io.DisplayFramebufferScale.y));// FIXME: Doesn't handle variable framerate very well
Text("HoveredId: 0x%08X (%.2f sec), AllowOverlap: %d",g.HoveredIdPreviousFrame,g.HoveredIdTimer,g.HoveredIdAllowOverlap);// Not displaying g.HoveredId as it is update mid-frame
Text("Remap w/ Ctrl+Shift: click anywhere to select new mouse button.");
else
TextColored(GetStyleColorVec4(hovered_id?ImGuiCol_Text:ImGuiCol_TextDisabled),"Click %s Button to break in debugger! (remap w/ Ctrl+Shift)",mouse_button_names[g.DebugItemPickerMouseButton]);
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
typedefintImGuiMouseCursor;// -> enum ImGuiMouseCursor_ // Enum: A mouse cursor identifier
typedefintImGuiSortDirection;// -> enum ImGuiSortDirection_ // Enum: A sorting direction (ascending or descending)
@ -1017,10 +1016,7 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_Popup=1<<26,// Don't use! For internal use by BeginPopup()
ImGuiWindowFlags_Modal=1<<27,// Don't use! For internal use by BeginPopupModal()
ImGuiWindowFlags_ChildMenu=1<<28,// Don't use! For internal use by BeginMenu()
ImGuiWindowFlags_DockNodeHost=1<<29// Don't use! For internal use by Begin()/NewFrame()
// [Obsolete]
//ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // [Obsolete] --> Set io.ConfigWindowsResizeFromEdges=true and make sure mouse cursors are supported by backend (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors)
ImGuiWindowFlags_DockNodeHost=1<<29,// Don't use! For internal use by Begin()/NewFrame()
};
// Flags for ImGui::InputText()
@ -1046,11 +1042,11 @@ enum ImGuiInputTextFlags_
ImGuiInputTextFlags_NoUndoRedo=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_CallbackResize=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=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)
ImGuiInputTextFlags_CallbackEdit=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)
// Obsolete names (will be removed soon)
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
,ImGuiInputTextFlags_AlwaysInsertMode=ImGuiInputTextFlags_AlwaysOverwrite// [renamed in 1.82] name was not matching behavior
ImGuiInputTextFlags_AlwaysInsertMode=ImGuiInputTextFlags_AlwaysOverwrite// [renamed in 1.82] name was not matching behavior
#endif
};
@ -1073,7 +1069,7 @@ enum ImGuiTreeNodeFlags_
ImGuiTreeNodeFlags_SpanFullWidth=1<<12,// Extend hit box to the left-most and right-most edges (bypass the indented area).
ImGuiTreeNodeFlags_NavLeftJumpsBackHere=1<<13,// (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
//ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
ImGuiTableColumnFlags_NoDirectResize_=1<<30// [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge)
ImGuiTableColumnFlags_NoDirectResize_=1<<30,// [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge)
// Obsolete names (will be removed soon)
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
@ -1277,8 +1273,8 @@ enum ImGuiTableColumnFlags_
// Flags for ImGui::TableNextRow()
enumImGuiTableRowFlags_
{
ImGuiTableRowFlags_None=0,
ImGuiTableRowFlags_Headers=1<<0// Identify header row (set default background color + width of its contents accounted differently for auto column width)
ImGuiTableRowFlags_None=0,
ImGuiTableRowFlags_Headers=1<<0,// Identify header row (set default background color + width of its contents accounted differently for auto column width)
};
// Enum for ImGui::TableSetBgColor()
@ -1292,10 +1288,10 @@ enum ImGuiTableRowFlags_
// If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color.
enumImGuiTableBgTarget_
{
ImGuiTableBgTarget_None=0,
ImGuiTableBgTarget_RowBg0=1,// Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
ImGuiTableBgTarget_RowBg1=2,// Set row background color 1 (generally used for selection marking)
ImGuiTableBgTarget_CellBg=3// Set cell background color (top-most color)
ImGuiTableBgTarget_None=0,
ImGuiTableBgTarget_RowBg0=1,// Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
ImGuiTableBgTarget_RowBg1=2,// Set row background color 1 (generally used for selection marking)
ImGuiTableBgTarget_CellBg=3,// Set cell background color (top-most color)
};
// Flags for ImGui::IsWindowFocused()
@ -1307,7 +1303,7 @@ enum ImGuiFocusedFlags_
ImGuiFocusedFlags_AnyWindow=1<<2,// 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_NoPopupHierarchy=1<<3,// Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow)
ImGuiFocusedFlags_DockHierarchy=1<<4,// Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with _ChildWindows or _RootWindow)
// Flags for ImGui::DockSpace(), shared/inherited by child nodes.
@ -1343,7 +1339,7 @@ enum ImGuiDockNodeFlags_
ImGuiDockNodeFlags_PassthruCentralNode=1<<3,// Shared // Enable passthru dockspace: 1) DockSpace() will render a ImGuiCol_WindowBg background covering everything excepted the Central Node when empty. Meaning the host window should probably use SetNextWindowBgAlpha(0.0f) prior to Begin() when using this. 2) When Central Node is empty: let inputs pass-through + won't display a DockingEmptyBg background. See demo for details.
ImGuiDockNodeFlags_NoSplit=1<<4,// Shared/Local // Disable splitting the node into smaller nodes. Useful e.g. when embedding dockspaces into a main root one (the root one may have splitting disabled to reduce confusion). Note: when turned off, existing splits will be preserved.
ImGuiDockNodeFlags_NoResize=1<<5,// Shared/Local // Disable resizing node using the splitter/separators. Useful with programmatically setup dockspaces.
ImGuiDockNodeFlags_AutoHideTabBar=1<<6// Shared/Local // Tab bar will automatically hide when there is a single window in the dock node.
ImGuiDockNodeFlags_AutoHideTabBar=1<<6,// Shared/Local // Tab bar will automatically hide when there is a single window in the dock node.
};
// Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload()
@ -1361,7 +1357,7 @@ enum ImGuiDragDropFlags_
ImGuiDragDropFlags_AcceptBeforeDelivery=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=1<<11,// Do not draw the default highlight rectangle when hovering over target.
ImGuiDragDropFlags_AcceptNoPreviewTooltip=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.
ImGuiDragDropFlags_AcceptPeekOnly=ImGuiDragDropFlags_AcceptBeforeDelivery|ImGuiDragDropFlags_AcceptNoDrawDefaultRect,// For peeking ahead and inspecting the payload before delivery.
};
// Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui.
@ -1459,31 +1455,32 @@ enum ImGuiKey_
ImGuiKey_KeypadEnter,
ImGuiKey_KeypadEqual,
// Gamepad (some of those are analog values, 0.0f to 1.0f) // NAVIGATION action
ImGuiKey_GamepadStart,// Menu (Xbox) + (Switch) Start/Options (PS) // --
ImGuiKey_KeysData_SIZE=ImGuiKey_NamedKey_COUNT,// Size of KeysData[]: only hold named keys
ImGuiKey_KeysData_OFFSET=ImGuiKey_NamedKey_BEGIN// First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
ImGuiKey_KeysData_OFFSET=ImGuiKey_NamedKey_BEGIN,// First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
#else
ImGuiKey_KeysData_SIZE=ImGuiKey_COUNT,// Size of KeysData[]: hold legacy 0..512 keycodes + named keys
ImGuiKey_KeysData_OFFSET=0// First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
ImGuiKey_KeysData_OFFSET=0,// First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
#endif
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
,ImGuiKey_KeyPadEnter=ImGuiKey_KeypadEnter// Renamed in 1.87
ImGuiKey_KeyPadEnter=ImGuiKey_KeypadEnter,// Renamed in 1.87
#endif
};
@ -1523,49 +1520,27 @@ enum ImGuiModFlags_
ImGuiModFlags_Ctrl=1<<0,
ImGuiModFlags_Shift=1<<1,
ImGuiModFlags_Alt=1<<2,// Menu
ImGuiModFlags_Super=1<<3// Cmd/Super/Windows key
};
// Gamepad/Keyboard navigation
// Since >= 1.87 backends you generally don't need to care about this enum since io.NavInputs[] is setup automatically. This might become private/internal some day.
// Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.AddKeyEvent() calls.
// 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.
enumImGuiNavInput_
{
// Gamepad Mapping
ImGuiNavInput_Activate,// Activate / Open / Toggle / Tweak value // e.g. Cross (PS4), A (Xbox), A (Switch), Space (Keyboard)
ImGuiNavInput_Cancel,// Cancel / Close / Exit // e.g. Circle (PS4), B (Xbox), B (Switch), Escape (Keyboard)
ImGuiNavInput_Input,// Text input / On-Screen keyboard // e.g. Triang.(PS4), Y (Xbox), X (Switch), Return (Keyboard)
ImGuiNavInput_Menu,// Tap: Toggle menu / Hold: Focus, Move, Resize // e.g. Square (PS4), X (Xbox), Y (Switch), Alt (Keyboard)
ImGuiNavInput_LStickLeft,// Scroll / Move window (w/ PadMenu) // e.g. Left Analog Stick Left/Right/Up/Down
ImGuiNavInput_LStickRight,//
ImGuiNavInput_LStickUp,//
ImGuiNavInput_LStickDown,//
ImGuiNavInput_FocusPrev,// Focus Next window (w/ PadMenu) // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch)
ImGuiNavInput_FocusNext,// Focus Prev window (w/ PadMenu) // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch)
ImGuiNavInput_TweakSlow,// Slower tweaks // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch)
ImGuiNavInput_TweakFast,// Faster tweaks // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch)
// [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 keyboard keys instead of io.NavInputs[].
ImGuiNavInput_KeyLeft_,// Move left // = Arrow keys
ImGuiNavInput_KeyRight_,// Move right
ImGuiNavInput_KeyUp_,// Move up
ImGuiNavInput_KeyDown_,// Move down
ImGuiNavInput_COUNT
ImGuiModFlags_Super=1<<3,// Cmd/Super/Windows key
};
#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
// OBSOLETED in 1.88 (from July 2022): ImGuiNavInput and io.NavInputs[].
// Official backends between 1.60 and 1.86: will keep working and feed gamepad inputs as long as IMGUI_DISABLE_OBSOLETE_KEYIO is not set.
// Custom backends: feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
// Configuration flags stored in io.ConfigFlags. Set by user/application.
enumImGuiConfigFlags_
{
ImGuiConfigFlags_None=0,
ImGuiConfigFlags_NavEnableKeyboard=1<<0,// Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.AddKeyEvent() calls
ImGuiConfigFlags_NavEnableGamepad=1<<1,// Master gamepad navigation enable flag. This is mostly to instruct your imgui backend to fill io.NavInputs[]. Backend also needs to set ImGuiBackendFlags_HasGamepad.
ImGuiConfigFlags_NavEnableGamepad=1<<1,// Master gamepad navigation enable flag. Backend also needs to set ImGuiBackendFlags_HasGamepad.
ImGuiConfigFlags_NavEnableSetMousePos=1<<2,// Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your backend, otherwise ImGui will react as if the mouse is jumping around back and forth.
ImGuiConfigFlags_NavNoCaptureKeyboard=1<<3,// Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set.
ImGuiConfigFlags_NoMouse=1<<4,// Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the backend.
@ -1582,7 +1557,7 @@ enum ImGuiConfigFlags_
// 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.
ImGuiConfigFlags_IsTouchScreen=1<<21,// Application is using a touch screen instead of a mouse.
};
// Backend capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom backend.
ImGuiBackendFlags_HasMouseHoveredViewport=1<<11,// Backend Platform supports calling io.AddMouseViewportEvent() with the viewport under the mouse. IF POSSIBLE, ignore viewports with the ImGuiViewportFlags_NoInputs flag (Win32 backend, GLFW 3.30+ backend can do this, SDL backend cannot). If this cannot be done, Dear ImGui needs to use a flawed heuristic to find the viewport under.
ImGuiSliderFlags_Logarithmic=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=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=1<<7,// Disable CTRL+Click or Enter key allowing to input text directly into the widget
ImGuiSliderFlags_InvalidMask_=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.
ImGuiSliderFlags_InvalidMask_=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.
// Obsolete names (will be removed)
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
,ImGuiSliderFlags_ClampOnInput=ImGuiSliderFlags_AlwaysClamp// [renamed in 1.79]
ImGuiSliderFlags_ClampOnInput=ImGuiSliderFlags_AlwaysClamp,// [renamed in 1.79]
#endif
};
@ -1809,7 +1784,7 @@ enum ImGuiCond_
ImGuiCond_Always=1<<0,// No condition (always set the variable)
ImGuiCond_Once=1<<1,// Set the variable once per runtime session (only the first call will succeed)
ImGuiCond_FirstUseEver=1<<2,// Set the variable if the object/window has no persistently saved data (no entry in .ini file)
ImGuiCond_Appearing=1<<3// Set the variable if the object/window is appearing after being hidden/inactive (or the first time)
ImGuiCond_Appearing=1<<3,// Set the variable if the object/window is appearing after being hidden/inactive (or the first time)
boolWantSaveIniSettings;// 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!
boolNavActive;// Keyboard/Gamepad navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
boolNavVisible;// Keyboard/Gamepad navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
floatFramerate;// Rough estimate of application framerate, in frame per second. Solely for convenience. Rolling average estimation based on io.DeltaTime over 120 frames.
floatFramerate;// Estimate of application framerate (rolling average over 60 frames, based on io.DeltaTime), in frame per second. Solely for convenience. Slow applications may not want to use a moving average or may want to reset underlying buffers occasionally.
intMetricsRenderVertices;// Vertices output during last call to Render()
intMetricsRenderIndices;// Indices output during last call to Render() = number of triangles * 3
intMetricsRenderWindows;// Number of visible windows
@ -2103,6 +2078,7 @@ struct ImGuiIO
#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
intKeyMap[ImGuiKey_COUNT];// [LEGACY] Input: map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. The first 512 are now unused and should be kept zero. Legacy backend will write into KeyMap[] using ImGuiKey_ indices which are always >512.
boolKeysDown[ImGuiKey_COUNT];// [LEGACY] Input: 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). This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow.
floatNavInputs[ImGuiNavInput_COUNT];// [LEGACY] Since 1.88, NavInputs[] was removed. Backends from 1.60 to 1.86 won't build. Feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
floatNavInputs[ImGuiNavInput_COUNT];// Gamepad inputs. Cleared back to zero by EndFrame(). Keyboard keys will be auto-mapped and be written here by NewFrame().
// Other state maintained from data above + IO function calls
ImGuiModFlagsKeyMods;// Key mods flags (same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags), updated by NewFrame()
@ -2141,8 +2116,6 @@ struct ImGuiIO
floatMouseDownDurationPrev[5];// Previous time the mouse button has been down
ImVec2MouseDragMaxDistanceAbs[5];// Maximum distance, absolute, on each axis, of how much mouse has traveled from the clicking point
floatMouseDragMaxDistanceSqr[5];// Squared maximum distance of how much mouse has traveled from the clicking point (used for moving thresholds)
// Flags for ImDrawList instance. Those are set automatically by ImGui:: functions from ImGuiIO settings, and generally not manipulated directly.
@ -2605,7 +2578,7 @@ enum ImDrawListFlags_
ImDrawListFlags_AntiAliasedLines=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=1<<1,// Enable anti-aliased lines/borders using textures when possible. Require backend to render with bilinear filtering (NOT point/nearest filtering).
ImDrawListFlags_AntiAliasedFill=1<<2,// Enable anti-aliased edge around filled shapes (rounded rectangles, circles).
ImDrawListFlags_AllowVtxOffset=1<<3// Can emit 'VtxOffset > 0' to allow large meshes. Set when 'ImGuiBackendFlags_RendererHasVtxOffset' is enabled.
ImDrawListFlags_AllowVtxOffset=1<<3,// Can emit 'VtxOffset > 0' to allow large meshes. Set when 'ImGuiBackendFlags_RendererHasVtxOffset' is enabled.
};
// Draw command list
@ -2842,7 +2815,7 @@ enum ImFontAtlasFlags_
ImFontAtlasFlags_None=0,
ImFontAtlasFlags_NoPowerOfTwoHeight=1<<0,// Don't round the height to next power of two
ImFontAtlasFlags_NoMouseCursors=1<<1,// Don't build software mouse cursors into the atlas (save a little texture memory)
ImFontAtlasFlags_NoBakedLines=1<<2// Don't build thick line textures into the atlas (save a little texture memory, allow support for point/nearest filtering). The AntiAliasedLinesUseTex features uses them, otherwise they will be rendered using polygons (more expensive for CPU/GPU).
ImFontAtlasFlags_NoBakedLines=1<<2,// Don't build thick line textures into the atlas (save a little texture memory, allow support for point/nearest filtering). The AntiAliasedLinesUseTex features uses them, otherwise they will be rendered using polygons (more expensive for CPU/GPU).
};
// Load and rasterize multiple TTF/OTF fonts into a same texture. The font atlas will build a single texture holding:
@ -3034,7 +3007,7 @@ enum ImGuiViewportFlags_
ImGuiViewportFlags_TopMost=1<<9,// Platform Window: Display on top (for tooltips only).
ImGuiViewportFlags_Minimized=1<<10,// Platform Window: Window is minimized, can skip render. When minimized we tend to avoid using the viewport pos/size for clipping window or testing if they are contained in the viewport.
ImGuiViewportFlags_NoAutoMerge=1<<11,// Platform Window: Avoid merging this window into another host window. This can only be set via ImGuiWindowClass viewport flags override (because we need to now ahead if we are going to create a viewport in the first place!).
ImGuiViewportFlags_CanHostOtherWindows=1<<12// Main viewport: can host multiple imgui windows (secondary viewports are associated to a single window).
ImGuiViewportFlags_CanHostOtherWindows=1<<12,// Main viewport: can host multiple imgui windows (secondary viewports are associated to a single window).
};
// - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
ImGui::Text("Chars queue:");for(inti=0;i<io.InputQueueCharacters.Size;i++){ImWcharc=io.InputQueueCharacters[i];ImGui::SameLine();ImGui::Text("\'%c\' (0x%04X)",(c>''&&c<=255)?(char)c:'?',c);}// FIXME: We should convert 'c' to UTF-8 here but the functions are not public.
@ -153,11 +153,11 @@ typedef int ImGuiDataAuthority; // -> enum ImGuiDataAuthority_ // E
typedefintImGuiLayoutType;// -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical
typedefintImGuiActivateFlags;// -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later)
typedefintImGuiDebugLogFlags;// -> enum ImGuiDebugLogFlags_ // Flags: for ShowDebugLogWindow(), g.DebugLogFlags
typedefintImGuiInputReadFlags;// -> enum ImGuiInputReadFlags_ // Flags: for IsKeyPressedEx()
typedefintImGuiItemFlags;// -> enum ImGuiItemFlags_ // Flags: for PushItemFlag()
typedefintImGuiItemStatusFlags;// -> enum ImGuiItemStatusFlags_ // Flags: for DC.LastItemStatusFlags
typedefintImGuiOldColumnFlags;// -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns()
typedefintImGuiNavHighlightFlags;// -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
typedefintImGuiNavDirSourceFlags;// -> enum ImGuiNavDirSourceFlags_ // Flags: for GetNavInputAmount2d()
typedefintImGuiNavMoveFlags;// -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests
typedefintImGuiNextItemDataFlags;// -> enum ImGuiNextItemDataFlags_ // Flags: for SetNextItemXXX() functions
typedefintImGuiNextWindowDataFlags;// -> enum ImGuiNextWindowDataFlags_// Flags: for SetNextWindowXXX() functions
@ -779,7 +779,7 @@ enum ImGuiItemFlags_
ImGuiItemFlags_ReadOnly=1<<7,// false // [ALPHA] Allow hovering interactions but underlying value is not changed.
// Controlled by widget code
ImGuiItemFlags_Inputable=1<<8// false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
ImGuiItemFlags_Inputable=1<<8,// false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
};
// Storage for LastItem data
@ -794,14 +794,13 @@ enum ImGuiItemStatusFlags_
ImGuiItemStatusFlags_HasDeactivated=1<<5,// Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag.
ImGuiItemStatusFlags_Deactivated=1<<6,// Only valid if ImGuiItemStatusFlags_HasDeactivated is set.
ImGuiItemStatusFlags_HoveredWindow=1<<7,// Override the HoveredWindow test to allow cross-window hover testing.
ImGuiItemStatusFlags_FocusedByTabbing=1<<8// Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon)
ImGuiItemStatusFlags_FocusedByTabbing=1<<8,// Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon)
#ifdef IMGUI_ENABLE_TEST_ENGINE
,// [imgui_tests only]
ImGuiItemStatusFlags_Openable=1<<20,// Item is an openable (e.g. TreeNode)
ImGuiItemStatusFlags_Opened=1<<21,//
ImGuiItemStatusFlags_Checkable=1<<22,// Item is a checkable (e.g. CheckBox, MenuItem)
ImGuiSelectableFlags_SpanAvailWidth=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=1<<25,// Always show active when held, even is not hovered. This concept could probably be renamed/formalized somehow.
ImGuiSelectableFlags_SetNavIdOnHover=1<<26,// Set Nav/Focus ID on mouse hover (used by MenuItem)
ImGuiSelectableFlags_NoPadWithHalfSpacing=1<<27// Disable padding each side with ItemSpacing * 0.5f
ImGuiSelectableFlags_NoPadWithHalfSpacing=1<<27,// Disable padding each side with ItemSpacing * 0.5f
// FIXME-NAV: Clarify/expose various repeat delay/rate
enumImGuiNavReadMode
// Flags for IsKeyPressedEx(). In upcoming feature this will be used more (and IsKeyPressedEx() renamed)
// Don't mistake with ImGuiInputTextFlags! (for ImGui::InputText() function)
enumImGuiInputReadFlags_
{
ImGuiNavReadMode_Down,
ImGuiNavReadMode_Pressed,
ImGuiNavReadMode_Released,
ImGuiNavReadMode_Repeat,
ImGuiNavReadMode_RepeatSlow,
ImGuiNavReadMode_RepeatFast
// Flags for IsKeyPressedEx()
ImGuiInputReadFlags_None=0,
ImGuiInputReadFlags_Repeat=1<<0,// Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1.
ImGuiActivateFlags_PreferInput=1<<0,// Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default if keyboard is available.
ImGuiActivateFlags_PreferTweak=1<<1,// Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default if keyboard is not available.
ImGuiActivateFlags_TryToPreserveState=1<<2// Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection)
ImGuiActivateFlags_TryToPreserveState=1<<2,// Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection)
};
// Early work-in-progress API for ScrollToItem()
@ -1314,7 +1328,7 @@ enum ImGuiScrollFlags_
ImGuiScrollFlags_AlwaysCenterY=1<<5,// Always center the result item on Y axis [default for Y axis for appearing window)
ImGuiScrollFlags_NoScrollParent=1<<6,// Disable forwarding scrolling to parent window if required to keep item/rect visible (only scroll window the function was applied to).
ImGuiNavHighlightFlags_AlwaysDraw=1<<2,// Draw rectangular highlight if (g.NavId == id) _even_ when using the mouse.
ImGuiNavHighlightFlags_NoRounding=1<<3
};
enumImGuiNavDirSourceFlags_
{
ImGuiNavDirSourceFlags_None=0,
ImGuiNavDirSourceFlags_RawKeyboard=1<<0,// Raw keyboard (not pulled from nav), facilitate use of some functions before we can unify nav and keys
ImGuiNavDirSourceFlags_Keyboard=1<<1,
ImGuiNavDirSourceFlags_PadDPad=1<<2,
ImGuiNavDirSourceFlags_PadLStick=1<<3
ImGuiNavHighlightFlags_NoRounding=1<<3,
};
enumImGuiNavMoveFlags_
@ -1350,13 +1355,13 @@ enum ImGuiNavMoveFlags_
ImGuiNavMoveFlags_FocusApi=1<<9,
ImGuiNavMoveFlags_Tabbing=1<<10,// == Focus + Activate if item is Inputable + DontChangeNavHighlight
ImGuiNavMoveFlags_Activate=1<<11,
ImGuiNavMoveFlags_DontSetNavHighlight=1<<12// Do not alter the visible state of keyboard vs mouse nav highlight
ImGuiNavMoveFlags_DontSetNavHighlight=1<<12,// Do not alter the visible state of keyboard vs mouse nav highlight
};
enumImGuiNavLayer
{
ImGuiNavLayer_Main=0,// Main scrolling layer
ImGuiNavLayer_Menu=1,// Menu layer (access with Alt/ImGuiNavInput_Menu)
ImGuiNavLayer_Menu=1,// Menu layer (access with Alt)
ImGuiNavLayer_COUNT
};
@ -1387,24 +1392,24 @@ enum ImGuiOldColumnFlags_
ImGuiOldColumnFlags_NoResize=1<<1,// Disable resizing columns when clicking on the dividers
ImGuiOldColumnFlags_NoPreserveWidths=1<<2,// Disable column width preservation when adjusting columns
ImGuiOldColumnFlags_NoForceWithinWindow=1<<3,// Disable forcing columns to fit within window
ImGuiOldColumnFlags_GrowParentContentsSize=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.
ImGuiOldColumnFlags_GrowParentContentsSize=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.
ImGuiDebugLogFlags_OutputToTTY=1<<10// Also send output to TTY
ImGuiDebugLogFlags_OutputToTTY=1<<10,// Also send output to TTY
};
structImGuiMetricsConfig
@ -1829,11 +1834,13 @@ struct ImGuiContext
// Input Ownership
boolActiveIdUsingMouseWheel;// Active widget will want to read mouse wheel. Blocks scrolling the underlying window.
ImU32ActiveIdUsingNavDirMask;// Active widget will want to read those nav move requests (e.g. can activate a button and move away from it)
ImU32ActiveIdUsingNavInputMask;// Active widget will want to read those nav inputs.
ImBitArrayForNamedKeysActiveIdUsingKeyInputMask;// 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.
#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
ImU32ActiveIdUsingNavInputMask;// If you used this. Since (IMGUI_VERSION_NUM >= 18804) : 'g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel);' becomes 'SetActiveIdUsingKey(ImGuiKey_Escape); SetActiveIdUsingKey(ImGuiKey_NavGamepadCancel);'
ImGuiIDNavActivateInputId;// ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0; ImGuiActivateFlags_PreferInput will be set and NavActivateId will be 0.
ImGuiIDNavActivateId;// ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem()
ImGuiIDNavActivateInputId;// ~~ IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadInput) ? NavId : 0; ImGuiActivateFlags_PreferInput will be set and NavActivateId will be 0.
ImGuiActivateFlagsNavActivateFlags;
ImGuiIDNavJustMovedToId;// Just navigated to this id (result of a successfully MoveRequest).
ImGuiIDNavJustMovedToFocusScopeId;// Just navigated to this focus scope id (result of a successfully MoveRequest).
@ -1912,6 +1919,8 @@ struct ImGuiContext
floatNavWindowingTimer;
floatNavWindowingHighlightAlpha;
boolNavWindowingToggleLayer;
ImVec2NavWindowingAccumDeltaPos;
ImVec2NavWindowingAccumDeltaSize;
// Render
floatDimBgRatio;// 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list)
@ -2016,12 +2025,13 @@ struct ImGuiContext
ImGuiDebugLogFlagsDebugLogFlags;
ImGuiTextBufferDebugLogBuf;
boolDebugItemPickerActive;// Item picker is active (started with DebugStartItemPicker())
ImU8DebugItemPickerMouseButton;
ImGuiIDDebugItemPickerBreakId;// Will call IM_DEBUG_BREAK() when encountering this ID
ImGuiMetricsConfigDebugMetricsConfig;
ImGuiStackToolDebugStackTool;
// Misc
floatFramerateSecPerFrame[120];// Calculate estimate of framerate for user over the last 2 seconds.
floatFramerateSecPerFrame[60];// Calculate estimate of framerate for user over the last 60 frames..
ImGuiTabBarFlags_DockNode=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=1<<21,
ImGuiTabBarFlags_SaveSettings=1<<22// FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
ImGuiTabBarFlags_SaveSettings=1<<22,// FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
ImGuiTabItemFlags_NoCloseButton=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=1<<21,// Used by TabItemButton, change the tab item behavior to mimic a button
ImGuiTabItemFlags_Unsorted=1<<22,// [Docking] Trailing tabs with the _Unsorted flag will be sorted based on the DockOrder of their Window.
ImGuiTabItemFlags_Preview=1<<23// [Docking] Display tab shape for docking preview (height is adjusted slightly to compensate for the yet missing tab bar)
ImGuiTabItemFlags_Preview=1<<23,// [Docking] Display tab shape for docking preview (height is adjusted slightly to compensate for the yet missing tab bar)
};
// Storage for one active tab item (sizeof() 48 bytes)
IMGUI_APIvoidActivateItem(ImGuiIDid);// 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.
inlineImGuiInputTextState*GetInputTextState(ImGuiIDid){ImGuiContext&g=*GImGui;return(g.InputTextState.ID==id)?&g.InputTextState:NULL;}// Get input text state if active
inlineImGuiInputTextState*GetInputTextState(ImGuiIDid){ImGuiContext&g=*GImGui;return(id!=0&&g.InputTextState.ID==id)?&g.InputTextState:NULL;}// Get input text state if active
// Read imgui.cpp "API BREAKING CHANGES" section for 1.78 if you hit this assert.
IM_ASSERT((flags==1||(flags&ImGuiSliderFlags_InvalidMask_)==0)&&"Invalid ImGuiSliderFlags flag! Has the 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead.");
// Those are the things we can do easily outside the SliderBehaviorT<> template, saves code generation.
// We allow validate/cancel with Nav source (gamepad) to makes it easier to undo an accidental NavInput press with no keyboard wired, but otherwise it isn't very useful.