diff --git a/examples/ExampleBrowser/premake4.lua b/examples/ExampleBrowser/premake4.lua index d66da5823..075306b73 100644 --- a/examples/ExampleBrowser/premake4.lua +++ b/examples/ExampleBrowser/premake4.lua @@ -189,3 +189,9 @@ project "App_BulletExampleBrowser" "main.cpp", "ExampleEntries.cpp", } + +if os.is("Linux") then + initX11() +end + + diff --git a/test/SharedMemory/premake4.lua b/test/SharedMemory/premake4.lua index 014802e04..15b0d8f72 100644 --- a/test/SharedMemory/premake4.lua +++ b/test/SharedMemory/premake4.lua @@ -9,6 +9,7 @@ project ("Test_SharedMemoryPhysicsClient") "Bullet3Common", "LinearMath" } + defines {"PHYSICS_SHARED_MEMORY"} files { "test.c", @@ -189,4 +190,8 @@ project ("Test_PhysicsServerInProcessExampleBrowser") "test.c", "../../examples/ExampleBrowser/ExampleEntries.cpp", } - \ No newline at end of file + if os.is("Linux") then + initX11() + end + + diff --git a/test/SharedMemory/test.c b/test/SharedMemory/test.c index f45d67840..6171acdff 100644 --- a/test/SharedMemory/test.c +++ b/test/SharedMemory/test.c @@ -1,5 +1,7 @@ //#include "SharedMemoryCommands.h" +#ifdef PHYSICS_SHARED_MEMORY #include "SharedMemory/PhysicsClientC_API.h" +#endif //PHYSICS_SHARED_MEMORY #ifdef PHYSICS_LOOP_BACK #include "SharedMemory/PhysicsLoopBackC_API.h" @@ -31,27 +33,21 @@ int main(int argc, char* argv[]) double timeStep = 1./60.; double startPosX, startPosY,startPosZ; int imuLinkIndex = -1; - - - b3PhysicsClientHandle sm=0; int bodyIndex = -1; - - - printf("hello world\n"); #ifdef PHYSICS_LOOP_BACK - sm = b3ConnectPhysicsLoopback(SHARED_MEMORY_KEY); + b3PhysicsClientHandle sm = b3ConnectPhysicsLoopback(SHARED_MEMORY_KEY); #endif #ifdef PHYSICS_SERVER_DIRECT - sm = b3ConnectPhysicsDirect(); + b3PhysicsClientHandle sm = b3ConnectPhysicsDirect(); #endif #ifdef PHYSICS_IN_PROCESS_EXAMPLE_BROWSER - sm = b3CreateInProcessPhysicsServerAndConnect(argc,argv); -#else - sm = b3ConnectSharedMemory(SHARED_MEMORY_KEY); -#endif //PHYSICS_SERVER_DIRECT - + b3PhysicsClientHandle sm = b3CreateInProcessPhysicsServerAndConnect(argc,argv); +#endif +#ifdef PHYSICS_SHARED_MEMORY + b3PhysicsClientHandle sm = b3ConnectSharedMemory(SHARED_MEMORY_KEY); +#endif //PHYSICS_SHARED_MEMORY if (b3CanSubmitCommand(sm))