| 425 | } |
| 426 | |
| 427 | void openFileDemo(const char* filename) |
| 428 | { |
| 429 | deleteDemo(); |
| 430 | |
| 431 | s_guiHelper = new OpenGLGuiHelper(s_app, sUseOpenGL2); |
| 432 | s_guiHelper->setVisualizerFlagCallback(OpenGLExampleBrowserVisualizerFlagCallback); |
| 433 | |
| 434 | s_parameterInterface->removeAllParameters(); |
| 435 | |
| 436 | CommonExampleOptions options(s_guiHelper, 1); |
| 437 | options.m_fileName = filename; |
| 438 | char fullPath[1024]; |
| 439 | sprintf(fullPath, "%s", filename); |
| 440 | b3FileUtils::toLower(fullPath); |
| 441 | |
| 442 | for (int i = 0; i < gFileImporterByExtension.size(); i++) |
| 443 | { |
| 444 | if (strstr(fullPath, gFileImporterByExtension[i].m_extension.c_str())) |
| 445 | { |
| 446 | sCurrentDemo = gFileImporterByExtension[i].m_createFunc(options); |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | if (sCurrentDemo) |
| 451 | { |
| 452 | sCurrentDemo->initPhysics(); |
| 453 | sCurrentDemo->resetCamera(); |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | void selectDemo(int demoIndex) |
| 458 | { |
no test coverage detected