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

#include "gl.h"

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

typedef struct {
    mgl_connection connection;
    GLXContext glx_context;
    _XVisualInfo *visual_info;
    mgl_gl gl;
} mgl_context;

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