From 8974be43a3c7f672a34291049bb543d01960de28 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 17 Oct 2021 00:33:37 +0200 Subject: Parent window = 0 = root window --- include/mgl/window.h | 27 --------------------------- include/mgl/window/window.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 include/mgl/window.h create mode 100644 include/mgl/window/window.h (limited to 'include') diff --git a/include/mgl/window.h b/include/mgl/window.h deleted file mode 100644 index 0184577..0000000 --- a/include/mgl/window.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef MGL_WINDOW_H -#define MGL_WINDOW_H - -#include "system/vec.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; - mgl_vec2i size; - mgl_vec2i cursor_position; -}; - -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 */ diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h new file mode 100644 index 0000000..5232260 --- /dev/null +++ b/include/mgl/window/window.h @@ -0,0 +1,28 @@ +#ifndef MGL_WINDOW_H +#define MGL_WINDOW_H + +#include "../system/vec.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; + mgl_vec2i size; + mgl_vec2i cursor_position; +}; + +int mgl_window_create(mgl_window *self, const char *title, int width, int height, mgl_window_callback *callback); +/* if |parent_window| is 0 then the root window is used */ +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 */ -- cgit v1.2.3