Monado OpenXR Runtime
comp_window.h
Go to the documentation of this file.
1// Copyright 2019, Collabora, Ltd.
2// Copyright 2024-2025, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Compositor window header.
7 * @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
8 * @author Jakob Bornecrantz <jakob@collabora.com>
9 * @ingroup comp_main
10 */
11
12#pragma once
13
16
17#include "xrt/xrt_config_os.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23
24/*
25 *
26 * Functions.
27 *
28 */
29
30/*!
31 * Debug info target factor, always available.
32 *
33 * @ingroup comp_main
34 */
36
37#ifdef VK_USE_PLATFORM_XCB_KHR
38
39/*!
40 * Create a xcb window.
41 *
42 * @ingroup comp_main
43 * @public @memberof comp_window_xcb
44 */
45struct comp_target *
47
48extern const struct comp_target_factory comp_target_factory_xcb;
49
50#endif // VK_USE_PLATFORM_XCB_KHR
51
52#ifdef VK_USE_PLATFORM_WAYLAND_KHR
53
54/*!
55 * Create a wayland window.
56 *
57 * @ingroup comp_main
58 * @public @memberof comp_window_wayland
59 */
60struct comp_target *
62
63extern const struct comp_target_factory comp_target_factory_wayland;
64
65/*!
66 * Create a direct surface to a HMD using Wayland.
67 *
68 * @ingroup comp
69 */
70struct comp_target *
72
73extern const struct comp_target_factory comp_target_factory_direct_wayland;
74
75#endif // VK_USE_PLATFORM_WAYLAND_KHR
76
77#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
78/*!
79 * Create a direct surface to an HMD over RandR.
80 *
81 * @ingroup comp_main
82 * @public @memberof comp_window_direct_randr
83 */
84struct comp_target *
86
87extern const struct comp_target_factory comp_target_factory_direct_randr;
88
89/*!
90 * Create a direct surface to an HMD on NVIDIA.
91 *
92 * @ingroup comp_main
93 * @public @memberof comp_window_direct_nvidia
94 */
95struct comp_target *
97
98extern const struct comp_target_factory comp_target_factory_direct_nvidia;
99#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
100
101#if 1
102/*!
103 * Create a direct surface to an HMD on VkDisplay.
104 *
105 * @ingroup comp_main
106 * @public @memberof comp_window_direct_vk_display
107 */
108struct comp_target *
109comp_window_vk_display_create(struct comp_compositor *c);
110
111extern const struct comp_target_factory comp_target_factory_vk_display;
112#endif // 1
113
114#ifdef XRT_OS_ANDROID
115/*!
116 * Create a surface to an HMD on Android.
117 *
118 * @ingroup comp_main
119 * @public @memberof comp_window_android
120 */
121struct comp_target *
122comp_window_android_create(struct comp_compositor *c);
123
124extern const struct comp_target_factory comp_target_factory_android;
125#endif // XRT_OS_ANDROID
126
127#ifdef XRT_OS_WINDOWS
128
129/*!
130 * Create a rendering window on Windows.
131 *
132 * @ingroup comp_main
133 * @public @memberof comp_window_mswin
134 */
135struct comp_target *
136comp_window_mswin_create(struct comp_compositor *c);
137
138extern const struct comp_target_factory comp_target_factory_mswin;
139#endif // XRT_OS_WINDOWS
140
141#ifdef __cplusplus
142}
143#endif
Main compositor written using Vulkan header.
Target Vulkan swapchain code header.
struct comp_target * comp_window_xcb_create(struct comp_compositor *c)
Create a xcb window.
Definition: comp_window_xcb.c:127
struct comp_target * comp_window_direct_randr_create(struct comp_compositor *c)
Create a direct surface to an HMD over RandR.
Definition: comp_window_direct_randr.c:111
struct comp_target * comp_window_direct_nvidia_create(struct comp_compositor *c)
Create a direct surface to an HMD on NVIDIA.
Definition: comp_window_direct_nvidia.c:97
struct comp_target * comp_window_wayland_create(struct comp_compositor *c)
Create a wayland window.
Definition: comp_window_wayland.c:101
const struct comp_target_factory comp_target_factory_debug_image
Debug info target factor, always available.
Definition: comp_window_debug_image.c:410
struct comp_target * comp_window_direct_wayland_create(struct comp_compositor *c)
Create a direct surface to a HMD using Wayland.
Definition: comp_window_direct_wayland.c:501
Main compositor struct tying everything in the compositor together.
Definition: comp_compositor.h:89
A factory of targets.
Definition: comp_target.h:682
A compositor target: where the compositor renders to.
Definition: comp_target.h:133
struct comp_compositor * c
Owning compositor.
Definition: comp_target.h:135
Auto detect OS and certain features.