From 5394fd5dd5edbd3d14e263b7883a40c2193ee296 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Tue, 8 Apr 2025 15:56:08 -0500 Subject: cube: Only count non-minimized frames --- cube/cube.cpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'cube/cube.cpp') diff --git a/cube/cube.cpp b/cube/cube.cpp index 1d462b0e..24f7b3f0 100644 --- a/cube/cube.cpp +++ b/cube/cube.cpp @@ -3081,7 +3081,9 @@ void Demo::run() { } draw(); - curFrame++; + if (!is_minimized) { + curFrame++; + } if (frameCount != UINT32_MAX && curFrame == frameCount) { PostQuitMessage(validation_error); @@ -3231,7 +3233,9 @@ void Demo::run() { } draw(); - curFrame++; + if (!is_minimized) { + curFrame++; + } if (frameCount != UINT32_MAX && curFrame == frameCount) { quit = true; @@ -3302,7 +3306,9 @@ void Demo::run() { } draw(); - curFrame++; + if (!is_minimized) { + curFrame++; + } if (frameCount != UINT32_MAX && curFrame == frameCount) { quit = true; } @@ -3352,7 +3358,9 @@ void Demo::run() { } else { wl_display_dispatch_pending(wayland_display); draw(); - curFrame++; + if (!is_minimized) { + curFrame++; + } if (frameCount != UINT32_MAX && curFrame == frameCount) { quit = true; } @@ -3465,7 +3473,9 @@ void Demo::run() { if (!event_buffer->GetEvent(event_buffer, DFB_EVENT(&event))) handle_directfb_event(&event); draw(); - curFrame++; + if (!is_minimized) { + curFrame++; + } if (frameCount != UINT32_MAX && curFrame == frameCount) { quit = true; } @@ -3515,7 +3525,9 @@ void Demo::create_window() { template <> void Demo::run() { draw(); - curFrame++; + if (!is_minimized) { + curFrame++; + } if (frameCount != UINT32_MAX && curFrame == frameCount) { quit = true; } @@ -3730,7 +3742,9 @@ void Demo::run() { } else { update_data_buffer(); draw(); - curFrame++; + if (!is_minimized) { + curFrame++; + } if (frameCount != UINT32_MAX && curFrame == frameCount) { quit = true; } @@ -3900,7 +3914,9 @@ void Demo::run() { draw(); - curFrame++; + if (!is_minimized) { + curFrame++; + } elapsed_frames++; if (frameCount != UINT32_MAX && curFrame == frameCount) { -- cgit v1.2.3