MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / main

Function main

Demos/BarDemo/main.cpp:41–75  ·  view source on GitHub ↗

main

Source from the content-addressed store, hash-verified

39
40// main
41int 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
77void reset()
78{

Callers

nothing calls this directly

Calls 7

setModelMethod · 0.80
buildModelFunction · 0.70
resetFunction · 0.70
initMethod · 0.45
createParameterGUIMethod · 0.45
cleanupMethod · 0.45

Tested by

no test coverage detected