|
@@ -364,6 +364,7 @@ CODE
|
|
|
When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
|
|
When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
|
|
|
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
|
|
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
|
|
|
|
|
|
|
|
|
|
+ - 2019/03/04 (1.69) - renamed GetOverlayDrawList() to GetForegroundDrawList(). Kept redirection function (will obsolete).
|
|
|
- 2019/02/26 (1.69) - renamed ImGuiColorEditFlags_RGB/ImGuiColorEditFlags_HSV/ImGuiColorEditFlags_HEX to ImGuiColorEditFlags_DisplayRGB/ImGuiColorEditFlags_DisplayHSV/ImGuiColorEditFlags_DisplayHex. Kept redirection enums (will obsolete).
|
|
- 2019/02/26 (1.69) - renamed ImGuiColorEditFlags_RGB/ImGuiColorEditFlags_HSV/ImGuiColorEditFlags_HEX to ImGuiColorEditFlags_DisplayRGB/ImGuiColorEditFlags_DisplayHSV/ImGuiColorEditFlags_DisplayHex. Kept redirection enums (will obsolete).
|
|
|
- 2019/02/14 (1.68) - made it illegal/assert when io.DisplayTime == 0.0f (with an exception for the first frame). If for some reason your time step calculation gives you a zero value, replace it with a dummy small value!
|
|
- 2019/02/14 (1.68) - made it illegal/assert when io.DisplayTime == 0.0f (with an exception for the first frame). If for some reason your time step calculation gives you a zero value, replace it with a dummy small value!
|
|
|
- 2019/02/01 (1.68) - removed io.DisplayVisibleMin/DisplayVisibleMax (which were marked obsolete and removed from viewport/docking branch already).
|
|
- 2019/02/01 (1.68) - removed io.DisplayVisibleMin/DisplayVisibleMax (which were marked obsolete and removed from viewport/docking branch already).
|
|
@@ -874,7 +875,8 @@ CODE
|
|
|
A: - You can create a dummy window. Call Begin() with the NoBackground | NoDecoration | NoSavedSettings | NoInputs flags.
|
|
A: - You can create a dummy window. Call Begin() with the NoBackground | NoDecoration | NoSavedSettings | NoInputs flags.
|
|
|
(The ImGuiWindowFlags_NoDecoration flag itself is a shortcut for NoTitleBar | NoResize | NoScrollbar | NoCollapse)
|
|
(The ImGuiWindowFlags_NoDecoration flag itself is a shortcut for NoTitleBar | NoResize | NoScrollbar | NoCollapse)
|
|
|
Then you can retrieve the ImDrawList* via GetWindowDrawList() and draw to it in any way you like.
|
|
Then you can retrieve the ImDrawList* via GetWindowDrawList() and draw to it in any way you like.
|
|
|
- - You can call ImGui::GetOverlayDrawList() and use this draw list to display contents over every other imgui windows.
|
|
|
|
|
|
|
+ - You can call ImGui::GetBackgroundDrawList() or ImGui::GetForegroundDrawList() and use those draw list to display
|
|
|
|
|
+ contents behind or over every other imgui windows.
|
|
|
- You can create your own ImDrawList instance. You'll need to initialize them ImGui::GetDrawListSharedData(), or create
|
|
- You can create your own ImDrawList instance. You'll need to initialize them ImGui::GetDrawListSharedData(), or create
|
|
|
your own ImDrawListSharedData, and then call your rendered code with your own ImDrawList or ImDrawData data.
|
|
your own ImDrawListSharedData, and then call your rendered code with your own ImDrawList or ImDrawData data.
|
|
|
|
|
|
|
@@ -3069,15 +3071,20 @@ int ImGui::GetFrameCount()
|
|
|
return GImGui->FrameCount;
|
|
return GImGui->FrameCount;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static ImDrawList* GetOverlayDrawList(ImGuiWindow*)
|
|
|
|
|
|
|
+ImDrawList* ImGui::GetBackgroundDrawList()
|
|
|
{
|
|
{
|
|
|
- // This seemingly unnecessary wrapper simplifies compatibility between the 'master' and 'viewport' branches.
|
|
|
|
|
- return &GImGui->OverlayDrawList;
|
|
|
|
|
|
|
+ return &GImGui->BackgroundDrawList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-ImDrawList* ImGui::GetOverlayDrawList()
|
|
|
|
|
|
|
+static ImDrawList* GetForegroundDrawList(ImGuiWindow*)
|
|
|
{
|
|
{
|
|
|
- return &GImGui->OverlayDrawList;
|
|
|
|
|
|
|
+ // This seemingly unnecessary wrapper simplifies compatibility between the 'master' and 'docking' branches.
|
|
|
|
|
+ return &GImGui->ForegroundDrawList;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+ImDrawList* ImGui::GetForegroundDrawList()
|
|
|
|
|
+{
|
|
|
|
|
+ return &GImGui->ForegroundDrawList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ImDrawListSharedData* ImGui::GetDrawListSharedData()
|
|
ImDrawListSharedData* ImGui::GetDrawListSharedData()
|
|
@@ -3424,10 +3431,15 @@ void ImGui::NewFrame()
|
|
|
g.DrawListSharedData.ClipRectFullscreen = ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
|
|
g.DrawListSharedData.ClipRectFullscreen = ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
|
|
|
g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol;
|
|
g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol;
|
|
|
|
|
|
|
|
- g.OverlayDrawList.Clear();
|
|
|
|
|
- g.OverlayDrawList.PushTextureID(g.IO.Fonts->TexID);
|
|
|
|
|
- g.OverlayDrawList.PushClipRectFullScreen();
|
|
|
|
|
- g.OverlayDrawList.Flags = (g.Style.AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0) | (g.Style.AntiAliasedFill ? ImDrawListFlags_AntiAliasedFill : 0);
|
|
|
|
|
|
|
+ g.BackgroundDrawList.Clear();
|
|
|
|
|
+ g.BackgroundDrawList.PushTextureID(g.IO.Fonts->TexID);
|
|
|
|
|
+ g.BackgroundDrawList.PushClipRectFullScreen();
|
|
|
|
|
+ g.BackgroundDrawList.Flags = (g.Style.AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0) | (g.Style.AntiAliasedFill ? ImDrawListFlags_AntiAliasedFill : 0);
|
|
|
|
|
+
|
|
|
|
|
+ g.ForegroundDrawList.Clear();
|
|
|
|
|
+ g.ForegroundDrawList.PushTextureID(g.IO.Fonts->TexID);
|
|
|
|
|
+ g.ForegroundDrawList.PushClipRectFullScreen();
|
|
|
|
|
+ g.ForegroundDrawList.Flags = (g.Style.AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0) | (g.Style.AntiAliasedFill ? ImDrawListFlags_AntiAliasedFill : 0);
|
|
|
|
|
|
|
|
// Mark rendering data as invalid to prevent user who may have a handle on it to use it.
|
|
// Mark rendering data as invalid to prevent user who may have a handle on it to use it.
|
|
|
g.DrawData.Clear();
|
|
g.DrawData.Clear();
|
|
@@ -3605,7 +3617,8 @@ void ImGui::Shutdown(ImGuiContext* context)
|
|
|
g.OpenPopupStack.clear();
|
|
g.OpenPopupStack.clear();
|
|
|
g.BeginPopupStack.clear();
|
|
g.BeginPopupStack.clear();
|
|
|
g.DrawDataBuilder.ClearFreeMemory();
|
|
g.DrawDataBuilder.ClearFreeMemory();
|
|
|
- g.OverlayDrawList.ClearFreeMemory();
|
|
|
|
|
|
|
+ g.BackgroundDrawList.ClearFreeMemory();
|
|
|
|
|
+ g.ForegroundDrawList.ClearFreeMemory();
|
|
|
g.PrivateClipboard.clear();
|
|
g.PrivateClipboard.clear();
|
|
|
g.InputTextState.ClearFreeMemory();
|
|
g.InputTextState.ClearFreeMemory();
|
|
|
|
|
|
|
@@ -3862,6 +3875,9 @@ void ImGui::Render()
|
|
|
// Gather ImDrawList to render (for each active window)
|
|
// Gather ImDrawList to render (for each active window)
|
|
|
g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = g.IO.MetricsRenderWindows = 0;
|
|
g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = g.IO.MetricsRenderWindows = 0;
|
|
|
g.DrawDataBuilder.Clear();
|
|
g.DrawDataBuilder.Clear();
|
|
|
|
|
+ if (!g.BackgroundDrawList.VtxBuffer.empty())
|
|
|
|
|
+ AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.BackgroundDrawList);
|
|
|
|
|
+
|
|
|
ImGuiWindow* windows_to_render_front_most[2];
|
|
ImGuiWindow* windows_to_render_front_most[2];
|
|
|
windows_to_render_front_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
|
|
windows_to_render_front_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
|
|
|
windows_to_render_front_most[1] = g.NavWindowingTarget ? g.NavWindowingList : NULL;
|
|
windows_to_render_front_most[1] = g.NavWindowingTarget ? g.NavWindowingList : NULL;
|
|
@@ -3878,10 +3894,10 @@ void ImGui::Render()
|
|
|
|
|
|
|
|
// Draw software mouse cursor if requested
|
|
// Draw software mouse cursor if requested
|
|
|
if (g.IO.MouseDrawCursor)
|
|
if (g.IO.MouseDrawCursor)
|
|
|
- RenderMouseCursor(&g.OverlayDrawList, g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor);
|
|
|
|
|
|
|
+ RenderMouseCursor(&g.ForegroundDrawList, g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor);
|
|
|
|
|
|
|
|
- if (!g.OverlayDrawList.VtxBuffer.empty())
|
|
|
|
|
- AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.OverlayDrawList);
|
|
|
|
|
|
|
+ if (!g.ForegroundDrawList.VtxBuffer.empty())
|
|
|
|
|
+ AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.ForegroundDrawList);
|
|
|
|
|
|
|
|
// Setup ImDrawData structure for end-user
|
|
// Setup ImDrawData structure for end-user
|
|
|
SetupDrawData(&g.DrawDataBuilder.Layers[0], &g.DrawData);
|
|
SetupDrawData(&g.DrawDataBuilder.Layers[0], &g.DrawData);
|
|
@@ -4726,7 +4742,7 @@ static void ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_au
|
|
|
if (resize_rect.Min.y > resize_rect.Max.y) ImSwap(resize_rect.Min.y, resize_rect.Max.y);
|
|
if (resize_rect.Min.y > resize_rect.Max.y) ImSwap(resize_rect.Min.y, resize_rect.Max.y);
|
|
|
bool hovered, held;
|
|
bool hovered, held;
|
|
|
ButtonBehavior(resize_rect, window->GetID((void*)(intptr_t)resize_grip_n), &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus);
|
|
ButtonBehavior(resize_rect, window->GetID((void*)(intptr_t)resize_grip_n), &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus);
|
|
|
- //GetOverlayDrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255));
|
|
|
|
|
|
|
+ //GetForegroundDrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255));
|
|
|
if (hovered || held)
|
|
if (hovered || held)
|
|
|
g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE;
|
|
g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE;
|
|
|
|
|
|
|
@@ -4751,7 +4767,7 @@ static void ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_au
|
|
|
bool hovered, held;
|
|
bool hovered, held;
|
|
|
ImRect border_rect = GetResizeBorderRect(window, border_n, grip_hover_inner_size, WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS);
|
|
ImRect border_rect = GetResizeBorderRect(window, border_n, grip_hover_inner_size, WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS);
|
|
|
ButtonBehavior(border_rect, window->GetID((void*)(intptr_t)(border_n + 4)), &hovered, &held, ImGuiButtonFlags_FlattenChildren);
|
|
ButtonBehavior(border_rect, window->GetID((void*)(intptr_t)(border_n + 4)), &hovered, &held, ImGuiButtonFlags_FlattenChildren);
|
|
|
- //GetOverlayDrawList(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255));
|
|
|
|
|
|
|
+ //GetForegroundDrawLists(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255));
|
|
|
if ((hovered && g.HoveredIdTimer > WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) || held)
|
|
if ((hovered && g.HoveredIdTimer > WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) || held)
|
|
|
{
|
|
{
|
|
|
g.MouseCursor = (border_n & 1) ? ImGuiMouseCursor_ResizeEW : ImGuiMouseCursor_ResizeNS;
|
|
g.MouseCursor = (border_n & 1) ? ImGuiMouseCursor_ResizeEW : ImGuiMouseCursor_ResizeNS;
|
|
@@ -7024,8 +7040,8 @@ ImRect ImGui::GetWindowAllowedExtentRect(ImGuiWindow*)
|
|
|
ImVec2 ImGui::FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy)
|
|
ImVec2 ImGui::FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy)
|
|
|
{
|
|
{
|
|
|
ImVec2 base_pos_clamped = ImClamp(ref_pos, r_outer.Min, r_outer.Max - size);
|
|
ImVec2 base_pos_clamped = ImClamp(ref_pos, r_outer.Min, r_outer.Max - size);
|
|
|
- //GImGui->OverlayDrawList.AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255,0,0,255));
|
|
|
|
|
- //GImGui->OverlayDrawList.AddRect(r_outer.Min, r_outer.Max, IM_COL32(0,255,0,255));
|
|
|
|
|
|
|
+ //GetForegroundDrawList()->AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255,0,0,255));
|
|
|
|
|
+ //GetForegroundDrawList()->AddRect(r_outer.Min, r_outer.Max, IM_COL32(0,255,0,255));
|
|
|
|
|
|
|
|
// Combo Box policy (we want a connecting edge)
|
|
// Combo Box policy (we want a connecting edge)
|
|
|
if (policy == ImGuiPopupPositionPolicy_ComboBox)
|
|
if (policy == ImGuiPopupPositionPolicy_ComboBox)
|
|
@@ -7224,7 +7240,7 @@ static bool NavScoreItem(ImGuiNavMoveResult* result, ImRect cand)
|
|
|
if (ImGui::IsMouseHoveringRect(cand.Min, cand.Max))
|
|
if (ImGui::IsMouseHoveringRect(cand.Min, cand.Max))
|
|
|
{
|
|
{
|
|
|
ImFormatString(buf, IM_ARRAYSIZE(buf), "dbox (%.2f,%.2f->%.4f)\ndcen (%.2f,%.2f->%.4f)\nd (%.2f,%.2f->%.4f)\nnav %c, quadrant %c", dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial, "WENS"[g.NavMoveDir], "WENS"[quadrant]);
|
|
ImFormatString(buf, IM_ARRAYSIZE(buf), "dbox (%.2f,%.2f->%.4f)\ndcen (%.2f,%.2f->%.4f)\nd (%.2f,%.2f->%.4f)\nnav %c, quadrant %c", dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial, "WENS"[g.NavMoveDir], "WENS"[quadrant]);
|
|
|
- ImDrawList* draw_list = ImGui::GetOverlayDrawList(window);
|
|
|
|
|
|
|
+ ImDrawList* draw_list = ImGui::GetForegroundDrawList(window);
|
|
|
draw_list->AddRect(curr.Min, curr.Max, IM_COL32(255,200,0,100));
|
|
draw_list->AddRect(curr.Min, curr.Max, IM_COL32(255,200,0,100));
|
|
|
draw_list->AddRect(cand.Min, cand.Max, IM_COL32(255,255,0,200));
|
|
draw_list->AddRect(cand.Min, cand.Max, IM_COL32(255,255,0,200));
|
|
|
draw_list->AddRectFilled(cand.Max-ImVec2(4,4), cand.Max+ImGui::CalcTextSize(buf)+ImVec2(4,4), IM_COL32(40,0,0,150));
|
|
draw_list->AddRectFilled(cand.Max-ImVec2(4,4), cand.Max+ImGui::CalcTextSize(buf)+ImVec2(4,4), IM_COL32(40,0,0,150));
|
|
@@ -7236,7 +7252,7 @@ static bool NavScoreItem(ImGuiNavMoveResult* result, ImRect cand)
|
|
|
if (quadrant == g.NavMoveDir)
|
|
if (quadrant == g.NavMoveDir)
|
|
|
{
|
|
{
|
|
|
ImFormatString(buf, IM_ARRAYSIZE(buf), "%.0f/%.0f", dist_box, dist_center);
|
|
ImFormatString(buf, IM_ARRAYSIZE(buf), "%.0f/%.0f", dist_box, dist_center);
|
|
|
- ImDrawList* draw_list = ImGui::GetOverlayDrawList(window);
|
|
|
|
|
|
|
+ ImDrawList* draw_list = ImGui::GetForegroundDrawList(window);
|
|
|
draw_list->AddRectFilled(cand.Min, cand.Max, IM_COL32(255, 0, 0, 200));
|
|
draw_list->AddRectFilled(cand.Min, cand.Max, IM_COL32(255, 0, 0, 200));
|
|
|
draw_list->AddText(g.IO.FontDefault, 13.0f, cand.Min, IM_COL32(255, 255, 255, 255), buf);
|
|
draw_list->AddText(g.IO.FontDefault, 13.0f, cand.Min, IM_COL32(255, 255, 255, 255), buf);
|
|
|
}
|
|
}
|
|
@@ -7542,7 +7558,7 @@ ImVec2 ImGui::GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInput
|
|
|
static void NavScrollToBringItemIntoView(ImGuiWindow* window, const ImRect& item_rect)
|
|
static void NavScrollToBringItemIntoView(ImGuiWindow* window, const ImRect& item_rect)
|
|
|
{
|
|
{
|
|
|
ImRect window_rect(window->InnerMainRect.Min - ImVec2(1, 1), window->InnerMainRect.Max + ImVec2(1, 1));
|
|
ImRect window_rect(window->InnerMainRect.Min - ImVec2(1, 1), window->InnerMainRect.Max + ImVec2(1, 1));
|
|
|
- //GetOverlayDrawList(window)->AddRect(window_rect.Min, window_rect.Max, IM_COL32_WHITE); // [DEBUG]
|
|
|
|
|
|
|
+ //GetForegroundDrawList(window)->AddRect(window_rect.Min, window_rect.Max, IM_COL32_WHITE); // [DEBUG]
|
|
|
if (window_rect.Contains(item_rect))
|
|
if (window_rect.Contains(item_rect))
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
@@ -7832,11 +7848,15 @@ static void ImGui::NavUpdate()
|
|
|
g.NavScoringRectScreen.Min.x = ImMin(g.NavScoringRectScreen.Min.x + 1.0f, g.NavScoringRectScreen.Max.x);
|
|
g.NavScoringRectScreen.Min.x = ImMin(g.NavScoringRectScreen.Min.x + 1.0f, g.NavScoringRectScreen.Max.x);
|
|
|
g.NavScoringRectScreen.Max.x = g.NavScoringRectScreen.Min.x;
|
|
g.NavScoringRectScreen.Max.x = g.NavScoringRectScreen.Min.x;
|
|
|
IM_ASSERT(!g.NavScoringRectScreen.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allows us to remove extraneous ImFabs() calls in NavScoreItem().
|
|
IM_ASSERT(!g.NavScoringRectScreen.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allows us to remove extraneous ImFabs() calls in NavScoreItem().
|
|
|
- //g.OverlayDrawList.AddRect(g.NavScoringRectScreen.Min, g.NavScoringRectScreen.Max, IM_COL32(255,200,0,255)); // [DEBUG]
|
|
|
|
|
|
|
+ //GetForegroundDrawList()->AddRect(g.NavScoringRectScreen.Min, g.NavScoringRectScreen.Max, IM_COL32(255,200,0,255)); // [DEBUG]
|
|
|
g.NavScoringCount = 0;
|
|
g.NavScoringCount = 0;
|
|
|
#if IMGUI_DEBUG_NAV_RECTS
|
|
#if IMGUI_DEBUG_NAV_RECTS
|
|
|
- if (g.NavWindow) { for (int layer = 0; layer < 2; layer++) GetOverlayDrawList(g.NavWindow)->AddRect(g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Min, g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Max, IM_COL32(255,200,0,255)); } // [DEBUG]
|
|
|
|
|
- if (g.NavWindow) { ImU32 col = (!g.NavWindow->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); GetOverlayDrawList(g.NavWindow)->AddCircleFilled(p, 3.0f, col); GetOverlayDrawList(g.NavWindow)->AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); }
|
|
|
|
|
|
|
+ if (g.NavWindow)
|
|
|
|
|
+ {
|
|
|
|
|
+ ImDrawList* draw_list = GetForegroundDrawList(g.NavWindow);
|
|
|
|
|
+ if (1) { for (int layer = 0; layer < 2; layer++) draw_list->AddRect(g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Min, g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Max, IM_COL32(255,200,0,255)); } // [DEBUG]
|
|
|
|
|
+ if (1) { ImU32 col = (!g.NavWindow->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); draw_list->AddCircleFilled(p, 3.0f, col); draw_list->AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); }
|
|
|
|
|
+ }
|
|
|
#endif
|
|
#endif
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -9343,9 +9363,9 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ImDrawList* overlay_draw_list = GetOverlayDrawList(window); // Render additional visuals into the top-most draw list
|
|
|
|
|
|
|
+ ImDrawList* fg_draw_list = GetForegroundDrawList(window); // Render additional visuals into the top-most draw list
|
|
|
if (window && IsItemHovered())
|
|
if (window && IsItemHovered())
|
|
|
- overlay_draw_list->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255));
|
|
|
|
|
|
|
+ fg_draw_list->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255));
|
|
|
if (!node_open)
|
|
if (!node_open)
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
@@ -9367,8 +9387,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
ImRect vtxs_rect;
|
|
ImRect vtxs_rect;
|
|
|
for (int i = elem_offset; i < elem_offset + (int)pcmd->ElemCount; i++)
|
|
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);
|
|
vtxs_rect.Add(draw_list->VtxBuffer[idx_buffer ? idx_buffer[i] : i].pos);
|
|
|
- clip_rect.Floor(); overlay_draw_list->AddRect(clip_rect.Min, clip_rect.Max, IM_COL32(255,255,0,255));
|
|
|
|
|
- vtxs_rect.Floor(); overlay_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,255,0,255));
|
|
|
|
|
+ vtxs_rect.Floor(); fg_draw_list->AddRect(vtxs_rect.Min, vtxs_rect.Max, IM_COL32(255,0,255,255));
|
|
|
}
|
|
}
|
|
|
if (!pcmd_node_open)
|
|
if (!pcmd_node_open)
|
|
|
continue;
|
|
continue;
|
|
@@ -9392,10 +9412,10 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
ImGui::Selectable(buf, false);
|
|
ImGui::Selectable(buf, false);
|
|
|
if (ImGui::IsItemHovered())
|
|
if (ImGui::IsItemHovered())
|
|
|
{
|
|
{
|
|
|
- ImDrawListFlags backup_flags = overlay_draw_list->Flags;
|
|
|
|
|
- overlay_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines at is more readable for very large and thin triangles.
|
|
|
|
|
- overlay_draw_list->AddPolyline(triangles_pos, 3, IM_COL32(255,255,0,255), true, 1.0f);
|
|
|
|
|
- overlay_draw_list->Flags = backup_flags;
|
|
|
|
|
|
|
+ ImDrawListFlags backup_flags = fg_draw_list->Flags;
|
|
|
|
|
+ fg_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines at is more readable for very large and thin triangles.
|
|
|
|
|
+ fg_draw_list->AddPolyline(triangles_pos, 3, IM_COL32(255,255,0,255), true, 1.0f);
|
|
|
|
|
+ fg_draw_list->Flags = backup_flags;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ImGui::TreePop();
|
|
ImGui::TreePop();
|
|
@@ -9532,9 +9552,9 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
char buf[32];
|
|
char buf[32];
|
|
|
ImFormatString(buf, IM_ARRAYSIZE(buf), "%d", window->BeginOrderWithinContext);
|
|
ImFormatString(buf, IM_ARRAYSIZE(buf), "%d", window->BeginOrderWithinContext);
|
|
|
float font_size = ImGui::GetFontSize() * 2;
|
|
float font_size = ImGui::GetFontSize() * 2;
|
|
|
- ImDrawList* overlay_draw_list = GetOverlayDrawList(window);
|
|
|
|
|
- overlay_draw_list->AddRectFilled(window->Pos, window->Pos + ImVec2(font_size, font_size), IM_COL32(200, 100, 100, 255));
|
|
|
|
|
- overlay_draw_list->AddText(NULL, font_size, window->Pos, IM_COL32(255, 255, 255, 255), buf);
|
|
|
|
|
|
|
+ ImDrawList* fg_draw_list = GetForegroundDrawList(window);
|
|
|
|
|
+ fg_draw_list->AddRectFilled(window->Pos, window->Pos + ImVec2(font_size, font_size), IM_COL32(200, 100, 100, 255));
|
|
|
|
|
+ fg_draw_list->AddText(NULL, font_size, window->Pos, IM_COL32(255, 255, 255, 255), buf);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ImGui::End();
|
|
ImGui::End();
|