Merge pull request #583 from erwincoumans/master

fixes in SharedMemory unit test, premake build issue on Linux
This commit is contained in:
erwincoumans 2016-03-15 19:08:27 -07:00
commit bc0717e3de
3 changed files with 21 additions and 14 deletions

View File

@ -189,3 +189,9 @@ project "App_BulletExampleBrowser"
"main.cpp",
"ExampleEntries.cpp",
}
if os.is("Linux") then
initX11()
end

View File

@ -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",
}
if os.is("Linux") then
initX11()
end

View File

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