| 50 | #endif //_WIN32 |
| 51 | |
| 52 | int main(int argc, char* argv[]) |
| 53 | { |
| 54 | #ifndef _WIN32 |
| 55 | struct sigaction action; |
| 56 | memset(&action, 0x0, sizeof(action)); |
| 57 | action.sa_handler = cleanup; |
| 58 | static const int signos[] = {SIGHUP, SIGINT, SIGQUIT, SIGABRT, SIGSEGV, SIGPIPE, SIGTERM}; |
| 59 | for (int ii(0); ii < sizeof(signos) / sizeof(*signos); ++ii) |
| 60 | { |
| 61 | if (0 != sigaction(signos[ii], &action, NULL)) |
| 62 | { |
| 63 | err(EXIT_FAILURE, "signal %d", signos[ii]); |
| 64 | } |
| 65 | } |
| 66 | #endif |
| 67 | |
| 68 | b3CommandLineArgs args(argc, argv); |
| 69 | |
| 70 | DummyGUIHelper noGfx; |
| 71 | |
| 72 | CommonExampleOptions options(&noGfx); |
| 73 | |
| 74 | args.GetCmdLineArgument("shared_memory_key", gSharedMemoryKey); |
| 75 | args.GetCmdLineArgument("sharedMemoryKey", gSharedMemoryKey); |
| 76 | |
| 77 | // options.m_option |= PHYSICS_SERVER_ENABLE_COMMAND_LOGGING; |
| 78 | // options.m_option |= PHYSICS_SERVER_REPLAY_FROM_COMMAND_LOG; |
| 79 | |
| 80 | example = (SharedMemoryCommon*)PhysicsServerCreateFuncBullet2(options); |
| 81 | |
| 82 | example->initPhysics(); |
| 83 | |
| 84 | while (example->isConnected() && !(example->wantsTermination() || interrupted)) |
| 85 | { |
| 86 | example->stepSimulation(1.f / 60.f); |
| 87 | } |
| 88 | |
| 89 | example->exitPhysics(); |
| 90 | |
| 91 | delete example; |
| 92 | |
| 93 | return 0; |
| 94 | } |
nothing calls this directly
no test coverage detected