Monado OpenXR Runtime
comp_window.h
Go to the documentation of this file.
1 // Copyright 2019, Collabora, Ltd.
2 // SPDX-License-Identifier: BSL-1.0
3 /*!
4  * @file
5  * @brief Compositor window header.
6  * @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7  * @author Jakob Bornecrantz <jakob@collabora.com>
8  * @ingroup comp_main
9  */
10 
11 #pragma once
12 
13 #include "main/comp_vk_swapchain.h"
14 #include "main/comp_compositor.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 
21 /*
22  *
23  * Structs
24  *
25  */
26 
27 /*!
28  * A output device or a window, often directly connected to the device.
29  *
30  * @ingroup comp_main
31  */
33 {
34  //! Owning compositor.
35  struct comp_compositor *c;
36 
37  //! Name of the window system.
38  const char *name;
39 
40  //! Helper struct.
42 
43  void (*destroy)(struct comp_window *w);
44  void (*flush)(struct comp_window *w);
45  bool (*init)(struct comp_window *w);
46  bool (*init_swapchain)(struct comp_window *w,
47  uint32_t width,
48  uint32_t height);
49  void (*update_window_title)(struct comp_window *w, const char *title);
50 };
51 
52 
53 /*
54  *
55  * Functions.
56  *
57  */
58 
59 #ifdef VK_USE_PLATFORM_XCB_KHR
60 /*!
61  * Create a xcb window.
62  *
63  * @ingroup comp_main
64  */
65 struct comp_window *
67 #endif
68 
69 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
70 /*!
71  * Create a wayland window.
72  *
73  * @ingroup comp_main
74  */
75 struct comp_window *
77 #endif
78 
79 #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
80 /*!
81  * Create a direct surface to a HMD over RandR.
82  *
83  * @ingroup comp_main
84  */
85 struct comp_window *
87 
88 /*!
89  * Create a direct surface to a HMD on NVIDIA.
90  *
91  * @ingroup comp_main
92  */
93 struct comp_window *
95 #endif
96 
97 
98 #ifdef __cplusplus
99 }
100 #endif
Main compositor written using Vulkan header.
struct comp_window * comp_window_direct_nvidia_create(struct comp_compositor *c)
Create a direct surface to a HMD on NVIDIA.
Definition: comp_window_direct_nvidia.c:79
Wraps and manage VkSwapchainKHR and VkSurfaceKHR, used by Compositor code.
Definition: comp_vk_swapchain.h:49
Main compositor struct tying everything in the compositor together.
Definition: comp_compositor.h:73
struct comp_compositor * c
Owning compositor.
Definition: comp_window.h:35
const char * name
Name of the window system.
Definition: comp_window.h:38
struct vk_swapchain swapchain
Helper struct.
Definition: comp_window.h:41
void(* destroy)(struct comp_window *w)
Definition: comp_window.h:43
void(* flush)(struct comp_window *w)
Definition: comp_window.h:44
bool(* init_swapchain)(struct comp_window *w, uint32_t width, uint32_t height)
Definition: comp_window.h:46
void(* update_window_title)(struct comp_window *w, const char *title)
Definition: comp_window.h:49
A output device or a window, often directly connected to the device.
Definition: comp_window.h:32
Vulkan swapchain code header.
struct comp_window * comp_window_xcb_create(struct comp_compositor *c)
Create a xcb window.
Definition: comp_window_xcb.c:124
bool(* init)(struct comp_window *w)
Definition: comp_window.h:45
struct comp_window * comp_window_wayland_create(struct comp_compositor *c)
Create a wayland window.
Definition: comp_window_wayland.c:99
struct comp_window * comp_window_direct_randr_create(struct comp_compositor *c)
Create a direct surface to a HMD over RandR.
Definition: comp_window_direct_randr.c:100