Monado OpenXR Runtime
comp_gl_memobj_swapchain.h
Go to the documentation of this file.
1 // Copyright 2019-2020, Collabora, Ltd.
2 // SPDX-License-Identifier: BSL-1.0
3 /*!
4  * @file
5  * @brief OpenGL client side glue using memory objects - header.
6  * @author Rylie Pavlik <rylie.pavlik@collabora.com>
7  * @author Jakob Bornecrantz <jakob@collabora.com>
8  * @ingroup comp_client
9  */
10 
11 #pragma once
12 
13 #include "comp_gl_client.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 
20 /*!
21  * @class client_gl_memobj_swapchain
22  *
23  * Wraps the real compositor swapchain providing a OpenGL based interface.
24  *
25  * Almost a one to one mapping to a OpenXR swapchain.
26  *
27  * @ingroup comp_client
28  * @implements xrt_swapchain_gl
29  */
31 {
33 
34  // GLuint
35  unsigned int memory[XRT_MAX_SWAPCHAIN_IMAGES];
36 };
37 
38 /*!
39  * Create a swapchain, belonging to a client_gl_compositor, that uses
40  * GL_memory_object and related extensions to use the native buffer.
41  *
42  * This is most commonly used on desktop OpenGL.
43  *
44  * The caller must ensure that the app context is current.
45  *
46  * @see client_gl_swapchain_create_func_t, client_gl_compositor_init
47  */
48 struct xrt_swapchain *
50  const struct xrt_swapchain_create_info *info,
51  struct xrt_swapchain_native *xscn,
52  struct client_gl_swapchain **out_cglsc);
53 
54 
55 #ifdef __cplusplus
56 }
57 #endif
OpenGL client side glue to compositor header.
struct xrt_swapchain * client_gl_memobj_swapchain_create(struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_native *xscn, struct client_gl_swapchain **out_cglsc)
Create a swapchain, belonging to a client_gl_compositor, that uses GL_memory_object and related exten...
Definition: comp_gl_memobj_swapchain.c:94
#define XRT_MAX_SWAPCHAIN_IMAGES
Max swapchain images, artificial limit.
Definition: xrt_limits.h:34
Wraps the real compositor swapchain providing a OpenGL based interface.
Definition: comp_gl_memobj_swapchain.h:31
Wraps the real compositor swapchain providing a OpenGL based interface.
Definition: comp_gl_client.h:38
struct xrt_swapchain_gl base
Implements xrt_swapchain_gl.
Definition: comp_gl_client.h:40
Common compositor client interface/base.
Definition: xrt_compositor.h:986
Swapchain creation info.
Definition: xrt_compositor.h:876
Base class for a swapchain that exposes a native buffer handle to be imported into a client API.
Definition: xrt_compositor.h:2163
Common swapchain interface/base.
Definition: xrt_compositor.h:536