- Demo: Fixed Overlay: Added a context menu item to enable freely moving the window.
- Examples: Allegro 5: Added support for 32-bit indices setup via defining ImDrawIdx, to avoid an unnecessary conversion (Allegro 5 doesn't support 16-bit indices).
- Examples: Allegro 5: Renamed bindings from imgui_impl_a5.cpp to imgui_impl_allegro5.cpp.
- Various minor fixes, tweaks, refactoring, comments.
GrabMinSize=10.0f;// Minimum width/height of a grab box for slider/scrollbar
GrabRounding=0.0f;// Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
ButtonTextAlign=ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text.
DisplayWindowPadding=ImVec2(22,22);// Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
DisplayWindowPadding=ImVec2(20,20);// Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
DisplaySafeAreaPadding=ImVec2(3,3);// If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows.
MouseCursorScale=1.0f;// Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
AntiAliasedLines=true;// Enable anti-aliasing on lines/borders. Disable if you are really short on CPU/GPU.
// If mouse just appeared or disappeared (usually denoted by -FLT_MAX component, but in reality we test for -256000.0f) we cancel out movement in MouseDelta
// (We pass an error message in the assert expression as a trick to get it visible to programmers who are not using a debugger, as most assert handlers display their argument)
// (We pass an error message in the assert expression to make it visible to programmers who are not using a debugger, as most assert handlers display their argument)
IM_ASSERT(g.Initialized);
IM_ASSERT(g.IO.DeltaTime>=0.0f&&"Need a positive DeltaTime (zero is tolerated but will cause some timing issues)");
IM_ASSERT(g.IO.KeyMap[n]>=-1&&g.IO.KeyMap[n]<IM_ARRAYSIZE(g.IO.KeysDown)&&"io.KeyMap[] contains an out of bound value (need to be 0..512, or -1 for unmapped key)");
// Do a simple check for required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was super recently added in 1.60 WIP)
// Perform simple check for required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was only recently added in 1.60 WIP)
// Child menus typically request _any_ position within the parent menu item, and then our FindBestWindowPosForPopup() function will move the new menu outside the parent bounds.
// This is how we end up with child menus appearing (most-commonly) on the right of the parent menu.
floathorizontal_overlap=g.Style.ItemSpacing.x;// We want some overlap to convey the relative depth of each menu (currently the amount of overlap is hard-coded to style.ItemSpacing.x).
r_avoid=ImRect(ref_pos.x-16,ref_pos.y-8,ref_pos.x+24*sc,ref_pos.y+24*sc);// FIXME: Hard-coded based on mouse cursor shape expectation. Exact dimension not very important.
pos=ref_pos+ImVec2(2,2);// If there's not enough room, for tooltip we prefer avoiding the cursor at all cost even if it means that part of the tooltip won't be visible.
// Tooltip always resize. We keep the spacing symmetric on both axises for aesthetic purpose.
size_auto_fit=size_contents;
// Tooltip always resize
returnsize_contents;
}
else
{
// When the window cannot fit all contents (either because of constraints, either because screen is too small): we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than DisplaySize-WindowPadding.
// Sub-menus are ChildWindow so that mouse can be hovering across them (otherwise top-most popup menu would steal focus and not allow hovering on parent menu)
// Back-end capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom back-end.
enumImGuiBackendFlags_
{
ImGuiBackendFlags_HasGamepad=1<<0,// Back-end has a connected gamepad.
ImGuiBackendFlags_HasMouseCursors=1<<1,// Back-end can honor GetMouseCursor() values and change the OS cursor shape.
ImGuiBackendFlags_HasSetMousePos=1<<2// Back-end can honor io.WantSetMousePos and reposition the mouse (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
ImGuiBackendFlags_HasGamepad=1<<0,// Back-end supports and has a connected gamepad.
ImGuiBackendFlags_HasMouseCursors=1<<1,// Back-end supports reading GetMouseCursor() to change the OS cursor shape.
ImGuiBackendFlags_HasSetMousePos=1<<2// Back-end supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
};
// Enumeration for PushStyleColor() / PopStyleColor()
@ -1053,8 +1053,8 @@ struct ImGuiIO
ImVec2MousePos;// Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (on another screen, etc.)
boolMouseDown[5];// Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
floatMouseWheel;// Mouse wheel: 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 back-ends.
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 back-ends.
boolMouseDrawCursor;// Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
boolKeyCtrl;// Keyboard modifier pressed: Control
boolKeyShift;// Keyboard modifier pressed: Shift
@ -1686,7 +1686,7 @@ enum ImFontAtlasFlags_
// 2. Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data.
// 3. Upload the pixels data into a texture within your graphics system.
// 4. Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture. This value will be passed back to you during rendering to identify the texture.
// IMPORTANT: If you pass a 'glyph_ranges' array to AddFont*** functions, you need to make sure that your array persist up until the ImFont is build (when calling GetTextData*** or Build()). We only copy the pointer, not the data.
// IMPORTANT: If you pass a 'glyph_ranges' array to AddFont*** functions, you need to make sure that your array persist up until the ImFont is build (when calling GetTexData*** or Build()). We only copy the pointer, not the data.
voidClipWith(constImRect&r){Min=ImMax(Min,r.Min);Max=ImMin(Max,r.Max);}// Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.
voidClipWithFull(constImRect&r){Min=ImClamp(Min,r.Min,r.Max);Max=ImClamp(Max,r.Min,r.Max);}// Full version, ensure both points are fully clipped.
void*(*ReadOpenFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,constchar*name);// Read: Called when entering into a new ini entry e.g. "[Window][Name]"
void(*ReadLineFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,void*entry,constchar*line);// Read: Called for every line of text within an ini entry
void(*WriteAllFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,ImGuiTextBuffer*out_buf);// Write: Output every entries into 'out_buf'
ImVec2ScrollTarget;// target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
ImVec2ScrollTargetCenterRatio;// 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
boolScrollbarX,ScrollbarY;
ImVec2ScrollbarSizes;
boolScrollbarX,ScrollbarY;
boolActive;// Set to true on Begin(), unless Collapsed
boolWasActive;
boolWriteAccessed;// Set to true when any widget access the current window
@ -926,9 +926,9 @@ struct IMGUI_API ImGuiWindow
intAutoFitChildAxises;
ImGuiDirAutoPosLastDirection;
intHiddenFrames;
ImGuiCondSetWindowPosAllowFlags;// store condition flags for next SetWindowPos() call.
ImGuiCondSetWindowSizeAllowFlags;// store condition flags for next SetWindowSize() call.
ImGuiCondSetWindowCollapsedAllowFlags;// store condition flags for next SetWindowCollapsed() call.
ImGuiCondSetWindowPosAllowFlags;// store acceptable condition flags for SetNextWindowPos() use.
ImGuiCondSetWindowSizeAllowFlags;// store acceptable condition flags for SetNextWindowSize() use.
ImGuiCondSetWindowCollapsedAllowFlags;// store acceptable condition flags for SetNextWindowCollapsed() use.
ImVec2SetWindowPosVal;// store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
ImVec2SetWindowPosPivot;// store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right.
@ -942,7 +942,8 @@ struct IMGUI_API ImGuiWindow
ImGuiMenuColumnsMenuColumns;// Simplified columns storage for menu items