Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-10-13 20:31:47 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-10-13 20:31:47 +0300
commitc89c4f46ea108e825365faeeb3e8453703f2b981 (patch)
tree8b10a71798ee51b1d6fae09a75e50b3a86d79487 /profiler
parent575f627136631804475dd9bcd00b225fd1c67053 (diff)
Hook up attention callback.
Diffstat (limited to 'profiler')
-rw-r--r--profiler/src/main.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp
index e792714d..3b2569e0 100644
--- a/profiler/src/main.cpp
+++ b/profiler/src/main.cpp
@@ -105,6 +105,11 @@ static void SetWindowTitleCallback( const char* title )
s_customTitle = true;
}
+static void AttentionCallback()
+{
+ bptr->Attention();
+}
+
static void DrawContents();
void RunOnMainThread( std::function<void()> cb, bool forceDelay = false )
@@ -233,12 +238,12 @@ int main( int argc, char** argv )
if( initFileOpen )
{
- view = std::make_unique<tracy::View>( RunOnMainThread, *initFileOpen, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback );
+ view = std::make_unique<tracy::View>( RunOnMainThread, *initFileOpen, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback );
initFileOpen.reset();
}
else if( connectTo )
{
- view = std::make_unique<tracy::View>( RunOnMainThread, connectTo, port, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback );
+ view = std::make_unique<tracy::View>( RunOnMainThread, connectTo, port, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback );
}
tracy::Fileselector::Init();
@@ -570,11 +575,11 @@ static void DrawContents()
{
std::string addrPart = std::string( addr, ptr );
uint16_t portPart = (uint16_t)atoi( ptr+1 );
- view = std::make_unique<tracy::View>( RunOnMainThread, addrPart.c_str(), portPart, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback );
+ view = std::make_unique<tracy::View>( RunOnMainThread, addrPart.c_str(), portPart, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback );
}
else
{
- view = std::make_unique<tracy::View>( RunOnMainThread, addr, port, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback );
+ view = std::make_unique<tracy::View>( RunOnMainThread, addr, port, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback );
}
}
ImGui::SameLine( 0, ImGui::GetTextLineHeight() * 2 );
@@ -591,7 +596,7 @@ static void DrawContents()
loadThread = std::thread( [f] {
try
{
- view = std::make_unique<tracy::View>( RunOnMainThread, *f, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback );
+ view = std::make_unique<tracy::View>( RunOnMainThread, *f, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback );
}
catch( const tracy::UnsupportedVersion& e )
{
@@ -716,7 +721,7 @@ static void DrawContents()
}
if( selected && !loadThread.joinable() )
{
- view = std::make_unique<tracy::View>( RunOnMainThread, v.second.address.c_str(), v.second.port, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback );
+ view = std::make_unique<tracy::View>( RunOnMainThread, v.second.address.c_str(), v.second.port, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback );
}
ImGui::NextColumn();
const auto acttime = ( v.second.activeTime + ( time - v.second.time ) / 1000 ) * 1000000000ll;
@@ -885,7 +890,7 @@ static void DrawContents()
viewShutdown.store( ViewShutdown::False, std::memory_order_relaxed );
if( reconnect )
{
- view = std::make_unique<tracy::View>( RunOnMainThread, reconnectAddr.c_str(), reconnectPort, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback );
+ view = std::make_unique<tracy::View>( RunOnMainThread, reconnectAddr.c_str(), reconnectPort, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback );
}
break;
default: