MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Tools / main

Function main

cube/cube.c:5112–5208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5110}
5111#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__QNX__) || defined(__GNU__)
5112int main(int argc, char **argv) {
5113 struct demo demo;
5114
5115 demo_init(&demo, argc, argv);
5116 switch (demo.wsi_platform) {
5117 default:
5118 case (WSI_PLATFORM_AUTO):
5119 fprintf(stderr,
5120 "WSI platform should have already been set, indicating a bug. Please set a WSI platform manually with "
5121 "--wsi\n");
5122 exit(1);
5123 break;
5124#if defined(VK_USE_PLATFORM_XCB_KHR)
5125 case (WSI_PLATFORM_XCB):
5126 demo_create_xcb_window(&demo);
5127 break;
5128#endif
5129#if defined(VK_USE_PLATFORM_XLIB_KHR)
5130 case (WSI_PLATFORM_XLIB):
5131 demo_create_xlib_window(&demo);
5132 break;
5133#endif
5134#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
5135 case (WSI_PLATFORM_WAYLAND):
5136 demo_create_wayland_window(&demo);
5137 break;
5138#endif
5139#if defined(VK_USE_PLATFORM_DIRECTFB_EXT)
5140 case (WSI_PLATFORM_DIRECTFB):
5141 demo_create_directfb_window(&demo);
5142 break;
5143#endif
5144#if defined(VK_USE_PLATFORM_SCREEN_QNX)
5145 case (WSI_PLATFORM_QNX):
5146 demo_create_screen_window(&demo);
5147 break;
5148#endif
5149#if defined(VK_USE_PLATFORM_DISPLAY_KHR)
5150 case (WSI_PLATFORM_DISPLAY):
5151 // select physical device because display surface creation needs a gpu to be selected.
5152 demo_select_physical_device(&demo);
5153 break;
5154#endif
5155 }
5156 demo_create_surface(&demo);
5157 if (demo.wsi_platform != WSI_PLATFORM_DISPLAY) {
5158 demo_select_physical_device(&demo);
5159 }
5160
5161 demo_init_vk_swapchain(&demo);
5162
5163 demo_prepare(&demo);
5164
5165 switch (demo.wsi_platform) {
5166 default:
5167 case (WSI_PLATFORM_AUTO):
5168 fprintf(stderr,
5169 "WSI platform should have already been set, indicating a bug. Please set a WSI platform manually with "

Callers

nothing calls this directly

Calls 15

demo_initFunction · 0.85
demo_create_xcb_windowFunction · 0.85
demo_create_xlib_windowFunction · 0.85
demo_create_surfaceFunction · 0.85
demo_init_vk_swapchainFunction · 0.85
demo_prepareFunction · 0.85
demo_run_xcbFunction · 0.85
demo_run_xlibFunction · 0.85

Tested by

no test coverage detected