Monado OpenXR Runtime
gui_sdl2.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 Common file for the Monado SDL2 based GUI program.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @ingroup gui
8 */
9
10#pragma once
11
12#include "gui/gui_common.h"
13#include <SDL2/SDL.h>
14
15/*!
16 * @defgroup gui GUI Config Interface
17 * @ingroup xrt
18 *
19 * @brief Small GUI interface to configure Monado based on SDL2.
20 */
21
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27
28/*!
29 * Common struct holding state for the GUI interface.
30 *
31 * @ingroup gui
32 * @extends gui_program
33 */
35{
36 struct gui_program base;
37
38 bool sdl_initialized;
39 SDL_Window *win;
40 SDL_GLContext ctx;
41 char layout_file[1024];
42};
43
44
45/*!
46 * Init SDL2, create and show a window and bring up any other structs needed.
47 *
48 * @public @memberof sdl2_program
49 */
50int
52
53/*!
54 * Loop until user requests quit, and show Imgui interface.
55 *
56 * @public @memberof sdl2_program
57 */
58void
60
61/*!
62 * Loop until quit signal has been received.
63 *
64 * @public @memberof sdl2_program
65 */
66void
68
69/*!
70 * Destroy all SDL things and quit SDL.
71 *
72 * @public @memberof sdl2_program
73 */
74void
76
77
78#ifdef __cplusplus
79}
80#endif
Common file for the Monado GUI program.
A gui program.
Definition: gui_common.h:44
Common struct holding state for the GUI interface.
Definition: gui_sdl2.h:35
int gui_sdl2_init(struct sdl2_program *p)
Init SDL2, create and show a window and bring up any other structs needed.
Definition: gui_sdl2.c:57
void gui_sdl2_loop(struct sdl2_program *p)
Loop until quit signal has been received.
Definition: gui_sdl2.c:38
void gui_sdl2_imgui_loop(struct sdl2_program *p)
Loop until user requests quit, and show Imgui interface.
Definition: gui_sdl2_imgui.c:50
void gui_sdl2_quit(struct sdl2_program *p)
Destroy all SDL things and quit SDL.
Definition: gui_sdl2.c:115