aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-08-25 10:45:04 +0200
committerdec05eba <dec05eba@protonmail.com>2023-08-25 10:45:04 +0200
commitd00ad919d7daf610d56bb551f85d9a36286d9551 (patch)
tree1fd2e269f32a4470af83a469317465e114ab757a
parent6c8f5d47a5b10fdd7257f23a60054d60d7c3487b (diff)
Add monitor events, limit fps to monitor the window is in, reduce latency (glFinish, fps limit)
m---------depends/mgl0
-rw-r--r--include/mglpp/window/Event.hpp25
2 files changed, 24 insertions, 1 deletions
diff --git a/depends/mgl b/depends/mgl
-Subproject ef4a993d20ceb791ac62dd219ee7d63524e04a3
+Subproject 30d9f5392fb07105e792963d74786024adc79dd
diff --git a/include/mglpp/window/Event.hpp b/include/mglpp/window/Event.hpp
index f3e9535..bcd1e91 100644
--- a/include/mglpp/window/Event.hpp
+++ b/include/mglpp/window/Event.hpp
@@ -46,6 +46,23 @@ namespace mgl {
int y; /* relative to the top of the window */
};
+ struct MonitorGenericEvent {
+ const char *name; /* This name may only be valid until the next time |mgl_window_poll_event| is called */
+ int id;
+ int x;
+ int y;
+ int width;
+ int height;
+ int refresh_rate; /* 0 if unknown */
+ };
+
+ using MonitorConnectedEvent = MonitorGenericEvent;
+ using MonitorPropertyChangedEvent = MonitorGenericEvent;
+
+ struct MonitorDisconnectedEvent {
+ int id;
+ };
+
enum Type : int {
Unknown,
Closed, /* Window closed */
@@ -58,7 +75,10 @@ namespace mgl {
MouseButtonPressed,
MouseButtonReleased,
MouseWheelScrolled,
- MouseMoved
+ MouseMoved,
+ MonitorConnected,
+ MonitorDisconnected,
+ MonitorPropertyChanged,
};
Type type;
@@ -70,6 +90,9 @@ namespace mgl {
MouseButtonEvent mouse_button;
MouseWheelScrollEvent mouse_wheel_scroll;
MouseMoveEvent mouse_move;
+ MonitorConnectedEvent monitor_connected;
+ MonitorDisconnectedEvent monitor_disconnected;
+ MonitorPropertyChangedEvent monitor_property_changed;
};
};
}