From 375d7097e40ca58ae157bc1af3c0759f2129c8c7 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 23 Dec 2020 10:42:25 -0800 Subject: [PATCH] don't postpone release for remote visualizer (otherwise it blocks forever) --- examples/CommonInterfaces/CommonGUIHelperInterface.h | 1 + examples/SharedMemory/PhysicsServerExample.cpp | 4 ++-- examples/SharedMemory/RemoteGUIHelperTCP.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/CommonInterfaces/CommonGUIHelperInterface.h b/examples/CommonInterfaces/CommonGUIHelperInterface.h index 4ba413ef5..eb4e0c76f 100644 --- a/examples/CommonInterfaces/CommonGUIHelperInterface.h +++ b/examples/CommonInterfaces/CommonGUIHelperInterface.h @@ -123,6 +123,7 @@ struct GUIHelperInterface virtual void dumpFramesToVideo(const char* mp4FileName){}; virtual void drawDebugDrawerLines(){} virtual void clearLines(){} + virtual bool isRemoteVisualizer() { return false; } }; ///the DummyGUIHelper does nothing, so we can test the examples without GUI/graphics (in 'console mode') diff --git a/examples/SharedMemory/PhysicsServerExample.cpp b/examples/SharedMemory/PhysicsServerExample.cpp index 172c0030f..3a33be95d 100644 --- a/examples/SharedMemory/PhysicsServerExample.cpp +++ b/examples/SharedMemory/PhysicsServerExample.cpp @@ -2156,8 +2156,8 @@ void PhysicsServerExample::updateGraphics() m_multiThreadedHelper->m_childGuiHelper->setVisualizerFlag(m_multiThreadedHelper->m_visualizerFlag, m_multiThreadedHelper->m_visualizerEnable); - //postpone the release until an actual frame is rendered - if (flag == COV_ENABLE_SINGLE_STEP_RENDERING) + //postpone the release until an actual frame is rendered, unless it is a remote visualizer + if ((!m_multiThreadedHelper->m_childGuiHelper->isRemoteVisualizer()) && flag == COV_ENABLE_SINGLE_STEP_RENDERING) { m_multiThreadedHelper->getCriticalSection()->setSharedParam(1, eGUIHelperSetVisualizerFlagCheckRenderedFrame); } diff --git a/examples/SharedMemory/RemoteGUIHelperTCP.h b/examples/SharedMemory/RemoteGUIHelperTCP.h index 606eab581..8a4458ee2 100644 --- a/examples/SharedMemory/RemoteGUIHelperTCP.h +++ b/examples/SharedMemory/RemoteGUIHelperTCP.h @@ -70,6 +70,7 @@ struct RemoteGUIHelperTCP : public GUIHelperInterface virtual void removeAllUserDebugItems(); int uploadData(const unsigned char* data, int sizeInBytes, int slot); + virtual bool isRemoteVisualizer() { return true; } }; #endif //REMOTE_HELPER_TCP_H