blob: e314e03d6e7662f72e04c4f75d8631984b6081e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#ifndef MGL_MGL_H
#define MGL_MGL_H
#include "gl.h"
/* Display* on x11 */
typedef void* mgl_connection;
typedef struct mgl_context mgl_context;
typedef struct mgl_window mgl_window;
struct mgl_context {
mgl_connection connection;
mgl_gl gl;
mgl_window *current_window;
unsigned long wm_delete_window_atom;
unsigned long net_wm_ping_atom;
unsigned long net_wm_pid_atom;
int render_event_base;
int render_error_base;
int randr_event_base;
int randr_error_base;
};
/*
Safe to call multiple times, but will only be initialized the first time called.
Returns non-0 value on failure.
Note: not thread safe.
*/
int mgl_init(void);
/*
Safe to call multiple times, but will only be deinitialized the last time called.
Note: not thread safe.
*/
void mgl_deinit(void);
mgl_context* mgl_get_context(void);
#endif /* MGL_MGL_H */
|