Merge branch 'master' into docking. Remove Platform_SetImeInputPos. Remove backend-side IME implementation. Rrevert removal of MouseDragMaxDistanceAbs in 206b9ea. (#2589, #3113)
// If mouse moved we re-enable mouse hovering in case it was disabled by gamepad/keyboard. In theory should use a >0.0f threshold but would need to reset in everywhere we set this to true.
// If mouse moved we re-enable mouse hovering in case it was disabled by gamepad/keyboard. In theory should use a >0.0f threshold but would need to reset in everywhere we set this to true.
// We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position.
boolImGui::IsMousePosValid(constImVec2*mouse_pos)
{
// The assert is only to silence a false-positive in XCode Static Analysis.
// Because GImGui is not dereferenced in every code path, the static analyzer assume that it may be NULL (which it doesn't for other functions).
IM_ASSERT(GImGui!=NULL);
constfloatMOUSE_INVALID=-256000.0f;
ImVec2p=mouse_pos?*mouse_pos:GImGui->IO.MousePos;
returnp.x>=MOUSE_INVALID&&p.y>=MOUSE_INVALID;
}
boolImGui::IsAnyMouseDown()
{
ImGuiContext&g=*GImGui;
for(intn=0;n<IM_ARRAYSIZE(g.IO.MouseDown);n++)
if(g.IO.MouseDown[n])
returntrue;
returnfalse;
}
// 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.
// We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position.
boolImGui::IsMousePosValid(constImVec2*mouse_pos)
{
// The assert is only to silence a false-positive in XCode Static Analysis.
// Because GImGui is not dereferenced in every code path, the static analyzer assume that it may be NULL (which it doesn't for other functions).
IM_ASSERT(GImGui!=NULL);
constfloatMOUSE_INVALID=-256000.0f;
ImVec2p=mouse_pos?*mouse_pos:GImGui->IO.MousePos;
returnp.x>=MOUSE_INVALID&&p.y>=MOUSE_INVALID;
}
boolImGui::IsAnyMouseDown()
{
ImGuiContext&g=*GImGui;
for(intn=0;n<IM_ARRAYSIZE(g.IO.MouseDown);n++)
if(g.IO.MouseDown[n])
returntrue;
returnfalse;
}
// 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.
// (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)
// (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)
@ -159,6 +159,7 @@ struct ImGuiOnceUponAFrame; // Helper for running a block of code not mo
structImGuiPayload;// User data payload for drag and drop operations
structImGuiPayload;// User data payload for drag and drop operations
structImGuiPlatformIO;// Multi-viewport support: interface for Platform/Renderer backends + viewports to render
structImGuiPlatformIO;// Multi-viewport support: interface for Platform/Renderer backends + viewports to render
structImGuiPlatformMonitor;// Multi-viewport support: user-provided bounds for each connected monitor/display. Used when positioning popups and tooltips to avoid them straddling monitors
structImGuiPlatformMonitor;// Multi-viewport support: user-provided bounds for each connected monitor/display. Used when positioning popups and tooltips to avoid them straddling monitors
structImGuiPlatformImeData;// Platform IME data for io.SetPlatformImeDataFn() function.
structImGuiSizeCallbackData;// Callback data when using SetNextWindowSizeConstraints() (rare/advanced use)
structImGuiSizeCallbackData;// Callback data when using SetNextWindowSizeConstraints() (rare/advanced use)
structImGuiStorage;// Helper for key->value storage
structImGuiStorage;// Helper for key->value storage
structImGuiStyle;// Runtime data for styling/colors
structImGuiStyle;// Runtime data for styling/colors
@ -534,7 +535,8 @@ namespace ImGui
// Widgets: Drag Sliders
// Widgets: Drag Sliders
// - CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped by default and can go off-bounds. Use ImGuiSliderFlags_AlwaysClamp to always clamp.
// - CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped by default and can go off-bounds. Use ImGuiSliderFlags_AlwaysClamp to always clamp.
// - For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[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
// - For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[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.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
// - 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.2f 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").
// - 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.2f: 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).
// - Speed are per-pixel of mouse movement (v_speed=0.2f: 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).
@ -721,7 +723,6 @@ namespace ImGui
IMGUI_APIboolIsPopupOpen(constchar*str_id,ImGuiPopupFlagsflags=0);// return true if the popup is open.
IMGUI_APIboolIsPopupOpen(constchar*str_id,ImGuiPopupFlagsflags=0);// return true if the popup is open.
// Tables
// 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.
// - Full-featured replacement for old Columns API.
// - See Demo->Tables for demo code.
// - See Demo->Tables for demo code.
// - See top of imgui_tables.cpp for general commentary.
// - See top of imgui_tables.cpp for general commentary.
@ -1163,8 +1164,7 @@ enum ImGuiTabItemFlags_
};
};
// Flags for ImGui::BeginTable()
// 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, much more so than you would expect.
// - 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.
// Read comments/demos carefully + experiment with live demos to get acquainted with them.
// - The DEFAULT sizing policies are:
// - The DEFAULT sizing policies are:
// - Default to ImGuiTableFlags_SizingFixedFit if ScrollX is on, or if host window has ImGuiWindowFlags_AlwaysAutoResize.
// - Default to ImGuiTableFlags_SizingFixedFit if ScrollX is on, or if host window has ImGuiWindowFlags_AlwaysAutoResize.
@ -1172,8 +1172,8 @@ enum ImGuiTabItemFlags_
// - When ScrollX is off:
// - When ScrollX is off:
// - Table defaults to ImGuiTableFlags_SizingStretchSame -> all Columns defaults to ImGuiTableColumnFlags_WidthStretch with same weight.
// - Table defaults to ImGuiTableFlags_SizingStretchSame -> all Columns defaults to ImGuiTableColumnFlags_WidthStretch with same weight.
// - Fixed Columns will generally obtain their requested width (unless the table cannot fit them all).
// - Fixed Columns (if any) will generally obtain their requested width (unless the table cannot fit them all).
// - Stretch Columns will share the remaining width.
// - Stretch Columns will share the remaining width according to their respective weight.
// - Mixed Fixed/Stretch columns is possible but has various side-effects on resizing behaviors.
// - 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.
// 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).
// (this is because the visible order of columns have subtle but necessary effects on how they react to manual resizing).
@ -1287,7 +1287,7 @@ enum ImGuiTableColumnFlags_
enumImGuiTableRowFlags_
enumImGuiTableRowFlags_
{
{
ImGuiTableRowFlags_None=0,
ImGuiTableRowFlags_None=0,
ImGuiTableRowFlags_Headers=1<<0// Identify header row (set default background color + width of its contents accounted different for auto column width)
ImGuiTableRowFlags_Headers=1<<0// Identify header row (set default background color + width of its contents accounted differently for auto column width)
ImGuiNavInput_LStickLeft,// scroll / move window (w/ PadMenu) // e.g. Left Analog Stick Left/Right/Up/Down
ImGuiNavInput_LStickLeft,// Scroll / Move window (w/ PadMenu) // e.g. Left Analog Stick Left/Right/Up/Down
ImGuiNavInput_LStickRight,//
ImGuiNavInput_LStickRight,//
ImGuiNavInput_LStickUp,//
ImGuiNavInput_LStickUp,//
ImGuiNavInput_LStickDown,//
ImGuiNavInput_LStickDown,//
ImGuiNavInput_FocusPrev,// next window (w/ PadMenu) // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch)
ImGuiNavInput_FocusPrev,// Focus Next window (w/ PadMenu) // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch)
ImGuiNavInput_FocusNext,// prev window (w/ PadMenu) // e.g. R1 or R2 (PS4), RB or RT (Xbox), R 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_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)
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.
// [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[].
// Keyboard behavior that have no corresponding gamepad mapping (e.g. CTRL+TAB) will be directly reading from io.KeysDown[] instead of io.NavInputs[].
ImGuiNavInput_KeyLeft_,// move left // = Arrow keys
ImGuiNavInput_KeyLeft_,// Move left // = Arrow keys
// 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)
void*ImeWindowHandle;// = NULL // [Obsolete] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning.
#else
void*_UnusedPadding;// Unused field to keep data structure the same size.
floatMouseWheel;// Mouse wheel Vertical: 1 unit scrolls about 5 lines text.
floatMouseWheel;// Mouse wheel Vertical: 1 unit scrolls about 5 lines text.
floatMouseWheelH;// Mouse wheel Horizontal. Most users don't have a mouse with an horizontal wheel, may not be filled by all backends.
floatMouseWheelH;// Mouse wheel Horizontal. Most users don't have a mouse with an horizontal wheel, may not be filled by all backends.
ImGuiIDMouseHoveredViewport;// (Optional) When using multiple viewports: viewport the OS mouse cursor is hovering _IGNORING_ viewports with the ImGuiViewportFlags_NoInputs flag, and _REGARDLESS_ of whether another viewport is focused. Set io.BackendFlags |= ImGuiBackendFlags_HasMouseHoveredViewport if you can provide this info. If you don't imgui will infer the value using the rectangles and last focused time of the viewports it knows about (ignoring other OS windows).
ImGuiIDMouseHoveredViewport;// (Optional) When using multiple viewports: viewport the OS mouse cursor is hovering _IGNORING_ viewports with the ImGuiViewportFlags_NoInputs flag, and _REGARDLESS_ of whether another viewport is focused. Set io.BackendFlags |= ImGuiBackendFlags_HasMouseHoveredViewport if you can provide this info. If you don't imgui will infer the value using the rectangles and last focused time of the viewports it knows about (ignoring other OS windows).
boolKeysDown[512];// 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).
boolKeysDown[512];// 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).
floatNavInputs[ImGuiNavInput_COUNT];// Gamepad inputs. Cleared back to zero by EndFrame(). Keyboard keys will be auto-mapped and be written here by NewFrame().
floatNavInputs[ImGuiNavInput_COUNT];// Gamepad inputs. Cleared back to zero by EndFrame(). Keyboard keys will be auto-mapped and be written here by NewFrame().
// Functions
// Input Functions
IMGUI_APIvoidAddFocusEvent(boolfocused);// Queue an hosting application/platform windows gain or loss of focus
IMGUI_APIvoidAddInputCharacter(unsignedintc);// Queue new character input
IMGUI_APIvoidAddInputCharacter(unsignedintc);// Queue new character input
IMGUI_APIvoidAddInputCharacterUTF16(ImWchar16c);// Queue new character input from an UTF-16 character, it can be a surrogate
IMGUI_APIvoidAddInputCharacterUTF16(ImWchar16c);// Queue new character input from an UTF-16 character, it can be a surrogate
IMGUI_APIvoidAddInputCharactersUTF8(constchar*str);// Queue new characters input from an UTF-8 string
IMGUI_APIvoidAddInputCharactersUTF8(constchar*str);// Queue new characters input from an UTF-8 string
IMGUI_APIvoidAddFocusEvent(boolfocused);// Notifies Dear ImGui when hosting platform windows lose or gain input focus
IMGUI_APIvoidClearInputCharacters();// [Internal] Clear the text input buffer manually
IMGUI_APIvoidClearInputCharacters();// [Internal] Clear the text input buffer manually
IMGUI_APIvoidClearInputKeys();// [Internal] Release all keys
IMGUI_APIvoidClearInputKeys();// [Internal] Release all keys
@ -1988,50 +1997,51 @@ struct ImGuiIO
// generally easier and more correct to use their state BEFORE calling NewFrame(). See FAQ for details!)
// generally easier and more correct to use their state BEFORE calling NewFrame(). See FAQ for details!)
boolWantCaptureMouse;// 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.).
boolWantCaptureMouse;// 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.).
boolWantCaptureKeyboard;// 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.).
boolWantCaptureKeyboard;// 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.).
boolWantTextInput;// 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).
boolWantTextInput;// 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).
boolWantSetMousePos;// MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
boolWantSetMousePos;// MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
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!
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.
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).
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;// Rough estimate of application framerate, in frame per second. Solely for convenience. Rolling average estimation based on io.DeltaTime over 120 frames.
intMetricsRenderVertices;// Vertices output during last call to Render()
intMetricsRenderVertices;// Vertices output during last call to Render()
intMetricsRenderIndices;// Indices output during last call to Render() = number of triangles * 3
intMetricsRenderIndices;// Indices output during last call to Render() = number of triangles * 3
intMetricsRenderWindows;// Number of visible windows
intMetricsRenderWindows;// Number of visible windows
intMetricsActiveWindows;// Number of active windows
intMetricsActiveWindows;// Number of active windows
intMetricsActiveAllocations;// Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.
intMetricsActiveAllocations;// Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.
ImVec2MouseDelta;// 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.
ImVec2MouseDelta;// 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.
boolWantCaptureMouseUnlessPopupClose;// Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup.
ImGuiKeyModFlagsKeyMods;// Key mods flags (same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags), updated by NewFrame()
ImGuiKeyModFlagsKeyMods;// Key mods flags (same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags), updated by NewFrame()
floatKeysDownDuration[512];// Duration the key has been down (<0.0f: not pressed, 0.0f: just pressed, >0.0f: time held)
ImVec2MousePosPrev;// Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
floatKeysDownDurationPrev[512];// Duration the key has been down (from previous frame)
ImVec2MouseClickedPos[5];// Position at time of clicking
doubleMouseClickedTime[5];// Time of last click (used to figure out double-click)
boolWantCaptureMouseUnlessPopupClose;// Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup.
boolMouseClicked[5];// Mouse button went from !Down to Down (same as MouseClickedCount[x] != 0)
ImVec2MousePosPrev;// Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
boolMouseDoubleClicked[5];// Has mouse button been double-clicked? (same as MouseClickedCount[x] == 2)
ImVec2MouseClickedPos[5];// Position at time of clicking
ImU16MouseClickedCount[5];// == 0 (not clicked), == 1 (same as MouseClicked[]), == 2 (double-clicked), == 3 (triple-clicked) etc. when going from !Down to Down
doubleMouseClickedTime[5];// Time of last click (used to figure out double-click)
ImU16MouseClickedLastCount[5];// Count successive number of clicks. Stays valid after mouse release. Reset after another click is done.
boolMouseClicked[5];// Mouse button went from !Down to Down (same as MouseClickedCount[x] != 0)
boolMouseReleased[5];// Mouse button went from Down to !Down
boolMouseDoubleClicked[5];// Has mouse button been double-clicked? (same as MouseClickedCount[x] == 2)
boolMouseDownOwned[5];// 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.
ImU16MouseClickedCount[5];// == 0 (not clicked), == 1 (same as MouseClicked[]), == 2 (double-clicked), == 3 (triple-clicked) etc. when going from !Down to Down
boolMouseDownOwnedUnlessPopupClose[5];//Track if button was clicked inside a dear imgui window.
ImU16MouseClickedLastCount[5];// Count successive number of clicks. Stays valid after mouse release. Reset after another click is done.
floatMouseDownDuration[5];// Duration the mouse button has been down (0.0f == just clicked)
boolMouseReleased[5];// Mouse button went from Down to !Down
floatMouseDownDurationPrev[5];// Previous time the mouse button has been down
boolMouseDownOwned[5];// 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.
ImVec2MouseDragMaxDistanceAbs[5];// Maximum distance, absolute, on each axis, of how much mouse has traveled from the clicking point
boolMouseDownOwnedUnlessPopupClose[5];//Track if button was clicked inside a dear imgui window.
floatMouseDragMaxDistanceSqr[5];// Squared maximum distance of how much mouse has traveled from the clicking point
floatMouseDownDuration[5];// Duration the mouse button has been down (0.0f == just clicked)
floatKeysDownDuration[512];// Duration the keyboard key has been down (0.0f == just pressed)
floatMouseDownDurationPrev[5];// Previous time the mouse button has been down
floatKeysDownDurationPrev[512];// Previous duration the key 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)
// Typically, 1 command = 1 GPU draw call (unless command is a callback)
// Typically, 1 command = 1 GPU draw call (unless command is a callback)
// - VtxOffset/IdxOffset: When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' is enabled,
// - VtxOffset: When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' is enabled,
// those fields allow us to render meshes larger than 64K vertices while keeping 16-bit indices.
// this 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.
// Backends made for <1.71. will typically ignore the VtxOffset fields.
// - The ClipRect/TextureId/VtxOffset fields must be contiguous as we memcmp() them together (this is asserted for).
// - The ClipRect/TextureId/VtxOffset fields must be contiguous as we memcmp() them together (this is asserted for).
structImDrawCmd
structImDrawCmd
{
{
ImVec4ClipRect;// 4*4 // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in "viewport" coordinates
ImVec4ClipRect;// 4*4 // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in "viewport" coordinates
ImTextureIDTextureId;// 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.
ImTextureIDTextureId;// 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.
unsignedintVtxOffset;// 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.
unsignedintVtxOffset;// 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.
unsignedintIdxOffset;// 4 // Start offset in index buffer. Always equal to sum of ElemCount drawn so far.
unsignedintIdxOffset;// 4 // Start offset in index buffer.
unsignedintElemCount;// 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[].
unsignedintElemCount;// 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[].
ImDrawCallbackUserCallback;// 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
ImDrawCallbackUserCallback;// 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
void*UserCallbackData;// 4-8 // The draw callback code can access this.
void*UserCallbackData;// 4-8 // The draw callback code can access this.
@ -2933,6 +2943,7 @@ struct ImGuiViewport
ImGuiIDParentViewportId;// (Advanced) 0: no parent. Instruct the platform backend to setup a parent/child relationship between platform windows.
ImGuiIDParentViewportId;// (Advanced) 0: no parent. Instruct the platform backend to setup a parent/child relationship between platform windows.
ImDrawData*DrawData;// The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
ImDrawData*DrawData;// The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
// Platform/Backend Dependent Data
// Our design separate the Renderer and Platform backends to facilitate combining default backends with each others.
// Our design separate the Renderer and Platform backends to facilitate combining default backends with each others.
// When our create your own backend for a custom engine, it is possible that both Renderer and Platform will be handled
// When our create your own backend for a custom engine, it is possible that both Renderer and Platform will be handled
// by the same system and you may not need to use all the UserData/Handle fields.
// by the same system and you may not need to use all the UserData/Handle fields.
@ -2940,7 +2951,7 @@ struct ImGuiViewport
void*RendererUserData;// void* to hold custom data structure for the renderer (e.g. swap chain, framebuffers etc.). generally set by your Renderer_CreateWindow function.
void*RendererUserData;// void* to hold custom data structure for the renderer (e.g. swap chain, framebuffers etc.). generally set by your Renderer_CreateWindow function.
void*PlatformUserData;// void* to hold custom data structure for the OS / platform (e.g. windowing info, render context). generally set by your Platform_CreateWindow function.
void*PlatformUserData;// void* to hold custom data structure for the OS / platform (e.g. windowing info, render context). generally set by your Platform_CreateWindow function.
void*PlatformHandle;// void* for FindViewportByPlatformHandle(). (e.g. suggested to use natural platform handle such as HWND, GLFWWindow*, SDL_Window*)
void*PlatformHandle;// void* for FindViewportByPlatformHandle(). (e.g. suggested to use natural platform handle such as HWND, GLFWWindow*, SDL_Window*)
void*PlatformHandleRaw;// void* to hold lower-level, platform-native window handle (e.g. the HWND) when using an abstraction layer like GLFW or SDL (where PlatformHandle would be a SDL_Window*)
void*PlatformHandleRaw;// void* to hold lower-level, platform-native window handle (under Win32 this is expected to be a HWND, unused for other platforms), when using an abstraction layer like GLFW or SDL (where PlatformHandle would be a SDL_Window*)
boolPlatformRequestMove;// Platform window requested move (e.g. window was moved by the OS / host window manager, authoritative position will be OS window position)
boolPlatformRequestMove;// Platform window requested move (e.g. window was moved by the OS / host window manager, authoritative position will be OS window position)
boolPlatformRequestResize;// Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size)
boolPlatformRequestResize;// Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size)
boolPlatformRequestClose;// Platform window requested closure (e.g. window was moved by the OS / host window manager, e.g. pressing ALT-F4)
boolPlatformRequestClose;// Platform window requested closure (e.g. window was moved by the OS / host window manager, e.g. pressing ALT-F4)
// [BETA] (Optional) This is completely optional, for advanced users!
// [BETA] (Optional) This is completely optional, for advanced users!
// If you are new to Dear ImGui and trying to integrate it into your engine, you can probably ignore this for now.
// If you are new to Dear ImGui and trying to integrate it into your engine, you can probably ignore this for now.
@ -3040,7 +3051,6 @@ struct ImGuiPlatformIO
void(*Platform_SwapBuffers)(ImGuiViewport*vp,void*render_arg);// . . . R . // (Optional) Call Present/SwapBuffers (platform side! This is often unused!). 'render_arg' is the value passed to RenderPlatformWindowsDefault().
void(*Platform_SwapBuffers)(ImGuiViewport*vp,void*render_arg);// . . . R . // (Optional) Call Present/SwapBuffers (platform side! This is often unused!). 'render_arg' is the value passed to RenderPlatformWindowsDefault().
float(*Platform_GetWindowDpiScale)(ImGuiViewport*vp);// N . . . . // (Optional) [BETA] FIXME-DPI: DPI handling: Return DPI scale for this viewport. 1.0f = 96 DPI.
float(*Platform_GetWindowDpiScale)(ImGuiViewport*vp);// N . . . . // (Optional) [BETA] FIXME-DPI: DPI handling: Return DPI scale for this viewport. 1.0f = 96 DPI.
void(*Platform_OnChangedViewport)(ImGuiViewport*vp);// . F . . . // (Optional) [BETA] FIXME-DPI: DPI handling: Called during Begin() every time the viewport we are outputting into changes, so backend has a chance to swap fonts to adjust style.
void(*Platform_OnChangedViewport)(ImGuiViewport*vp);// . F . . . // (Optional) [BETA] FIXME-DPI: DPI handling: Called during Begin() every time the viewport we are outputting into changes, so backend has a chance to swap fonts to adjust style.
void(*Platform_SetImeInputPos)(ImGuiViewport*vp,ImVec2pos);// . F . . . // (Optional) Set IME (Input Method Editor, e.g. for Asian languages) input position, so text preview appears over the imgui input box. FIXME: The call timing of this is inconsistent because we want to support without multi-viewports.
int(*Platform_CreateVkSurface)(ImGuiViewport*vp,ImU64vk_inst,constvoid*vk_allocators,ImU64*out_vk_surface);// (Optional) For a Vulkan Renderer to call into Platform code (since the surface creation needs to tie them both).
int(*Platform_CreateVkSurface)(ImGuiViewport*vp,ImU64vk_inst,constvoid*vk_allocators,ImU64*out_vk_surface);// (Optional) For a Vulkan Renderer to call into Platform code (since the surface creation needs to tie them both).