aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/window.h
blob: 34920a8294b9b4cedf63776a1108547ded52ff19 (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
#ifndef MGL_WINDOW_H
#define MGL_WINDOW_H

typedef struct mgl_window mgl_window;

typedef struct {
    void *userdata;
    void (*draw)(mgl_window *window, void *userdata);
} mgl_window_callback;

struct mgl_window {
    unsigned long window;
    mgl_window_callback callback;
    int width;
    int height;
};

int mgl_window_create(mgl_window *self, const char *title, int width, int height, mgl_window_callback *callback);
int mgl_window_create_with_params(mgl_window *self, const char *title, int width, int height, unsigned long parent_window, mgl_window_callback *callback);
void mgl_window_deinit(mgl_window *self);

void mgl_window_events_poll(mgl_window *self);
void mgl_window_draw(mgl_window *self);

#endif /* MGL_WINDOW_H */