Monado OpenXR Runtime
Loading...
Searching...
No Matches
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
24
extern
"C"
{
25
#endif
26
27
28
/*!
29
* Common struct holding state for the GUI interface.
30
*
31
* @ingroup gui
32
* @extends gui_program
33
*/
34
struct
sdl2_program
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
*/
50
int
51
gui_sdl2_init(
struct
sdl2_program
*p);
52
53
/*!
54
* Loop until user requests quit, and show Imgui interface.
55
*
56
* @public @memberof sdl2_program
57
*/
58
void
59
gui_sdl2_imgui_loop(
struct
sdl2_program
*p);
60
61
/*!
62
* Loop until quit signal has been received.
63
*
64
* @public @memberof sdl2_program
65
*/
66
void
67
gui_sdl2_loop(
struct
sdl2_program
*p);
68
69
/*!
70
* Destroy all SDL things and quit SDL.
71
*
72
* @public @memberof sdl2_program
73
*/
74
void
75
gui_sdl2_quit(
struct
sdl2_program
*p);
76
77
78
#ifdef __cplusplus
79
}
80
#endif
gui_common.h
Common file for the Monado GUI program.
gui_program
A gui program.
Definition
gui_common.h:44
sdl2_program
Common struct holding state for the GUI interface.
Definition
gui_sdl2.h:35
targets
gui
gui_sdl2.h
Generated by
1.9.8