aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/window/window.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-08-25 03:06:42 +0200
committerdec05eba <dec05eba@protonmail.com>2023-08-25 10:43:40 +0200
commit30d9f5392fb07105e792963d74786024adc79dd5 (patch)
tree47d21dff4323b03ab738366908f2171ba01a00c4 /include/mgl/window/window.h
parentef4a993d20ceb791ac62dd219ee7d63524e04a3e (diff)
Add monitor events, limit fps to monitor the window is in, reduce latency (glFinish, fps limit)
Diffstat (limited to 'include/mgl/window/window.h')
-rw-r--r--include/mgl/window/window.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h
index cb5a2eb..35b677d 100644
--- a/include/mgl/window/window.h
+++ b/include/mgl/window/window.h
@@ -27,9 +27,19 @@ typedef struct {
mgl_vec2i size;
} mgl_scissor;
+typedef struct {
+ int id; /* output id */
+ int crtc_id;
+ const char *name;
+ mgl_vec2i pos;
+ mgl_vec2i size;
+ int refresh_rate;
+} mgl_monitor;
+
struct mgl_window {
mgl_window_handle window;
void *context;
+ mgl_vec2i pos;
mgl_vec2i size;
/* relative to the top left of the window. only updates when the cursor is inside the window */
mgl_vec2i cursor_position;
@@ -40,11 +50,16 @@ struct mgl_window {
bool key_repeat_enabled;
bool vsync_enabled;
double frame_time_limit;
+ double frame_time_limit_monitor;
mgl_clock frame_timer;
char *clipboard_string;
size_t clipboard_size;
+
+ mgl_monitor *monitors; /* TODO: Move these to mgl file */
+ int num_monitors;
};
+/* TODO: Some of these parameters only apply to new window */
typedef struct {
mgl_vec2i position;
mgl_vec2i size;