Преглед на файлове

Tests shell: Add single (non-blocking) render loop

Michael Ragazzon преди 1 месец
родител
ревизия
8c77a51da7
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 2 2
      Tests/Source/Common/TestsShell.cpp
  2. 1 1
      Tests/Source/Common/TestsShell.h

+ 2 - 2
Tests/Source/Common/TestsShell.cpp

@@ -141,7 +141,7 @@ void TestsShell::PresentFrame()
 		Backend::PresentFrame();
 }
 
-void TestsShell::RenderLoop()
+void TestsShell::RenderLoop(bool block_until_escape)
 {
 	REQUIRE(shell_context);
 
@@ -150,7 +150,7 @@ void TestsShell::RenderLoop()
 		bool running = true;
 		while (running)
 		{
-			running = Backend::ProcessEvents(shell_context, &Shell::ProcessKeyDownShortcuts);
+			running = Backend::ProcessEvents(shell_context, &Shell::ProcessKeyDownShortcuts) && block_until_escape;
 			shell_context->Update();
 			BeginFrame();
 			shell_context->Render();

+ 1 - 1
Tests/Source/Common/TestsShell.h

@@ -47,7 +47,7 @@ void PresentFrame();
 // Render the current state of the context. Press 'escape' or 'return' to break out of the loop.
 // Useful for viewing documents while building the RML to benchmark.
 // Applies only when compiled with the shell backend.
-void RenderLoop();
+void RenderLoop(bool block_until_escape = true);
 
 void ShutdownShell(bool reset_tests_render_interface = true);