# Not using matrix here because it would inflate job count too much. Check out and setup is done for every job and that makes build times way too long.
@ -14,8 +14,6 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- window: calling SetNextWindowSize() every frame with <= 0 doesn't do anything, may be useful to allow (particularly when used for a single axis). (#690)
- window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list. perhaps a lightweight explicit cleanup pass.
- window: auto-fit feedback loop when user relies on any dynamic layout (window width multiplier, column) appears weird to end-user. clarify.
- window: allow resizing of child windows (possibly given min/max for each axis?.)
- window: begin with *p_open == false could return false.
- window: get size/pos helpers given names (see discussion in #249)
- window: a collapsed window can be stuck behind the main menu bar?
@ -31,6 +29,8 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- window: the size_on_first_use path of Begin() can probably be removed
- window/size: manually triggered auto-fit (double-click on grip) shouldn't resize window down to viewport size?
- window/opt: freeze window flag: if not focused/hovered, return false, render with previous ImDrawList. and/or reduce refresh rate. -> this may require enforcing that it is illegal to submit contents if Begin returns false.
// Render an arrow aimed to be aligned with text (p_min is a position in the same space text would be positioned). To e.g. denote expanded/collapsed state
// (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||g.FrameCount==0)&&"Need a positive DeltaTime!");
IM_ASSERT((g.FrameCount==0||g.FrameCountEnded==g.FrameCount)&&"Forgot to call Render() or EndFrame() at the end of the previous frame?");
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.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)");
// Perform simple check: 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)
IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space]!=-1&&"ImGuiKey_Space is not mapped, required for keyboard navigation.");
// Perform simple check: the beta io.ConfigWindowsResizeFromEdges option requires back-end to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly.
// Perform simple check: error if Docking or Viewport are enabled _exactly_ on frame 1 (instead of frame 0 or later), which is a common error leading to loss of .ini data.
IM_ASSERT((g.FrameCount==0||g.FrameCount==g.FrameCountPlatformEnded)&&"Forgot to call UpdatePlatformWindows() in main loop after EndFrame()? Check examples/ applications for reference.");
IM_ASSERT(mon.MainSize.x>0.0f&&mon.MainSize.y>0.0f&&"Monitor bounds not setup properly.");
IM_ASSERT(mon.WorkSize.x>0.0f&&mon.WorkSize.y>0.0f&&"Monitor bounds not setup properly. If you don't have work area information, just copy Min/Max into them.");
// (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||g.FrameCount==0)&&"Need a positive DeltaTime!");
IM_ASSERT((g.FrameCount==0||g.FrameCountEnded==g.FrameCount)&&"Forgot to call Render() or EndFrame() at the end of the previous frame?");
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.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)");
// Perform simple check: 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)
IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space]!=-1&&"ImGuiKey_Space is not mapped, required for keyboard navigation.");
// Perform simple check: the beta io.ConfigWindowsResizeFromEdges option requires back-end to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly.
// Perform simple check: error if Docking or Viewport are enabled _exactly_ on frame 1 (instead of frame 0 or later), which is a common error leading to loss of .ini data.
IM_ASSERT((g.FrameCount==0||g.FrameCount==g.FrameCountPlatformEnded)&&"Forgot to call UpdatePlatformWindows() in main loop after EndFrame()? Check examples/ applications for reference.");
IM_ASSERT(mon.MainSize.x>0.0f&&mon.MainSize.y>0.0f&&"Monitor bounds not setup properly.");
IM_ASSERT(mon.WorkSize.x>0.0f&&mon.WorkSize.y>0.0f&&"Monitor bounds not setup properly. If you don't have work area information, just copy Min/Max into them.");
IM_ASSERT(mon.DpiScale!=0.0f);
}
}
}
staticvoidImGui::ErrorCheckEndFrameSanityChecks()
{
ImGuiContext&g=*GImGui;
// Verify that io.KeyXXX fields haven't been tampered with. Key mods shoudl not be modified between NewFrame() and EndFrame()
@ -176,6 +176,7 @@ typedef int ImGuiDragDropFlags; // -> enum ImGuiDragDropFlags_ // Flags: f
typedefintImGuiFocusedFlags;// -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused()
typedefintImGuiHoveredFlags;// -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
typedefintImGuiInputTextFlags;// -> enum ImGuiInputTextFlags_ // Flags: for InputText(), InputTextMultiline()
typedefintImGuiKeyModFlags;// -> enum ImGuiKeyModFlags_ // Flags: for io.KeyMods (Ctrl/Shift/Alt/Super)
typedefintImGuiSelectableFlags;// -> enum ImGuiSelectableFlags_ // Flags: for Selectable()
typedefintImGuiTabBarFlags;// -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar()
typedefintImGuiTabItemFlags;// -> enum ImGuiTabItemFlags_ // Flags: for BeginTabItem()
@ -1056,6 +1057,16 @@ enum ImGuiKey_
ImGuiKey_COUNT
};
// To test io.KeyMods (which is a combination of individual fields io.KeyCtrl, io.KeyShift, io.KeyAlt set by user/back-end)
enumImGuiKeyModFlags_
{
ImGuiKeyModFlags_None=0,
ImGuiKeyModFlags_Ctrl=1<<0,
ImGuiKeyModFlags_Shift=1<<1,
ImGuiKeyModFlags_Alt=1<<2,
ImGuiKeyModFlags_Super=1<<3
};
// Gamepad/Keyboard directional navigation
// Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays.
// Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Back-end: set ImGuiBackendFlags_HasGamepad and fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame().
@ -1579,6 +1590,7 @@ struct ImGuiIO
// [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed!
// Render an arrow aimed to be aligned with text (p_min is a position in the same space text would be positioned). To e.g. denote expanded/collapsed state
// NB: This is rather brittle and will show artifact when rounding this enabled if rounded corners overlap multiple cells. Caller currently responsible for avoiding that.
// Spent a non reasonable amount of time trying to getting this right for ColorButton with rounding+anti-aliasing+ImGuiColorEditFlags_HalfAlphaPreview flag + various grid sizes and offsets, and eventually gave up... probably more reasonable to disable rounding alltogether.
staticinlineImU32ImHash(constvoid*data,intsize,ImU32seed=0){returnsize?ImHashData(data,(size_t)size,seed):ImHashStr((constchar*)data,0,seed);}// [moved to ImHashStr/ImHashData in 1.68]
// NB: This is rather brittle and will show artifact when rounding this enabled if rounded corners overlap multiple cells. Caller currently responsible for avoiding that.
// I spent a non reasonable amount of time trying to getting this right for ColorButton with rounding+anti-aliasing+ImGuiColorEditFlags_HalfAlphaPreview flag + various grid sizes and offsets, and eventually gave up... probably more reasonable to disable rounding alltogether.
@ -5,7 +5,7 @@ Build font atlases using FreeType instead of stb_truetype (which is the default
### Usage
1. Get latest FreeType binaries or build yourself (under Windows you may use vcpkg with `vcpkg install freetype`).
1. Get latest FreeType binaries or build yourself (under Windows you may use vcpkg with `vcpkg install freetype`, `vcpkg integrate install`).
2. Add imgui_freetype.h/cpp alongside your imgui sources.
3. Include imgui_freetype.h after imgui.h.
4. Call `ImGuiFreeType::BuildFontAtlas()`*BEFORE* calling `ImFontAtlas::GetTexDataAsRGBA32()` or `ImFontAtlas::Build()` (so normal Build() won't be called):