@ -375,6 +375,7 @@ CODE
- 2018 / XX / XX ( 1. XX ) - Moved IME support functions from io . ImeSetInputScreenPosFn , io . ImeWindowHandle to the PlatformIO api .
- 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 / 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 ) .
@ -885,7 +886,8 @@ CODE
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 )
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 ( 1 overlay per viewport ) .
- You can call ImGui : : GetBackgroundDrawList ( ) or ImGui : : GetForegroundDrawList ( ) and use those draw list to display
contents behind or over every other imgui windows . ( 1 bg / fg drawlist per viewport )
- 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 .
@ -3133,33 +3135,51 @@ int ImGui::GetFrameCount()
return GImGui - > FrameCount ;
}
ImDrawList * ImGui : : GetOverlayDrawList ( ImGuiViewport * viewport_public )
static ImDrawList * GetViewportDrawList ( ImGuiViewportP * viewport , size_t drawlist_no , const char * drawlist_name )
{
// Create the draw list on demand, because it is not frequently used for all viewports
// Create the draw list on demand, because they are not frequently used for all viewports
ImGuiContext & g = * GImGui ;
ImGuiViewportP * viewport = ( ImGuiViewportP * ) viewport_public ;
if ( viewport - > OverlayDrawList = = NULL )
IM_ASSERT ( drawlist_no > = 0 & & drawlist_no < IM_ARRAYSIZE ( viewport - > DrawLists ) ) ;
ImDrawList * draw_list = viewport - > DrawLists [ drawlist_no ] ;
if ( draw_list = = NULL )
{
viewport - > OverlayDrawList = IM_NEW ( ImDrawList ) ( & g . DrawListSharedData ) ;
viewport - > OverlayDrawList - > _OwnerName = " ##Overlay " ;
draw_list = IM_NEW ( ImDrawList ) ( & g . DrawListSharedData ) ;
draw_list - > _OwnerName = drawlist_name ;
viewport - > DrawLists [ drawlist_no ] = draw_list ;
}
// Our ImDrawList system requires that there is always a command
if ( viewport - > LastFrame OverlayDrawList ! = g . FrameCount )
if ( viewport - > LastFrame DrawLists[ drawlist_no ] ! = g . FrameCount )
{
viewport- > OverlayDrawL ist- > Clear ( ) ;
viewport- > OverlayDrawL ist- > PushTextureID ( g . IO . Fonts - > TexID ) ;
viewport- > OverlayDrawL ist- > PushClipRect ( viewport - > Pos , viewport - > Pos + viewport - > Size , false ) ;
viewport- > OverlayDrawL ist- > Flags = ( g . Style . AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0 ) | ( g . Style . AntiAliasedFill ? ImDrawListFlags_AntiAliasedFill : 0 ) ;
viewport - > LastFrame OverlayDrawList = g . FrameCount ;
draw_l ist- > Clear ( ) ;
draw_l ist- > PushTextureID ( g . IO . Fonts - > TexID ) ;
draw_l ist- > PushClipRect ( viewport - > Pos , viewport - > Pos + viewport - > Size , false ) ;
draw_l ist- > Flags = ( g . Style . AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0 ) | ( g . Style . AntiAliasedFill ? ImDrawListFlags_AntiAliasedFill : 0 ) ;
viewport - > LastFrame DrawLists[ drawlist_no ] = g . FrameCount ;
}
return viewport- > OverlayDrawL ist;
return draw_l ist;
}
ImDrawList * ImGui : : GetOverlayDrawList ( )
ImDrawList * ImGui : : GetBackgroundDrawList ( ImGuiViewport * viewport )
{
return GetViewportDrawList ( ( ImGuiViewportP * ) viewport , 0 , " ##Background " ) ;
}
ImDrawList * ImGui : : GetBackgroundDrawList ( )
{
ImGuiWindow * window = GImGui - > CurrentWindow ;
return GetBackgroundDrawList ( window - > Viewport ) ;
}
ImDrawList * ImGui : : GetForegroundDrawList ( ImGuiViewport * viewport )
{
return GetViewportDrawList ( ( ImGuiViewportP * ) viewport , 1 , " ##Foreground " ) ;
}
ImDrawList * ImGui : : GetForegroundDrawList ( )
{
ImGuiWindow * window = GImGui - > CurrentWindow ;
return GetOverlayDrawList ( window - > Viewport ) ;
return Get Foreground DrawList( window - > Viewport ) ;
}
ImDrawListSharedData * ImGui : : GetDrawListSharedData ( )
@ -3589,7 +3609,6 @@ void ImGui::NewFrame()
g . DrawListSharedData . ClipRectFullscreen = ImVec4 ( 0.0f , 0.0f , virtual_space_max . x , virtual_space_max . y ) ;
g . DrawListSharedData . CurveTessellationTol = g . Style . CurveTessellationTol ;
// Setup Overlay draw list for the viewport.
// Mark rendering data as invalid to prevent user who may have a handle on it to use it.
for ( int n = 0 ; n < g . Viewports . Size ; n + + )
{
@ -3985,7 +4004,7 @@ static void ImGui::EndFrameDrawDimmedBackgrounds()
continue ;
if ( g . NavWindowingTargetAnim & & viewport = = g . NavWindowingTargetAnim - > Viewport )
continue ;
ImDrawList * draw_list = Get Overlay DrawList( viewport ) ;
ImDrawList * draw_list = Get Foreground DrawList( viewport ) ;
const ImU32 dim_bg_col = GetColorU32 ( dim_bg_for_modal ? ImGuiCol_ModalWindowDimBg : ImGuiCol_NavWindowingDimBg , g . DimBgRatio ) ;
draw_list - > AddRectFilled ( viewport - > Pos , viewport - > Pos + viewport - > Size , dim_bg_col ) ;
}
@ -4131,7 +4150,13 @@ void ImGui::Render()
// Gather ImDrawList to render (for each active window)
g . IO . MetricsRenderVertices = g . IO . MetricsRenderIndices = g . IO . MetricsRenderWindows = 0 ;
for ( int n = 0 ; n ! = g . Viewports . Size ; n + + )
g . Viewports [ n ] - > DrawDataBuilder . Clear ( ) ;
{
ImGuiViewportP * viewport = g . Viewports [ n ] ;
viewport - > DrawDataBuilder . Clear ( ) ;
if ( viewport - > DrawLists [ 0 ] ! = NULL )
AddDrawListToDrawData ( & viewport - > DrawDataBuilder . Layers [ 0 ] , GetBackgroundDrawList ( viewport ) ) ;
}
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 [ 1 ] = g . NavWindowingTarget ? g . NavWindowingList : NULL ;
@ -4155,8 +4180,8 @@ void ImGui::Render()
{
ImGuiViewportP * viewport = g . Viewports [ n ] ;
viewport - > DrawDataBuilder . FlattenIntoSingleLayer ( ) ;
if ( viewport - > Overlay DrawList ! = NULL )
AddDrawListToDrawData ( & viewport - > DrawDataBuilder . Layers [ 0 ] , Get Overlay DrawList( viewport ) ) ;
if ( viewport - > DrawLists[ 1 ] ! = NULL )
AddDrawListToDrawData ( & viewport - > DrawDataBuilder . Layers [ 0 ] , Get Foreground DrawList( viewport ) ) ;
SetupViewportDrawData ( viewport , & viewport - > DrawDataBuilder . Layers [ 0 ] ) ;
g . IO . MetricsRenderVertices + = viewport - > DrawData - > TotalVtxCount ;
g . IO . MetricsRenderIndices + = viewport - > DrawData - > TotalIdxCount ;
@ -5055,7 +5080,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 ) ;
bool hovered , held ;
ButtonBehavior ( resize_rect , window - > GetID ( ( void * ) ( intptr_t ) resize_grip_n ) , & hovered , & held , ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus ) ;
//Get Overlay DrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255));
//Get Foreground DrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255));
if ( hovered | | held )
g . MouseCursor = ( resize_grip_n & 1 ) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE ;
@ -5080,7 +5105,7 @@ static void ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_au
bool hovered , held ;
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 ) ;
//Get OverlayDrawList (window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255));
//Get ForegroundDrawLists (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 )
{
g . MouseCursor = ( border_n & 1 ) ? ImGuiMouseCursor_ResizeEW : ImGuiMouseCursor_ResizeNS ;
@ -7620,8 +7645,8 @@ bool ImGui::BeginPopupContextVoid(const char* str_id, int mouse_button)
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 ) ;
//G ImGui->OverlayDrawList. AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255,0,0,255));
//G ImGui->OverlayDrawList. AddRect(r_outer.Min, r_outer.Max, IM_COL32(0,255,0,255));
//G etForegroundDrawList()-> AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255,0,0,255));
//G etForegroundDrawList()-> AddRect(r_outer.Min, r_outer.Max, IM_COL32(0,255,0,255));
// Combo Box policy (we want a connecting edge)
if ( policy = = ImGuiPopupPositionPolicy_ComboBox )
@ -8544,7 +8569,7 @@ static bool NavScoreItem(ImGuiNavMoveResult* result, ImRect cand)
if ( ImGui : : IsMouseHoveringRect ( cand . Min , cand . Max ) )
{
ImFormatString ( buf , IM_ARRAYSIZE ( buf ) , " dbox (%.2f,%.2f->%.4f) \n dcen (%.2f,%.2f->%.4f) \n d (%.2f,%.2f->%.4f) \n nav %c, quadrant %c " , dbx , dby , dist_box , dcx , dcy , dist_center , dax , day , dist_axial , " WENS " [ g . NavMoveDir ] , " WENS " [ quadrant ] ) ;
ImDrawList * draw_list = ImGui : : Get Overlay DrawList( window ) ;
ImDrawList * draw_list = ImGui : : Get Foreground DrawList( window ) ;
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 - > AddRectFilled ( cand . Max - ImVec2 ( 4 , 4 ) , cand . Max + ImGui : : CalcTextSize ( buf ) + ImVec2 ( 4 , 4 ) , IM_COL32 ( 40 , 0 , 0 , 150 ) ) ;
@ -8556,7 +8581,7 @@ static bool NavScoreItem(ImGuiNavMoveResult* result, ImRect cand)
if ( quadrant = = g . NavMoveDir )
{
ImFormatString ( buf , IM_ARRAYSIZE ( buf ) , " %.0f/%.0f " , dist_box , dist_center ) ;
ImDrawList * draw_list = ImGui : : Get Overlay DrawList( window ) ;
ImDrawList * draw_list = ImGui : : Get Foreground DrawList( window ) ;
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 ) ;
}
@ -8862,7 +8887,7 @@ ImVec2 ImGui::GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInput
static void NavScrollToBringItemIntoView ( ImGuiWindow * window , const ImRect & item_rect )
{
ImRect window_rect ( window - > InnerMainRect . Min - ImVec2 ( 1 , 1 ) , window - > InnerMainRect . Max + ImVec2 ( 1 , 1 ) ) ;
//Get Overlay DrawList(window)->AddRect(window_rect.Min, window_rect.Max, IM_COL32_WHITE); // [DEBUG]
//Get Foreground DrawList(window)->AddRect(window_rect.Min, window_rect.Max, IM_COL32_WHITE); // [DEBUG]
if ( window_rect . Contains ( item_rect ) )
return ;
@ -9152,11 +9177,15 @@ static void ImGui::NavUpdate()
g . NavScoringRectScreen . Min . x = ImMin ( g . NavScoringRectScreen . Min . x + 1.0f , g . NavScoringRectScreen . Max . 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().
// 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 ;
# 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
}
@ -12309,9 +12338,9 @@ static void ImGui::DockNodePreviewDockRender(ImGuiWindow* host_window, ImGuiDock
// In case the two windows involved are on different viewports, we will draw the overlay on each of them.
int overlay_draw_lists_count = 0 ;
ImDrawList * overlay_draw_lists [ 2 ] ;
overlay_draw_lists [ overlay_draw_lists_count + + ] = Get Overlay DrawList( host_window - > Viewport ) ;
overlay_draw_lists [ overlay_draw_lists_count + + ] = Get Foreground DrawList( host_window - > Viewport ) ;
if ( host_window - > Viewport ! = root_payload - > Viewport & & ! is_transparent_payload )
overlay_draw_lists [ overlay_draw_lists_count + + ] = Get Overlay DrawList( root_payload - > Viewport ) ;
overlay_draw_lists [ overlay_draw_lists_count + + ] = Get Foreground DrawList( root_payload - > Viewport ) ;
// Draw main preview rectangle
const ImU32 overlay_col_tabs = GetColorU32 ( ImGuiCol_TabActive ) ;
@ -12586,7 +12615,7 @@ void ImGui::DockNodeTreeUpdateSplitter(ImGuiDockNode* node)
bb . Max = child_1 - > Pos ;
bb . Min [ axis ] + = child_0 - > Size [ axis ] ;
bb . Max [ axis ^ 1 ] + = child_1 - > Size [ axis ^ 1 ] ;
//if (g.IO.KeyCtrl) Get Overlay DrawList(g.CurrentWindow->Viewport)->AddRect(bb.Min, bb.Max, IM_COL32(255,0,255,255));
//if (g.IO.KeyCtrl) Get Foreground DrawList(g.CurrentWindow->Viewport)->AddRect(bb.Min, bb.Max, IM_COL32(255,0,255,255));
if ( node - > Flags & ImGuiDockNodeFlags_NoResize )
{
@ -13830,9 +13859,9 @@ void ImGui::ShowMetricsWindow(bool* p_open)
return ;
}
ImDrawList * overlay_draw_list = viewport ? GetOverlay DrawList( viewport ) : NULL ; // Render additional visuals into the top-most draw list
if ( window & & overlay _draw_list & & ImGui : : IsItemHovered ( ) )
overlay _draw_list- > AddRect ( window - > Pos , window - > Pos + window - > Size , IM_COL32 ( 255 , 255 , 0 , 255 ) ) ;
ImDrawList * fg_draw_list = viewport ? GetForeground DrawList( viewport ) : NULL ; // Render additional visuals into the top-most draw list
if ( window & & fg _draw_list & & ImGui : : IsItemHovered ( ) )
fg _draw_list- > AddRect ( window - > Pos , window - > Pos + window - > Size , IM_COL32 ( 255 , 255 , 0 , 255 ) ) ;
if ( ! node_open )
return ;
@ -13848,14 +13877,14 @@ void ImGui::ShowMetricsWindow(bool* p_open)
}
ImDrawIdx * idx_buffer = ( draw_list - > IdxBuffer . Size > 0 ) ? draw_list - > IdxBuffer . Data : NULL ;
bool pcmd_node_open = ImGui : : TreeNode ( ( void * ) ( pcmd - draw_list - > CmdBuffer . begin ( ) ) , " Draw %4d %s vtx, tex 0x%p, clip_rect (%4.0f,%4.0f)-(%4.0f,%4.0f) " , pcmd - > ElemCount , draw_list - > IdxBuffer . Size > 0 ? " indexed " : " non-indexed " , pcmd - > TextureId , pcmd - > ClipRect . x , pcmd - > ClipRect . y , pcmd - > ClipRect . z , pcmd - > ClipRect . w ) ;
if ( show_draw_cmd_clip_rects & & overlay _draw_list & & ImGui : : IsItemHovered ( ) )
if ( show_draw_cmd_clip_rects & & fg _draw_list & & ImGui : : IsItemHovered ( ) )
{
ImRect clip_rect = pcmd - > ClipRect ;
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 ( ) ; 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 )
continue ;
@ -13877,12 +13906,12 @@ void ImGui::ShowMetricsWindow(bool* p_open)
( n = = 0 ) ? " idx " : " " , idx_i , v . pos . x , v . pos . y , v . uv . x , v . uv . y , v . col ) ;
}
ImGui : : Selectable ( buf , false ) ;
if ( overlay _draw_list & & ImGui : : IsItemHovered ( ) )
if ( fg _draw_list & & 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 ( ) ;
@ -14033,11 +14062,10 @@ void ImGui::ShowMetricsWindow(bool* p_open)
ImGuiWindow * window = g . Windows [ n ] ;
if ( ! window - > WasActive | | ( ( window - > Flags & ImGuiWindowFlags_ChildWindow ) & & window - > DockNode = = NULL ) )
continue ;
char buf [ 64 ] = " " ;
char * p = buf ;
p + = ImFormatString ( p , buf + IM_ARRAYSIZE ( buf ) - p , " Order: %d \n " , window - > BeginOrderWithinContext ) ;
ImDrawList * overlay_draw_list = Get Overlay DrawList( window - > Viewport ) ;
ImDrawList * overlay_draw_list = Get Foreground DrawList( window - > Viewport ) ;
overlay_draw_list - > AddRectFilled ( window - > Pos - ImVec2 ( 1 , 1 ) , window - > Pos + CalcTextSize ( buf ) + ImVec2 ( 1 , 1 ) , IM_COL32 ( 200 , 100 , 100 , 255 ) ) ;
overlay_draw_list - > AddText ( NULL , 0.0f , window - > Pos , IM_COL32 ( 255 , 255 , 255 , 255 ) , buf ) ;
}
@ -14177,7 +14205,7 @@ void ImGui::ShowDockingDebug()
continue ;
char buf [ 64 ] = " " ;
char * p = buf ;
ImDrawList * overlay_draw_list = node - > HostWindow ? Get OverlayDrawList( node - > HostWindow ) : GetOverlay DrawList( ( ImGuiViewportP * ) GetMainViewport ( ) ) ;
ImDrawList * overlay_draw_list = node - > HostWindow ? Get ForegroundDrawList( node - > HostWindow ) : GetForeground DrawList( ( ImGuiViewportP * ) GetMainViewport ( ) ) ;
p + = ImFormatString ( p , buf + IM_ARRAYSIZE ( buf ) - p , " DockId: %X%s \n " , node - > ID , node - > IsCentralNode ? " *CentralNode* " : " " ) ;
p + = ImFormatString ( p , buf + IM_ARRAYSIZE ( buf ) - p , " Size: (%.0f, %.0f) \n " , node - > Size . x , node - > Size . y ) ;
p + = ImFormatString ( p , buf + IM_ARRAYSIZE ( buf ) - p , " SizeRef: (%.0f, %.0f) \n " , node - > SizeRef . x , node - > SizeRef . y ) ;