wait until a frame is rendered, when using the COV_ENABLE_SINGLE_STEP_RENDERING command (Windows and Linux only)

This commit is contained in:
erwincoumans
2018-09-15 14:22:31 -07:00
parent 81f6a63490
commit 0b08881ab8
2 changed files with 43 additions and 6 deletions

View File

@@ -393,7 +393,15 @@ void OpenGLExampleBrowserVisualizerFlagCallback(int flag, bool enable)
if (flag == COV_ENABLE_SINGLE_STEP_RENDERING)
{
singleStepSimulation = true;
if (enable)
{
gEnableRenderLoop = false;
singleStepSimulation = true;
} else
{
gEnableRenderLoop = true;
singleStepSimulation = false;
}
}
@@ -1235,7 +1243,7 @@ void OpenGLExampleBrowser::update(float deltaTime)
{
b3ChromeUtilsEnableProfiling();
if (!gEnableRenderLoop)
if (!gEnableRenderLoop && !singleStepSimulation)
{
sCurrentDemo->updateGraphics();
return;