MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / start_app

Method start_app

framework/platform/platform.cpp:454–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454bool Platform::start_app()
455{
456 auto *requested_app_info = requested_app;
457 // Reset early incase error in preparation stage
458 requested_app = nullptr;
459
460 if (active_app)
461 {
462 auto execution_time = timer.stop();
463 LOGI("Closing App (Runtime: {:.1f})", execution_time);
464
465 auto app_id = active_app->get_name();
466
467 active_app->finish();
468 }
469
470 active_app = requested_app_info->create();
471
472 if (!active_app)
473 {
474 LOGE("Failed to create a valid vulkan app.");
475 return false;
476 }
477 auto sample_info = static_cast<const apps::SampleInfo *>(requested_app_info);
478 active_app->set_name(sample_info->name);
479
480 if (!active_app->prepare({fixed_simulation_fps, window.get()}))
481 {
482 LOGE("Failed to prepare vulkan app.");
483 return false;
484 }
485
486 on_app_start(requested_app_info->id);
487
488 return true;
489}
490
491void Platform::input_event(const InputEvent &input_event)
492{

Callers

nothing calls this directly

Calls 6

stopMethod · 0.80
get_nameMethod · 0.80
finishMethod · 0.45
set_nameMethod · 0.45
prepareMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected