exit gracefully and call destructor of the current active example

fflush after printf
implemented stepForward and Shutdown for the SharedMemory client/server
This commit is contained in:
=
2015-05-29 15:04:05 -07:00
parent ff15d36edf
commit bc806ab68c
10 changed files with 206 additions and 50 deletions

View File

@@ -20,8 +20,7 @@ subject to the following restrictions:
#include "../CommonInterfaces/CommonExampleInterface.h"
#include "../CommonInterfaces/CommonGUIHelperInterface.h"
#include "SharedMemoryCommon.h"
int main(int argc, char* argv[])
@@ -33,18 +32,22 @@ int main(int argc, char* argv[])
DummyGUIHelper noGfx;
CommonExampleOptions options(&noGfx);
CommonExampleInterface* example = 0;
SharedMemoryCommon* example = 0;
if (args.CheckCmdLineFlag("client"))
{
example = PhysicsClientCreateFunc(options);
example = (SharedMemoryCommon*)PhysicsClientCreateFunc(options);
}else
{
example = PhysicsServerCreateFunc(options);
example = (SharedMemoryCommon*)PhysicsServerCreateFunc(options);
}
example->initPhysics();
example->stepSimulation(1.f/60.f);
while (!example->wantsTermination())
{
example->stepSimulation(1.f/60.f);
}
example->exitPhysics();
delete example;