mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Disable screen redraw when there are no input events.
This commit is contained in:
parent
1e7c6e3f49
commit
232fb5aaa4
@ -269,6 +269,27 @@ static void DrawContents()
|
||||
|
||||
int display_w, display_h;
|
||||
bptr->NewFrame( display_w, display_h );
|
||||
|
||||
static int activeFrames = 3;
|
||||
auto& inputQueue = ImGui::GetCurrentContext()->InputEventsQueue;
|
||||
if( !inputQueue.empty() )
|
||||
{
|
||||
for( auto& v : inputQueue )
|
||||
{
|
||||
if( v.Type != ImGuiInputEventType_MouseViewport )
|
||||
{
|
||||
activeFrames = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( activeFrames == 0 )
|
||||
{
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 16 ) );
|
||||
return;
|
||||
}
|
||||
activeFrames--;
|
||||
|
||||
ImGui::NewFrame();
|
||||
tracy::MouseFrame();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user