aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/mgl.h
blob: bd0ae5bc7e806710a8737345abd887fb8582112b (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
#ifndef MGL_MGL_H
#define MGL_MGL_H

#include "gl.h"

/* Display* on x11 */
typedef void* mgl_connection;
typedef struct mgl_context mgl_context;

struct mgl_context {
    mgl_connection connection;
    mgl_gl gl;
    _XVisualInfo *visual_info;
    GLXFBConfig fbconfig;
    unsigned long wm_delete_window_atom;
    unsigned long net_wm_ping_atom;
    unsigned long net_wm_pid_atom;
};

/*
    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 */