mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 12:53:51 +00:00
Extract small color box drawing.
This commit is contained in:
parent
00409b0b94
commit
4ea62ecb06
@ -5,6 +5,8 @@
|
|||||||
# pragma warning( disable: 4244 ) // conversion from don't care to whatever, possible loss of data
|
# pragma warning( disable: 4244 ) // conversion from don't care to whatever, possible loss of data
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "../imgui/imgui.h"
|
#include "../imgui/imgui.h"
|
||||||
#include "../imgui/imgui_internal.h"
|
#include "../imgui/imgui_internal.h"
|
||||||
|
|
||||||
@ -65,6 +67,13 @@ namespace tracy
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void SmallColorBox( uint32_t color )
|
||||||
|
{
|
||||||
|
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) );
|
||||||
|
ImGui::ColorButton( "c1", ImVec4( (color & 0xFF) / 255.f, ((color>>8) & 0xFF ) / 255.f, ((color>>16) & 0xFF ) / 255.f, 1.f ), ImGuiColorEditFlags_NoTooltip );
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -5203,10 +5203,7 @@ void View::DrawZoneInfoWindow()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line );
|
ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) );
|
SmallColorBox( GetRawZoneColor( ev, tid, GetZoneDepth( ev, tid ) ) );
|
||||||
const auto col = GetRawZoneColor( ev, tid, GetZoneDepth( ev, tid ) );
|
|
||||||
ImGui::ColorButton( "c1", ImVec4( (col & 0xFF) / 255.f, ((col>>8) & 0xFF ) / 255.f, ((col>>16) & 0xFF ) / 255.f, 1.f ), ImGuiColorEditFlags_NoTooltip );
|
|
||||||
ImGui::PopStyleVar();
|
|
||||||
TextFocused( "Thread:", m_worker.GetThreadName( tid ) );
|
TextFocused( "Thread:", m_worker.GetThreadName( tid ) );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );
|
ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );
|
||||||
@ -5969,10 +5966,7 @@ void View::DrawGpuInfoWindow()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line );
|
ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) );
|
SmallColorBox( GetRawZoneColor( ev ) );
|
||||||
const auto col = GetRawZoneColor( ev );
|
|
||||||
ImGui::ColorButton( "c1", ImVec4( (col & 0xFF) / 255.f, ((col>>8) & 0xFF ) / 255.f, ((col>>16) & 0xFF ) / 255.f, 1.f ), ImGuiColorEditFlags_NoTooltip );
|
|
||||||
ImGui::PopStyleVar();
|
|
||||||
TextFocused( "Thread:", m_worker.GetThreadName( tid ) );
|
TextFocused( "Thread:", m_worker.GetThreadName( tid ) );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );
|
ImGui::TextDisabled( "(%s)", RealToString( tid, true ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user