@ -153,10 +153,9 @@ I occasionally tag [Releases](https://github.com/ocornut/imgui/releases) but it
The library started its life and is best known as "ImGui" only due to the fact that I didn't give it a proper name when I released it. However, the term IMGUI (immediate-mode graphical user interface) was coined before and is being used in variety of other situations. It seemed confusing and unfair to hog the name. To reduce the ambiguity without affecting existing codebases, I have decided on an alternate, longer name "dear imgui" that people can use to refer to this specific library in ambiguous situations.
<b>What is ImTextureID and how do I display an image?</b>
<br><b>I integrated Dear ImGui in my engine and the text or lines are blurry..</b>
<br><b>I integrated Dear ImGui in my engine and some elements are disappearing when I move windows around..</b>
<br><b>How can I have multiple widgets with the same label? Can I have widget without a label? (Yes). A primer on labels/IDs.</b>
<b>How can I help</b>
<br><b>How can I display an image? What is ImTextureID, how does it works?</b>
<br><b>How can I have multiple widgets with the same label? Can I have widget without a label? (Yes). A primer on labels and the ID stack.</b>
<br><b>How can I tell when Dear ImGui wants my mouse/keyboard inputs VS when I can pass them to my application?</b>
<br><b>How can I load a different font than the default?</b>
<br><b>How can I easily use icons in my application?</b>
@ -164,6 +163,8 @@ The library started its life and is best known as "ImGui" only due to the fact t
<br><b>How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?</b>
<br><b>How can I preserve my Dear ImGui context across reloading a DLL? (loss of the global/static variables)</b>
<br><b>How can I use the drawing facilities without an Dear ImGui window? (using ImDrawList API)</b>
<br><b>I integrated Dear ImGui in my engine and the text or lines are blurry..</b>
<br><b>I integrated Dear ImGui in my engine and some elements are disappearing when I move windows around..</b>
// (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)
IM_ASSERT(g.IO.DeltaTime>=0.0f&&"Need a positive DeltaTime (zero is tolerated but will cause some timing issues)");
IM_ASSERT(g.Style.Alpha>=0.0f&&g.Style.Alpha<=1.0f&&"Invalid style setting. Alpha cannot be negative (allows us to avoid a few clamps in color computations)");
IM_ASSERT((g.FrameCount==0||g.FrameCountEnded==g.FrameCount)&&"Forgot to call Render() or EndFrame() at the end of the previous frame?");
// MovingWindow = window we clicked on, could be a child window. We track it to preserve Focus and so that ActiveIdWindow == MovingWindow and ActiveId == MovingWindow->MoveId for consistency.
@ -2436,7 +2441,6 @@ void ImGui::NewFrame()
{
ClearActiveID();
g.MovingWindow=NULL;
g.MovingWindowMoveId=0;
}
}
else
@ -2449,7 +2453,6 @@ void ImGui::NewFrame()
ClearActiveID();
}
g.MovingWindow=NULL;
g.MovingWindowMoveId=0;
}
// Delay saving settings so we don't spam disk too much
// Old API feature: we could pass the initial window size as a parameter, however this was very misleading because in most cases it would only affect the window when it didn't have storage in the .ini file.
// Old API feature: we could pass the initial window size as a parameter. This was misleading because it only had an effect if the window didn't have data in the .ini file.
// Old API feature: we could override the window background alpha with a parameter. This is actually tricky to reproduce manually because:
// (1) there are multiple variants of WindowBg (popup, tooltip, etc.) and (2) you can't call PushStyleColor before Begin and PopStyleColor just after Begin() because of how CheckStackSizes() behave.
// The user-side solution is to do backup = GetStyleColorVec4(ImGuiCol_xxxBG), PushStyleColor(ImGuiCol_xxxBg), Begin, PushStyleColor(ImGuiCol_xxxBg, backup), [...], PopStyleColor(), End(); PopStyleColor() - which is super awkward.
// The alpha override was rarely used but for now we'll leave the Begin() variant around for a bit. We may either lift the constraint on CheckStackSizes() either add a SetNextWindowBgAlpha() helper that does it magically.
g.NextWindowData.FocusCond=ImGuiCond_Always;// Using a Cond member for consistency (may transition all of them to single flag set for fast Clear() op)
}
voidImGui::SetNextWindowBgAlpha(floatalpha)
{
ImGuiContext&g=*GImGui;
g.NextWindowData.BgAlphaVal=alpha;
g.NextWindowData.BgAlphaCond=ImGuiCond_Always;// Using a Cond member for consistency (may transition all of them to single flag set for fast Clear() op)
IMGUI_APIvoidSetNextWindowContentSize(constImVec2&size);// set next window content size (~ enforce the range of scrollbars). not including window decorations (title bar, menu bar, etc.). set an axis to 0.0f to leave it automatic. call before Begin()
IMGUI_APIvoidSetNextWindowCollapsed(boolcollapsed,ImGuiCondcond=0);// set next window collapsed state. call before Begin()
IMGUI_APIvoidSetNextWindowFocus();// set next window to be focused / front-most. call before Begin()
IMGUI_APIvoidSetNextWindowBgAlpha(floatalpha);// set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg.
IMGUI_APIvoidSetWindowPos(constImVec2&pos,ImGuiCondcond=0);// (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
IMGUI_APIvoidSetWindowSize(constImVec2&size,ImGuiCondcond=0);// (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.
IMGUI_APIvoidSetWindowCollapsed(boolcollapsed,ImGuiCondcond=0);// (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
// OBSOLETED in 1.52 (between Aug 2017 and Oct 2017)
boolBegin(constchar*name,bool*p_open,constImVec2&size_on_first_use,floatbg_alpha_override=-1.0f,ImGuiWindowFlagsflags=0);// Use SetNextWindowSize() instead if you want to set a window size.
boolBegin(constchar*name,bool*p_open,constImVec2&size_on_first_use,floatbg_alpha_override=-1.0f,ImGuiWindowFlagsflags=0);// Use SetNextWindowSize(size, ImGuiCond_FirstUseEver) + SetNextWindowBgAlpha() instead.
int_ChannelsCount;// [Internal] number of active channels (1+)
ImVector<ImDrawChannel>_Channels;// [Internal] draw channels for columns API (not resized down so _ChannelsCount may be smaller than _Channels.Size)
// If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData() or create and use your own ImDrawListSharedData (so you can use ImDrawList without ImGui)
IMGUI_APIvoidPushClipRect(ImVec2clip_rect_min,ImVec2clip_rect_max,boolintersect_with_current_clip_rect=false);// 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)
ImVec2ActiveIdClickOffset;// Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
ImGuiWindow*ActiveIdWindow;
ImGuiWindow*MovingWindow;// Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.