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

Function wsi_from_string

cube/cube.c:313–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311} WSI_PLATFORM;
312
313WSI_PLATFORM wsi_from_string(const char *str) {
314 if (strcmp(str, "auto") == 0) return WSI_PLATFORM_AUTO;
315#if defined(VK_USE_PLATFORM_WIN32_KHR)
316 if (strcmp(str, "win32") == 0) return WSI_PLATFORM_WIN32;
317#endif
318#if defined(VK_USE_PLATFORM_METAL_EXT)
319 if (strcmp(str, "metal") == 0) return WSI_PLATFORM_METAL;
320#endif
321#if defined(VK_USE_PLATFORM_ANDROID_KHR)
322 if (strcmp(str, "android") == 0) return WSI_PLATFORM_ANDROID;
323#endif
324#if defined(VK_USE_PLATFORM_SCREEN_QNX)
325 if (strcmp(str, "qnx") == 0) return WSI_PLATFORM_QNX;
326#endif
327#if defined(VK_USE_PLATFORM_XCB_KHR)
328 if (strcmp(str, "xcb") == 0) return WSI_PLATFORM_XCB;
329#endif
330#if defined(VK_USE_PLATFORM_XLIB_KHR)
331 if (strcmp(str, "xlib") == 0) return WSI_PLATFORM_XLIB;
332#endif
333#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
334 if (strcmp(str, "wayland") == 0) return WSI_PLATFORM_WAYLAND;
335#endif
336#if defined(VK_USE_PLATFORM_DIRECTFB_EXT)
337 if (strcmp(str, "directfb") == 0) return WSI_PLATFORM_DIRECTFB;
338#endif
339#if defined(VK_USE_PLATFORM_DISPLAY_KHR)
340 if (strcmp(str, "display") == 0) return WSI_PLATFORM_DISPLAY;
341#endif
342 return WSI_PLATFORM_INVALID;
343};
344
345const char *wsi_to_string(WSI_PLATFORM wsi_platform) {
346 switch (wsi_platform) {

Callers 1

demo_initFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected