Parcourir la source

Fix OpenXRVk gem building on Linux. (#6)

Signed-off-by: moraaar <[email protected]>
moraaar il y a 3 ans
Parent
commit
5ffb347fdb

+ 10 - 1
Gems/OpenXRVk/Code/Include/OpenXRVk/Platform/Linux/OpenXRVk_Linux.h

@@ -12,10 +12,19 @@
 #include <AzCore/std/algorithm.h>
 #include <AzCore/std/algorithm.h>
 #include <limits.h>
 #include <limits.h>
 
 
+#if defined(PAL_TRAIT_LINUX_WINDOW_MANAGER_XCB)
+    #include <xcb/xcb.h> // needed for glad vulkan
+#endif
 #include <glad/vulkan.h>
 #include <glad/vulkan.h>
 
 
  // Tell OpenXR what platform code we'll be using
  // Tell OpenXR what platform code we'll be using
-#define XR_USE_PLATFORM_XCB
+#if defined(PAL_TRAIT_LINUX_WINDOW_MANAGER_XCB)
+    #define XR_USE_PLATFORM_XCB
+#elif defined(PAL_TRAIT_LINUX_WINDOW_MANAGER_WAYLAND)
+    #define XR_USE_PLATFORM_WAYLAND
+#else
+    #error "Linux Window Manager not recognized."
+#endif
 #define XR_USE_GRAPHICS_API_VULKAN
 #define XR_USE_GRAPHICS_API_VULKAN
 
 
 #include <openxr/openxr.h>
 #include <openxr/openxr.h>