Monado OpenXR Runtime
comp_gl_eglimage_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 EGLImageKHR - 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
16extern "C" {
17#endif
18
19typedef void *EGLImage;
20typedef void *EGLDisplay;
21
22/*!
23 * @class client_gl_eglimage_swapchain
24 *
25 * Wraps the real compositor swapchain providing a OpenGL based interface.
26 *
27 * Almost a one to one mapping to a OpenXR swapchain.
28 *
29 * @ingroup comp_client
30 * @implements xrt_swapchain_gl
31 */
33{
35
36 EGLDisplay display;
37
38 EGLImage egl_images[XRT_MAX_SWAPCHAIN_IMAGES];
39};
40
41/*!
42 * Create a swapchain, belonging to a client_gl_compositor, that uses
43 * some way of producing an EGLImageKHR from the native buffer.
44 *
45 * This is used on Android and on desktop when the EGL extension is used.
46 */
47struct xrt_swapchain *
49 const struct xrt_swapchain_create_info *info,
50 struct xrt_swapchain_native *xscn,
51 struct client_gl_swapchain **out_sc);
52
53#ifdef __cplusplus
54}
55#endif
OpenGL client side glue to compositor header.
struct xrt_swapchain * client_gl_eglimage_swapchain_create(struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_native *xscn, struct client_gl_swapchain **out_sc)
Create a swapchain, belonging to a client_gl_compositor, that uses some way of producing an EGLImageK...
Definition: comp_gl_eglimage_swapchain.c:172
#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_eglimage_swapchain.h:33
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:988
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:2191
Common swapchain interface/base.
Definition: xrt_compositor.h:536