add command-line argument for example browser and shared memory app, --shared_memory_key=<int>

fix some shared memory issues, client uses attach/detach, server uses create/remove shared memory
implement CMD_RESET_SIMULATION
This commit is contained in:
Erwin Coumans
2015-08-07 00:13:26 -07:00
parent f750275cf9
commit 03d991c92b
14 changed files with 373 additions and 56 deletions

View File

@@ -25,6 +25,7 @@ subject to the following restrictions:
#include <stdlib.h>
int gSharedMemoryKey = -1;
static SharedMemoryCommon* example = NULL;
static bool interrupted = false;
@@ -70,6 +71,8 @@ int main(int argc, char* argv[])
CommonExampleOptions options(&noGfx);
args.GetCmdLineArgument("shared_memory_key", gSharedMemoryKey);
if (args.CheckCmdLineFlag("client"))
{
example = (SharedMemoryCommon*)PhysicsClientCreateFunc(options);
@@ -78,6 +81,7 @@ int main(int argc, char* argv[])
example = (SharedMemoryCommon*)PhysicsServerCreateFunc(options);
}
example->initPhysics();
while (example->isConnected() && !(example->wantsTermination() || interrupted))
{