@ -119,7 +119,7 @@ ImGui is very programmer centric and the immediate-mode GUI paradigm might requi
<b>Is ImGui fast?</b>
Probably fast enough for most uses. Down to the fundation of its visual design, ImGui is engineered to be fairly performant both in term of CPU and GPU usage. Running elaborate code and creating elaborate UI will of course have a cost but ImGui aims to minimize it.
Probably fast enough for most uses. Down to the foundation of its visual design, ImGui is engineered to be fairly performant both in term of CPU and GPU usage. Running elaborate code and creating elaborate UI will of course have a cost but ImGui aims to minimize it.
Mileage may vary but the following screenshot can give you a rough idea of the cost of running and rendering UI code (In the case of a trivial demo application like this one, your driver/os setup are likely to be the bottleneck. Testing performance as part of a real application is recommended).
ImGuiPopupRefpopup_ref=ImGuiPopupRef(id,window,window->GetID("##menus"),g.IO.MousePos);// Tagged as new ref because constructor sets Window to NULL (we are passing the ParentWindow info here)
IM_ASSERT(column_index>0);// We cannot drag column 0. If you get this assert you may have a conflict between the ID of your columns and another widgets.
constfloatt=window->DC.StateStorage->GetFloat(column_id,default_t);// Cheaply store our floating point value inside the integer (could store an union into the map?)
structImDrawChannel;// Temporary storage for outputting drawing commands out of order, used by ImDrawList::ChannelsSplit()
structImDrawCmd;// A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call)
@ -692,9 +697,9 @@ enum ImGuiMouseCursor_
enumImGuiSetCond_
{
ImGuiSetCond_Always=1<<0,// Set the variable
ImGuiSetCond_Once=1<<1,// Only set the variable on the first call per runtime session
ImGuiSetCond_FirstUseEver=1<<2,// Only set the variable if the window doesn't exist in the .ini file
ImGuiSetCond_Appearing=1<<3// Only set the variable if the window is appearing after being inactive (or the first time)
ImGuiSetCond_Once=1<<1,// Set the variable once per runtime session (only the first call with succeed)
ImGuiSetCond_FirstUseEver=1<<2,// Set the variable if the window has no saved data (if doesn't exist in the .ini file)
ImGuiSetCond_Appearing=1<<3// Set the variable if the window is appearing after being hidden/inactive (or the first time)
};
structImGuiStyle
@ -1267,7 +1272,7 @@ struct ImFontConfig
intFontNo;// 0 // Index of font within TTF file
floatSizePixels;// // Size in pixels for rasterizer
intOversampleH,OversampleV;// 3, 1 // Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis.
boolPixelSnapH;// false // Align every character to pixel boundary (if enabled, set OversampleH/V to 1)
boolPixelSnapH;// 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.
ImVec2GlyphExtraSpacing;// 0, 0 // Extra spacing (in pixels) between glyphs
constImWchar*GlyphRanges;// // 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.
boolMergeMode;// false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs).
@ -1356,7 +1361,7 @@ struct ImFont
ImVec2DisplayOffset;// = (0.f,1.f) // Offset font rendering by xx pixels
ImVector<Glyph>Glyphs;// // All glyphs.
ImVector<float>IndexXAdvance;// // Sparse. Glyphs->XAdvance in a directly indexable way (more cache-friendly, for CalcTextSize functions which are often bottleneck in large UI).
ImVector<short>IndexLookup;// // Sparse. Index glyphs by Unicode code-point.
ImVector<unsigned short>IndexLookup;// // Sparse. Index glyphs by Unicode code-point.
ImWcharFallbackChar;// = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar()
@ -1389,6 +1394,10 @@ struct ImFont
IMGUI_APIvoidAddRemapChar(ImWchardst,ImWcharsrc,booloverwrite_dst=true);// Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.
};
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
//---- Include imgui_user.h at the end of imgui.h
//---- So you can include code that extends ImGui using any of the types declared above.
//---- (also convenient for user to only explicitly include vanilla imgui.h)
IM_ASSERT(IndexLookup.Size>0);// Currently this can only be called AFTER the font has been built, aka after calling ImFontAtlas::GetTexDataAs*() function.
#pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport)
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h
#pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h
boolLastItemHoveredAndUsable;// Item rectangle is hovered, and its window is currently interactable with (not blocked by a popup preventing access to the window)
boolLastItemHoveredRect;// Item rectangle is hovered, but its window may or not be currently interactable with (might be blocked by a popup preventing access to the window)
ImVec2SizeContentsExplicit;// Size of contents explicitly set by the user via SetNextWindowContentSize()
ImRectContentsRegionRect;// Maximum visible content position in window coordinates. ~~ (SizeContentsExplicit ? SizeContentsExplicit : Size - ScrollbarSizes) - CursorStartPos, per axis
ImVec2WindowPadding;// Window padding at the time of begin. We need to lock it, in particular manipulation of the ShowBorder would have an effect
ImGuiIDMoveID;// == window->GetID("#MOVE")
ImGuiIDMoveId;// == window->GetID("#MOVE")
ImVec2Scroll;
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
@ -621,7 +618,7 @@ struct IMGUI_API ImGuiWindow
boolCollapsed;// Set when collapsing window to become only title-bar
boolSkipItems;// == Visible && !Collapsed
intBeginCount;// Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
ImGuiIDPopupID;// ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
ImGuiIDPopupId;// ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)