aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mgl/mgl.h9
-rw-r--r--include/mgl/window/window.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/include/mgl/mgl.h b/include/mgl/mgl.h
index e314e03..c5d1f2d 100644
--- a/include/mgl/mgl.h
+++ b/include/mgl/mgl.h
@@ -2,6 +2,7 @@
#define MGL_MGL_H
#include "gl.h"
+#include <stdbool.h>
/* Display* on x11 */
typedef void* mgl_connection;
@@ -38,5 +39,13 @@ int mgl_init(void);
void mgl_deinit(void);
mgl_context* mgl_get_context(void);
+/* Returns true is mgl_init has been setup successfully and the connection to the display server hasn't been severed */
+bool mgl_is_connected_to_display_server(void);
+/*
+ This can be used when no window has been created to update the connection status to the display server.
+ If the connection to the display server has been severed and mgl_ping_display_server has been called then
+ |mgl_is_connected_to_display_server| will return false.
+*/
+void mgl_ping_display_server(void);
#endif /* MGL_MGL_H */
diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h
index 3a1faac..77589c9 100644
--- a/include/mgl/window/window.h
+++ b/include/mgl/window/window.h
@@ -11,6 +11,7 @@
/* Vsync is automatically set for created windows, if supported by the system */
+typedef union _XEvent XEvent;
typedef struct mgl_event mgl_event;
/* x11 window handle. TODO: Add others when wayland, etc is added */
typedef unsigned long mgl_window_handle;
@@ -112,6 +113,7 @@ void mgl_window_deinit(mgl_window *self);
void mgl_window_clear(mgl_window *self, mgl_color color);
bool mgl_window_poll_event(mgl_window *self, mgl_event *event);
+bool mgl_window_inject_x11_event(mgl_window *self, XEvent *xev, mgl_event *event);
void mgl_window_display(mgl_window *self);
/*