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

Function CUSTOM_MAIN

app/main.cpp:43–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41#endif
42
43CUSTOM_MAIN(context)
44{
45 vkb::filesystem::init_with_context(context);
46
47#if defined(PLATFORM__ANDROID)
48 vkb::AndroidPlatform platform{context};
49#elif defined(PLATFORM__WINDOWS)
50 vkb::WindowsPlatform platform{context};
51#elif defined(PLATFORM__LINUX_D2D)
52 vkb::UnixD2DPlatform platform{context};
53#elif defined(PLATFORM__LINUX)
54 vkb::UnixPlatform platform{context, vkb::UnixType::Linux};
55#elif defined(PLATFORM__MACOS) && !(TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE)
56 vkb::UnixPlatform platform{context, vkb::UnixType::Mac};
57#elif (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE)
58 vkb::IosPlatform platform{context};
59#else
60# error "Platform not supported"
61#endif
62
63 auto code = platform.initialize(plugins::get_all());
64
65 if (code == vkb::ExitCode::Success)
66 {
67 code = platform.main_loop();
68 }
69
70 platform.terminate(code);
71
72 return 0;
73}

Callers

nothing calls this directly

Calls 4

init_with_contextFunction · 0.85
main_loopMethod · 0.80
initializeMethod · 0.45
terminateMethod · 0.45

Tested by

no test coverage detected