From adcf785a4a9d71e02734f994a310a4511469fae8 Mon Sep 17 00:00:00 2001 From: erwin coumans Date: Fri, 7 May 2021 09:07:40 -0700 Subject: [PATCH] re-enable eGUIHelperSetRgbBackground --- .../SharedMemory/PhysicsServerExample.cpp | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/examples/SharedMemory/PhysicsServerExample.cpp b/examples/SharedMemory/PhysicsServerExample.cpp index d10c0e317..6613de42b 100644 --- a/examples/SharedMemory/PhysicsServerExample.cpp +++ b/examples/SharedMemory/PhysicsServerExample.cpp @@ -133,6 +133,7 @@ enum MultiThreadedGUIHelperCommunicationEnums eGUIUserDebugRemoveAllParameters, eGUIHelperResetCamera, eGUIHelperChangeGraphicsInstanceFlags, + eGUIHelperSetRgbBackground, }; #include @@ -1088,7 +1089,18 @@ public: workerThreadWait(); } - + double m_rgbBackground[3]; + virtual void setBackgroundColor(const double rgbBackground[3]) + { + m_cs->lock(); + m_rgbBackground[0] = rgbBackground[0]; + m_rgbBackground[1] = rgbBackground[1]; + m_rgbBackground[2] = rgbBackground[2]; + + setSharedParam(1, eGUIHelperSetRgbBackground); + workerThreadWait(); + + } int m_graphicsInstanceChangeScaling; @@ -2312,6 +2324,13 @@ void PhysicsServerExample::updateGraphics() break; } + case eGUIHelperSetRgbBackground: + { + m_multiThreadedHelper->m_childGuiHelper->setBackgroundColor(m_multiThreadedHelper->m_rgbBackground); + m_multiThreadedHelper->mainThreadRelease(); + break; + } + case eGUIHelperChangeGraphicsInstanceScaling: { B3_PROFILE("eGUIHelperChangeGraphicsInstanceScaling");