From db02fe3f85165b09954d01d44a497abf8155b326 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 16 Nov 2021 04:49:07 +0100 Subject: Window: allow setting window minimum/max size and position --- include/mgl/window/window.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include/mgl') diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h index a63bc03..20c700a 100644 --- a/include/mgl/window/window.h +++ b/include/mgl/window/window.h @@ -34,9 +34,15 @@ struct mgl_window { mgl_clock frame_timer; }; -int mgl_window_create(mgl_window *self, const char *title, int width, int height); -/* 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, mgl_window_handle parent_window); +typedef struct { + mgl_vec2i position; + mgl_vec2i size; + mgl_vec2i min_size; /* (0, 0) = no limit */ + mgl_vec2i max_size; /* (0, 0) = no limit */ + mgl_window_handle parent_window; /* 0 = root window */ +} mgl_window_create_params; + +int mgl_window_create(mgl_window *self, const char *title, const mgl_window_create_params *params); int mgl_window_init_from_existing_window(mgl_window *self, mgl_window_handle existing_window); void mgl_window_deinit(mgl_window *self); -- cgit v1.2.3