example browser: restore on-screen text

This commit is contained in:
Lunkhound 2016-12-20 01:14:08 -08:00
parent 1deb3c1666
commit f7ccf7e5a7
2 changed files with 23 additions and 19 deletions

View File

@ -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();
}

View File

@ -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