main
| 39 | |
| 40 | // main |
| 41 | int main( int argc, char **argv ) |
| 42 | { |
| 43 | REPORT_MEMORY_LEAKS |
| 44 | |
| 45 | base = new DemoBase(); |
| 46 | base->init(argc, argv, "Bar demo"); |
| 47 | |
| 48 | SimulationModel *model = new SimulationModel(); |
| 49 | model->init(); |
| 50 | Simulation::getCurrent()->setModel(model); |
| 51 | |
| 52 | buildModel(); |
| 53 | |
| 54 | base->createParameterGUI(); |
| 55 | |
| 56 | // reset simulation when solid simulation method has changed |
| 57 | model->setSolidSimulationMethodChangedCallback([&]() { reset(); }); |
| 58 | |
| 59 | // OpenGL |
| 60 | MiniGL::setClientIdleFunc (timeStep); |
| 61 | MiniGL::addKeyFunc('r', reset); |
| 62 | MiniGL::setClientSceneFunc(render); |
| 63 | MiniGL::setViewport (40.0f, 0.1f, 500.0f, Vector3r (5.0, 10.0, 30.0), Vector3r (5.0, 0.0, 0.0)); |
| 64 | MiniGL::mainLoop(); |
| 65 | base->cleanup(); |
| 66 | |
| 67 | Utilities::Timing::printAverageTimes(); |
| 68 | Utilities::Timing::printTimeSums(); |
| 69 | |
| 70 | delete Simulation::getCurrent(); |
| 71 | delete base; |
| 72 | delete model; |
| 73 | |
| 74 | return 0; |
| 75 | } |
| 76 | |
| 77 | void reset() |
| 78 | { |
nothing calls this directly
no test coverage detected