aboutsummaryrefslogtreecommitdiff
path: root/demos/cube.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'demos/cube.cpp')
-rw-r--r--demos/cube.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/demos/cube.cpp b/demos/cube.cpp
index 87783954..b28476a5 100644
--- a/demos/cube.cpp
+++ b/demos/cube.cpp
@@ -29,6 +29,10 @@
#include <csignal>
#include <memory>
+#if defined(VK_USE_PLATFORM_MIR_KHR)
+#warning "Cubepp does not have code for Mir at this time"
+#endif
+
#define VULKAN_HPP_NO_EXCEPTIONS
#include <vulkan/vulkan.hpp>
#include <vulkan/vk_sdk_platform.h>
@@ -228,6 +232,7 @@ static void handle_announce_global_object_remove(
static const wl_registry_listener registry_listener = {
handle_announce_global_object, handle_announce_global_object_remove};
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
struct Demo {
@@ -249,6 +254,7 @@ struct Demo {
display{nullptr},
registry{nullptr}, compositor{nullptr}, window{nullptr},
shell{nullptr}, shell_surface{nullptr},
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
prepared{false}, use_staging_buffer{false}, use_xlib{false},
graphics_queue_family_index{0}, present_queue_family_index{0},
@@ -382,6 +388,7 @@ struct Demo {
wl_compositor_destroy(compositor);
wl_registry_destroy(registry);
wl_display_disconnect(display);
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
}
@@ -731,6 +738,7 @@ struct Demo {
registry = wl_display_get_registry(display);
wl_registry_add_listener(registry, &registry_listener, this);
wl_display_dispatch(display);
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
}
@@ -856,6 +864,7 @@ struct Demo {
extension_names[enabled_extension_count++] =
VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
}
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
assert(enabled_extension_count < 64);
}
@@ -898,6 +907,7 @@ struct Demo {
"Please look at the Getting Started guide for additional "
"information.\n",
"vkCreateInstance Failure");
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_XLIB_KHR)
ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find "
"the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME " extension.\n\n"
@@ -1042,6 +1052,7 @@ struct Demo {
inst.createWaylandSurfaceKHR(&createInfo, nullptr, &surface);
VERIFY(result == vk::Result::eSuccess);
}
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_XLIB_KHR)
{
auto const createInfo =
@@ -2566,7 +2577,7 @@ struct Demo {
wl_shell_surface_set_toplevel(shell_surface);
wl_shell_surface_set_title(shell_surface, APP_SHORT_NAME);
}
-
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
#if defined(VK_USE_PLATFORM_WIN32_KHR)
@@ -2590,6 +2601,7 @@ struct Demo {
wl_surface *window;
wl_shell *shell;
wl_shell_surface *shell_surface;
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
vk::SurfaceKHR surface;
@@ -2813,6 +2825,7 @@ int main(int argc, char **argv) {
demo.create_xlib_window();
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
demo.create_window();
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
demo.init_vk_swapchain();
@@ -2825,6 +2838,7 @@ demo.run_xcb();
demo.run_xlib();
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
demo.run();
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
demo.cleanup();