mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
Merge branch 'master' into docking
# Conflicts: # docs/CHANGELOG.txt # examples/README.txt # imgui.cpp # imgui.h # imgui_internal.h # imgui_widgets.cpp
This commit is contained in:
169
imgui.cpp
169
imgui.cpp
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.71 WIP
|
||||
// dear imgui, v1.71
|
||||
// (main code and documentation)
|
||||
|
||||
// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
|
||||
@ -51,7 +51,7 @@ DOCUMENTATION
|
||||
- How can I load multiple fonts?
|
||||
- How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?
|
||||
- How can I interact with standard C++ types (such as std::string and std::vector)?
|
||||
- How can I use the drawing facilities without an ImGui window? (using ImDrawList API)
|
||||
- How can I use the drawing facilities without a Dear ImGui window? (using ImDrawList API)
|
||||
- How can I use Dear ImGui on a platform that doesn't have a mouse or a keyboard? (input share, remoting, gamepad)
|
||||
- I integrated Dear ImGui in my engine and the text or lines are blurry..
|
||||
- I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around..
|
||||
@ -174,7 +174,7 @@ CODE
|
||||
- Run and study the examples and demo in imgui_demo.cpp to get acquainted with the library.
|
||||
- Add the Dear ImGui source files to your projects or using your preferred build system.
|
||||
It is recommended you build and statically link the .cpp files as part of your project and not as shared library (DLL).
|
||||
- You can later customize the imconfig.h file to tweak some compile-time behavior, such as integrating imgui types with your own maths types.
|
||||
- You can later customize the imconfig.h file to tweak some compile-time behavior, such as integrating Dear ImGui types with your own maths types.
|
||||
- When using Dear ImGui, your programming IDE is your friend: follow the declaration of variables, functions and types to find comments about them.
|
||||
- Dear ImGui never touches or knows about your GPU state. The only function that knows about GPU is the draw function that you provide.
|
||||
Effectively it means you can create widgets at any time in your code, regardless of considerations of being in "update" vs "render"
|
||||
@ -253,16 +253,16 @@ CODE
|
||||
io.MouseDown[1] = my_mouse_buttons[1];
|
||||
|
||||
// Call NewFrame(), after this point you can use ImGui::* functions anytime
|
||||
// (So you want to try calling NewFrame() as early as you can in your mainloop to be able to use imgui everywhere)
|
||||
// (So you want to try calling NewFrame() as early as you can in your mainloop to be able to use Dear ImGui everywhere)
|
||||
ImGui::NewFrame();
|
||||
|
||||
// Most of your application code here
|
||||
ImGui::Text("Hello, world!");
|
||||
MyGameUpdate(); // may use any ImGui functions, e.g. ImGui::Begin("My window"); ImGui::Text("Hello, world!"); ImGui::End();
|
||||
MyGameRender(); // may use any ImGui functions as well!
|
||||
MyGameUpdate(); // may use any Dear ImGui functions, e.g. ImGui::Begin("My window"); ImGui::Text("Hello, world!"); ImGui::End();
|
||||
MyGameRender(); // may use any Dear ImGui functions as well!
|
||||
|
||||
// Render imgui, swap buffers
|
||||
// (You want to try calling EndFrame/Render as late as you can, to be able to use imgui in your own game rendering code)
|
||||
// Render dear imgui, swap buffers
|
||||
// (You want to try calling EndFrame/Render as late as you can, to be able to use Dear ImGui in your own game rendering code)
|
||||
ImGui::EndFrame();
|
||||
ImGui::Render();
|
||||
ImDrawData* draw_data = ImGui::GetDrawData();
|
||||
@ -284,8 +284,8 @@ CODE
|
||||
for (int n = 0; n < draw_data->CmdListsCount; n++)
|
||||
{
|
||||
const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
||||
const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer.Data; // vertex buffer generated by ImGui
|
||||
const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer.Data; // index buffer generated by ImGui
|
||||
const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer.Data; // vertex buffer generated by Dear ImGui
|
||||
const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer.Data; // index buffer generated by Dear ImGui
|
||||
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
|
||||
{
|
||||
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
|
||||
@ -296,7 +296,7 @@ CODE
|
||||
else
|
||||
{
|
||||
// The texture for the draw call is specified by pcmd->TextureId.
|
||||
// The vast majority of draw calls will use the imgui texture atlas, which value you have set yourself during initialization.
|
||||
// The vast majority of draw calls will use the Dear ImGui texture atlas, which value you have set yourself during initialization.
|
||||
MyEngineBindTexture((MyTexture*)pcmd->TextureId);
|
||||
|
||||
// We are using scissoring to clip some objects. All low-level graphics API should supports it.
|
||||
@ -321,8 +321,8 @@ CODE
|
||||
|
||||
- The examples/ folders contains many actual implementation of the pseudo-codes above.
|
||||
- When calling NewFrame(), the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags are updated.
|
||||
They tell you if Dear ImGui intends to use your inputs. When a flag is set you want to hide the corresponding inputs
|
||||
from the rest of your application. In every cases you need to pass on the inputs to imgui. Refer to the FAQ for more information.
|
||||
They tell you if Dear ImGui intends to use your inputs. When a flag is set you want to hide the corresponding inputs from the
|
||||
rest of your application. In every cases you need to pass on the inputs to Dear ImGui. Refer to the FAQ for more information.
|
||||
- Please read the FAQ below!. Amusingly, it is called a FAQ because people frequently run into the same issues!
|
||||
|
||||
USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS
|
||||
@ -372,14 +372,18 @@ CODE
|
||||
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
|
||||
|
||||
(Docking/Viewport Branch)
|
||||
- 2018/XX/XX (1.XX) - when multi-viewports are enabled, all positions will be in your natural OS coordinates space. It means that:
|
||||
- 2019/XX/XX (1.XX) - when multi-viewports are enabled, all positions will be in your natural OS coordinates space. It means that:
|
||||
- reference to hard-coded positions such as in SetNextWindowPos(ImVec2(0,0)) are probably not what you want anymore.
|
||||
you may use GetMainViewport()->Pos to offset hard-coded positions, e.g. SetNextWindowPos(GetMainViewport()->Pos)
|
||||
- likewise io.MousePos and GetMousePos() will use OS coordinates.
|
||||
If you query mouse positions to interact with non-imgui coordinates you will need to offset them, e.g. subtract GetWindowViewport()->Pos.
|
||||
- 2018/XX/XX (1.XX) - Moved IME support functions from io.ImeSetInputScreenPosFn, io.ImeWindowHandle to the PlatformIO api.
|
||||
- 2019/XX/XX (1.XX) - Moved IME support functions from io.ImeSetInputScreenPosFn, io.ImeWindowHandle to the PlatformIO api.
|
||||
|
||||
|
||||
- 2019/06/07 (1.71) - rendering of child window outer decorations (bg color, border, scrollbars) is now performed as part of the parent window. If you have
|
||||
overlapping child windows in a same parent, and relied on their relative z-order to be mapped to their submission order, this will affect your rendering.
|
||||
This optimization is disabled if the parent window has no visual output, because it appears to be the most common situation leading to the creation of overlapping child windows.
|
||||
Please reach out if you are affected.
|
||||
- 2019/05/13 (1.71) - renamed SetNextTreeNodeOpen() to SetNextItemOpen(). Kept inline redirection function (will obsolete).
|
||||
- 2019/05/11 (1.71) - changed io.AddInputCharacter(unsigned short c) signature to io.AddInputCharacter(unsigned int c).
|
||||
- 2019/04/29 (1.70) - improved ImDrawList thick strokes (>1.0f) preserving correct thickness up to 90 degrees angles (e.g. rectangles). If you have custom rendering using thick lines, they will appear thicker now.
|
||||
@ -606,7 +610,7 @@ CODE
|
||||
longer name "Dear ImGui" that people can use to refer to this specific library.
|
||||
Please try to refer to this library as "Dear ImGui".
|
||||
|
||||
Q: How can I tell whether to dispatch mouse/keyboard to imgui or to my application?
|
||||
Q: How can I tell whether to dispatch mouse/keyboard to Dear ImGui or to my application?
|
||||
A: You can read the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags from the ImGuiIO structure (e.g. if (ImGui::GetIO().WantCaptureMouse) { ... } )
|
||||
- When 'io.WantCaptureMouse' is set, imgui wants to use your mouse state, and you may want to discard/hide the inputs from the rest of your application.
|
||||
- When 'io.WantCaptureKeyboard' is set, imgui wants to use your keyboard state, and you may want to discard/hide the inputs from the rest of your application.
|
||||
@ -2463,6 +2467,60 @@ void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, cons
|
||||
LogRenderedText(&pos_min, text, text_display_end);
|
||||
}
|
||||
|
||||
|
||||
// Another overly complex function until we reorganize everything into a nice all-in-one helper.
|
||||
// This is made more complex because we have dissociated the layout rectangle (pos_min..pos_max) which define _where_ the ellipsis is, from actual clipping of text and limit of the ellipsis display.
|
||||
// This is because in the context of tabs we selectively hide part of the text when the Close Button appears, but we don't want the ellipsis to move.
|
||||
void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float clip_max_x, float ellipsis_max_x, const char* text, const char* text_end_full, const ImVec2* text_size_if_known)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (text_end_full == NULL)
|
||||
text_end_full = FindRenderedTextEnd(text);
|
||||
const ImVec2 text_size = text_size_if_known ? *text_size_if_known : CalcTextSize(text, text_end_full, false, 0.0f);
|
||||
|
||||
if (text_size.x > pos_max.x - pos_min.x)
|
||||
{
|
||||
// Hello wo...
|
||||
// | | |
|
||||
// min max ellipsis_max
|
||||
// <-> this is generally some padding value
|
||||
|
||||
// FIXME-STYLE: RenderPixelEllipsis() style should use actual font data.
|
||||
const ImFont* font = draw_list->_Data->Font;
|
||||
const float font_size = draw_list->_Data->FontSize;
|
||||
const int ellipsis_dot_count = 3;
|
||||
const float ellipsis_width = (1.0f + 1.0f) * ellipsis_dot_count - 1.0f;
|
||||
const char* text_end_ellipsis = NULL;
|
||||
|
||||
float text_width = ImMax((pos_max.x - ellipsis_width) - pos_min.x, 1.0f);
|
||||
float text_size_clipped_x = font->CalcTextSizeA(font_size, text_width, 0.0f, text, text_end_full, &text_end_ellipsis).x;
|
||||
if (text == text_end_ellipsis && text_end_ellipsis < text_end_full)
|
||||
{
|
||||
// Always display at least 1 character if there's no room for character + ellipsis
|
||||
text_end_ellipsis = text + ImTextCountUtf8BytesFromChar(text, text_end_full);
|
||||
text_size_clipped_x = font->CalcTextSizeA(font_size, FLT_MAX, 0.0f, text, text_end_ellipsis).x;
|
||||
}
|
||||
while (text_end_ellipsis > text && ImCharIsBlankA(text_end_ellipsis[-1]))
|
||||
{
|
||||
// Trim trailing space before ellipsis
|
||||
text_end_ellipsis--;
|
||||
text_size_clipped_x -= font->CalcTextSizeA(font_size, FLT_MAX, 0.0f, text_end_ellipsis, text_end_ellipsis + 1).x; // Ascii blanks are always 1 byte
|
||||
}
|
||||
RenderTextClippedEx(draw_list, pos_min, ImVec2(clip_max_x, pos_max.y), text, text_end_ellipsis, &text_size, ImVec2(0.0f, 0.0f));
|
||||
|
||||
const float ellipsis_x = pos_min.x + text_size_clipped_x + 1.0f;
|
||||
if (ellipsis_x + ellipsis_width - 1.0f <= ellipsis_max_x)
|
||||
RenderPixelEllipsis(draw_list, ImVec2(ellipsis_x, pos_min.y), GetColorU32(ImGuiCol_Text), ellipsis_dot_count);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderTextClippedEx(draw_list, pos_min, ImVec2(clip_max_x, pos_max.y), text, text_end_full, &text_size, ImVec2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
if (g.LogEnabled)
|
||||
LogRenderedText(&pos_min, text, text_end_full);
|
||||
}
|
||||
|
||||
// Render a rectangle shaped with optional rounding and borders
|
||||
void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding)
|
||||
{
|
||||
@ -2490,13 +2548,11 @@ void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding)
|
||||
}
|
||||
|
||||
// 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
|
||||
void ImGui::RenderArrow(ImVec2 p_min, ImGuiDir dir, float scale)
|
||||
void ImGui::RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
|
||||
const float h = g.FontSize * 1.00f;
|
||||
const float h = draw_list->_Data->FontSize * 1.00f;
|
||||
float r = h * 0.40f * scale;
|
||||
ImVec2 center = p_min + ImVec2(h * 0.50f, h * 0.50f * scale);
|
||||
ImVec2 center = pos + ImVec2(h * 0.50f, h * 0.50f * scale);
|
||||
|
||||
ImVec2 a, b, c;
|
||||
switch (dir)
|
||||
@ -2520,15 +2576,12 @@ void ImGui::RenderArrow(ImVec2 p_min, ImGuiDir dir, float scale)
|
||||
IM_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
g.CurrentWindow->DrawList->AddTriangleFilled(center + a, center + b, center + c, GetColorU32(ImGuiCol_Text));
|
||||
draw_list->AddTriangleFilled(center + a, center + b, center + c, col);
|
||||
}
|
||||
|
||||
void ImGui::RenderBullet(ImVec2 pos)
|
||||
void ImGui::RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
window->DrawList->AddCircleFilled(pos, g.FontSize*0.20f, GetColorU32(ImGuiCol_Text), 8);
|
||||
draw_list->AddCircleFilled(pos, draw_list->_Data->FontSize * 0.20f, col, 8);
|
||||
}
|
||||
|
||||
void ImGui::RenderCheckMark(ImVec2 pos, ImU32 col, float sz)
|
||||
@ -2682,6 +2735,14 @@ ImGuiID ImGuiWindow::GetID(const void* ptr)
|
||||
return id;
|
||||
}
|
||||
|
||||
ImGuiID ImGuiWindow::GetID(int n)
|
||||
{
|
||||
ImGuiID seed = IDStack.back();
|
||||
ImGuiID id = ImHashData(&n, sizeof(n), seed);
|
||||
ImGui::KeepAliveID(id);
|
||||
return id;
|
||||
}
|
||||
|
||||
ImGuiID ImGuiWindow::GetIDNoKeepAlive(const char* str, const char* str_end)
|
||||
{
|
||||
ImGuiID seed = IDStack.back();
|
||||
@ -2694,6 +2755,12 @@ ImGuiID ImGuiWindow::GetIDNoKeepAlive(const void* ptr)
|
||||
return ImHashData(&ptr, sizeof(void*), seed);
|
||||
}
|
||||
|
||||
ImGuiID ImGuiWindow::GetIDNoKeepAlive(int n)
|
||||
{
|
||||
ImGuiID seed = IDStack.back();
|
||||
return ImHashData(&n, sizeof(n), seed);
|
||||
}
|
||||
|
||||
// This is only used in rare/specific situations to manufacture an ID out of nowhere.
|
||||
ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)
|
||||
{
|
||||
@ -3100,7 +3167,7 @@ const char* ImGui::GetVersion()
|
||||
return IMGUI_VERSION;
|
||||
}
|
||||
|
||||
// Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
|
||||
// Internal state access - if you want to share Dear ImGui state between modules (e.g. DLL) or allocate it yourself
|
||||
// Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module
|
||||
ImGuiContext* ImGui::GetCurrentContext()
|
||||
{
|
||||
@ -3556,13 +3623,13 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags()
|
||||
if (!mouse_avail_to_imgui && !mouse_dragging_extern_payload)
|
||||
g.HoveredWindow = g.HoveredRootWindow = g.HoveredWindowUnderMovingWindow = NULL;
|
||||
|
||||
// Update io.WantCaptureMouse for the user application (true = dispatch mouse info to imgui, false = dispatch mouse info to imgui + app)
|
||||
// Update io.WantCaptureMouse for the user application (true = dispatch mouse info to imgui, false = dispatch mouse info to Dear ImGui + app)
|
||||
if (g.WantCaptureMouseNextFrame != -1)
|
||||
g.IO.WantCaptureMouse = (g.WantCaptureMouseNextFrame != 0);
|
||||
else
|
||||
g.IO.WantCaptureMouse = (mouse_avail_to_imgui && (g.HoveredWindow != NULL || mouse_any_down)) || (!g.OpenPopupStack.empty());
|
||||
|
||||
// Update io.WantCaptureKeyboard for the user application (true = dispatch keyboard info to imgui, false = dispatch keyboard info to imgui + app)
|
||||
// Update io.WantCaptureKeyboard for the user application (true = dispatch keyboard info to imgui, false = dispatch keyboard info to Dear ImGui + app)
|
||||
if (g.WantCaptureKeyboardNextFrame != -1)
|
||||
g.IO.WantCaptureKeyboard = (g.WantCaptureKeyboardNextFrame != 0);
|
||||
else
|
||||
@ -3890,7 +3957,7 @@ void ImGui::Shutdown(ImGuiContext* context)
|
||||
}
|
||||
g.IO.Fonts = NULL;
|
||||
|
||||
// Cleanup of other data are conditional on actually having initialized ImGui.
|
||||
// Cleanup of other data are conditional on actually having initialized Dear ImGui.
|
||||
if (!g.Initialized)
|
||||
return;
|
||||
|
||||
@ -3972,7 +4039,7 @@ static void AddWindowToSortBuffer(ImVector<ImGuiWindow*>* out_sorted_windows, Im
|
||||
{
|
||||
int count = window->DC.ChildWindows.Size;
|
||||
if (count > 1)
|
||||
ImQsort(window->DC.ChildWindows.begin(), (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer);
|
||||
ImQsort(window->DC.ChildWindows.Data, (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
ImGuiWindow* child = window->DC.ChildWindows[i];
|
||||
@ -6114,10 +6181,39 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha * 0.25f), g.Style.WindowRounding);
|
||||
}
|
||||
|
||||
// Since 1.71, child window can render their decoration (bg color, border, scrollbars, etc.) within their parent to save a draw call.
|
||||
// When using overlapping child windows, this will break the assumption that child z-order is mapped to submission order.
|
||||
// We disable this when the parent window has zero vertices, which is a common pattern leading to laying out multiple overlapping child.
|
||||
// We also disabled this when we have dimming overlay behind this specific one child.
|
||||
// FIXME: More code may rely on explicit sorting of overlapping child window and would need to disable this somehow. Please get in contact if you are affected.
|
||||
bool render_decorations_in_parent = false;
|
||||
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !window_is_child_tooltip)
|
||||
if (window->DrawList->CmdBuffer.back().ElemCount == 0 && parent_window->DrawList->VtxBuffer.Size > 0)
|
||||
render_decorations_in_parent = true;
|
||||
if (render_decorations_in_parent)
|
||||
window->DrawList = parent_window->DrawList;
|
||||
|
||||
const ImGuiWindow* window_to_highlight = g.NavWindowingTarget ? g.NavWindowingTarget : g.NavWindow;
|
||||
const bool title_bar_is_highlight = want_focus || (window_to_highlight && (window->RootWindowForTitleBarHighlight == window_to_highlight->RootWindowForTitleBarHighlight || (window->DockNode && window->DockNode == window_to_highlight->DockNode)));
|
||||
RenderWindowDecorations(window, title_bar_rect, title_bar_is_highlight, handle_borders_and_resize_grips, resize_grip_count, resize_grip_col, resize_grip_draw_size);
|
||||
|
||||
if (render_decorations_in_parent)
|
||||
window->DrawList = &window->DrawListInst;
|
||||
|
||||
// Draw navigation selection/windowing rectangle border
|
||||
if (g.NavWindowingTargetAnim == window)
|
||||
{
|
||||
float rounding = ImMax(window->WindowRounding, g.Style.WindowRounding);
|
||||
ImRect bb = window->Rect();
|
||||
bb.Expand(g.FontSize);
|
||||
if (bb.Contains(viewport_rect)) // If a window fits the entire viewport, adjust its highlight inward
|
||||
{
|
||||
bb.Expand(-g.FontSize - 1.0f);
|
||||
rounding = window->WindowRounding;
|
||||
}
|
||||
window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), rounding, ~0, 3.0f);
|
||||
}
|
||||
|
||||
// UPDATE RECTANGLES (2- THOSE AFFECTED BY SCROLLING)
|
||||
|
||||
// Work rectangle.
|
||||
@ -7481,9 +7577,8 @@ void ImGui::PushID(const void* ptr_id)
|
||||
|
||||
void ImGui::PushID(int int_id)
|
||||
{
|
||||
const void* ptr_id = (void*)(intptr_t)int_id;
|
||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||
window->IDStack.push_back(window->GetIDNoKeepAlive(ptr_id));
|
||||
window->IDStack.push_back(window->GetIDNoKeepAlive(int_id));
|
||||
}
|
||||
|
||||
// Push a given id value ignoring the ID stack as a seed.
|
||||
@ -7941,7 +8036,7 @@ bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags)
|
||||
}
|
||||
|
||||
// If 'p_open' is specified for a modal popup window, the popup will have a regular close button which will close the popup.
|
||||
// Note that popup visibility status is owned by imgui (and manipulated with e.g. OpenPopup) so the actual value of *p_open is meaningless here.
|
||||
// Note that popup visibility status is owned by Dear ImGui (and manipulated with e.g. OpenPopup) so the actual value of *p_open is meaningless here.
|
||||
bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
@ -14542,8 +14637,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
||||
ImRect vtxs_rect;
|
||||
for (int i = elem_offset; i < elem_offset + (int)pcmd->ElemCount; i++)
|
||||
vtxs_rect.Add(draw_list->VtxBuffer[idx_buffer ? idx_buffer[i] : i].pos);
|
||||
clip_rect.Floor(); fg_draw_list->AddRect(clip_rect.Min, clip_rect.Max, IM_COL32(255,255,0,255));
|
||||
vtxs_rect.Floor(); fg_draw_list->AddRect(vtxs_rect.Min, vtxs_rect.Max, IM_COL32(255,0,255,255));
|
||||
clip_rect.Floor(); fg_draw_list->AddRect(clip_rect.Min, clip_rect.Max, IM_COL32(255,0,255,255));
|
||||
vtxs_rect.Floor(); fg_draw_list->AddRect(vtxs_rect.Min, vtxs_rect.Max, IM_COL32(255,255,0,255));
|
||||
}
|
||||
if (!pcmd_node_open)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user