diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-16 04:49:07 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-16 04:49:07 +0100 |
commit | db02fe3f85165b09954d01d44a497abf8155b326 (patch) | |
tree | c0c9f38d94486c7ad5e1e43fb43c15b8d248749a /include | |
parent | 8ea04000bfa98798a0283bcf80ea136ea8b4dd42 (diff) |
Window: allow setting window minimum/max size and position
Diffstat (limited to 'include')
-rw-r--r-- | include/mgl/window/window.h | 12 |
1 files changed, 9 insertions, 3 deletions
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); |