From f7ccf7e5a789f7443a09350ca12d9e89baf80893 Mon Sep 17 00:00:00 2001 From: Lunkhound Date: Tue, 20 Dec 2016 01:14:08 -0800 Subject: [PATCH] example browser: restore on-screen text --- .../CommonRigidBodyMTBase.cpp | 26 ++++++++++++++----- .../MultiThreadedDemo/CommonRigidBodyMTBase.h | 16 +++--------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/examples/MultiThreadedDemo/CommonRigidBodyMTBase.cpp b/examples/MultiThreadedDemo/CommonRigidBodyMTBase.cpp index 8375489ee..5a17ba8c2 100644 --- a/examples/MultiThreadedDemo/CommonRigidBodyMTBase.cpp +++ b/examples/MultiThreadedDemo/CommonRigidBodyMTBase.cpp @@ -774,13 +774,9 @@ void CommonRigidBodyMTBase::createDefaultParameters() } } -void CommonRigidBodyMTBase::physicsDebugDraw(int debugFlags) + +void CommonRigidBodyMTBase::drawScreenText() { - if (m_dynamicsWorld && m_dynamicsWorld->getDebugDrawer()) - { - m_dynamicsWorld->getDebugDrawer()->setDebugMode(debugFlags); - m_dynamicsWorld->debugDrawWorld(); - } char msg[ 1024 ]; int xCoord = 400; int yCoord = 30; @@ -866,3 +862,21 @@ void CommonRigidBodyMTBase::physicsDebugDraw(int debugFlags) } } + +void CommonRigidBodyMTBase::physicsDebugDraw(int debugFlags) +{ + if (m_dynamicsWorld && m_dynamicsWorld->getDebugDrawer()) + { + m_dynamicsWorld->getDebugDrawer()->setDebugMode(debugFlags); + m_dynamicsWorld->debugDrawWorld(); + } + drawScreenText(); +} + + +void CommonRigidBodyMTBase::renderScene() +{ + m_guiHelper->syncPhysicsToGraphics(m_dynamicsWorld); + m_guiHelper->render(m_dynamicsWorld); + drawScreenText(); +} diff --git a/examples/MultiThreadedDemo/CommonRigidBodyMTBase.h b/examples/MultiThreadedDemo/CommonRigidBodyMTBase.h index 7b19bdeaf..6ead77d19 100644 --- a/examples/MultiThreadedDemo/CommonRigidBodyMTBase.h +++ b/examples/MultiThreadedDemo/CommonRigidBodyMTBase.h @@ -52,6 +52,8 @@ struct CommonRigidBodyMTBase : public CommonExampleInterface } } + virtual void drawScreenText(); + virtual void renderScene(); virtual void physicsDebugDraw(int debugFlags); virtual void exitPhysics() @@ -418,19 +420,7 @@ struct CommonRigidBodyMTBase : public CommonExampleInterface return body; } - - virtual void renderScene() - { - { - - m_guiHelper->syncPhysicsToGraphics(m_dynamicsWorld); - } - - { - - m_guiHelper->render(m_dynamicsWorld); - } - } + }; #endif //#define COMMON_RIGID_BODY_MT_BASE_H