Skyscraper 2.0
XrPlatformDependencies.h
Go to the documentation of this file.
1// Copyright (c) 2018-2022, The Khronos Group Inc.
2//
3// SPDX-License-Identifier: Apache-2.0 OR MIT
4//
5// This file includes headers with types which openxr.h depends on in order
6// to compile when platforms, graphics apis, and the like are enabled.
7
8#pragma once
9
10// Adapted from OpenXR-SDK on github:
11// https://github.com/KhronosGroup/OpenXR-SDK/blob/master/src/common/xr_dependencies.h
12
13#ifdef XR_USE_PLATFORM_ANDROID
14#include <android/native_window.h>
15#include <android/window.h>
16#include <android/native_window_jni.h>
17#endif // XR_USE_PLATFORM_ANDROID
18
19#ifdef XR_USE_PLATFORM_WIN32
20
21// OLE desktop APIs cannot be overriden with the following desktop parition flag.
22#include <ocidl.h>
23
24#include <winapifamily.h>
25#if !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM))
26// Enable desktop partition APIs, such as RegOpenKeyEx, LoadLibraryEx, PathFileExists etc.
27#undef WINAPI_PARTITION_DESKTOP
28#define WINAPI_PARTITION_DESKTOP 1
29#endif
30
31#ifndef NOMINMAX
32#define NOMINMAX
33#endif // !NOMINMAX
34
35#ifndef WIN32_LEAN_AND_MEAN
36#define WIN32_LEAN_AND_MEAN
37#endif // !WIN32_LEAN_AND_MEAN
38
39#include <windows.h>
40#include <unknwn.h>
41
42#endif // XR_USE_PLATFORM_WIN32
43
44#ifdef XR_USE_GRAPHICS_API_D3D11
45#include <d3d11.h>
46#endif // XR_USE_GRAPHICS_API_D3D11
47
48#ifdef XR_USE_GRAPHICS_API_D3D12
49#include <d3d12.h>
50#endif // XR_USE_GRAPHICS_API_D3D12
51
52#ifdef XR_USE_PLATFORM_XLIB
53#include <X11/Xlib.h>
54#include <X11/Xutil.h>
55
56#ifdef Success
57#undef Success
58#endif // Success
59
60#ifdef Always
61#undef Always
62#endif // Always
63
64#ifdef None
65#undef None
66#endif // None
67#endif // XR_USE_PLATFORM_XLIB
68
69#ifdef XR_USE_PLATFORM_XCB
70#include <xcb/xcb.h>
71#endif // XR_USE_PLATFORM_XCB
72
73#ifdef XR_USE_GRAPHICS_API_OPENGL
74#if defined(XR_USE_PLATFORM_XLIB) || defined(XR_USE_PLATFORM_XCB)
75#include <GL/glx.h>
76#endif // (XR_USE_PLATFORM_XLIB || XR_USE_PLATFORM_XCB)
77#ifdef XR_USE_PLATFORM_XCB
78#include <xcb/glx.h>
79#endif // XR_USE_PLATFORM_XCB
80#ifdef XR_USE_PLATFORM_MACOS
81#include <CL/cl_gl_ext.h>
82#endif // XR_USE_PLATFORM_MACOS
83#endif // XR_USE_GRAPHICS_API_OPENGL
84
85#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
86#include <EGL/egl.h>
87#endif // XR_USE_GRAPHICS_API_OPENGL_ES
88
89#ifdef XR_USE_GRAPHICS_API_VULKAN
90#include <vulkan/vulkan.h>
91#endif // XR_USE_GRAPHICS_API_VULKAN
92
93#ifdef XR_USE_PLATFORM_WAYLAND
94#include "wayland-client.h"
95#endif // XR_USE_PLATFORM_WAYLAND