aboutsummaryrefslogtreecommitdiff
path: root/include/cursor.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-04-21 20:59:06 +0200
committerdec05eba <dec05eba@protonmail.com>2023-04-21 20:59:06 +0200
commit49ac7d74292339fe9d52ce19de23d0ce25fa9bd1 (patch)
tree6c87573590970dcb75e94c2f7663d8b12dadf729 /include/cursor.h
parentb6227c07f2e80cfcf31485246c58841019337e58 (diff)
Add code to copy cursor image to opengl texture and update on event update (not used yet)
Diffstat (limited to 'include/cursor.h')
-rw-r--r--include/cursor.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/cursor.h b/include/cursor.h
new file mode 100644
index 0000000..0a7831d
--- /dev/null
+++ b/include/cursor.h
@@ -0,0 +1,28 @@
+#ifndef GSR_CURSOR_H
+#define GSR_CURSOR_H
+
+#include "egl.h"
+#include "vec2.h"
+
+#include <X11/Xlib.h>
+
+typedef struct {
+ gsr_egl *egl;
+ Display *display;
+ Window window;
+ int x_fixes_event_base;
+
+ unsigned int texture_id;
+ vec2i size;
+ vec2i hotspot;
+
+ bool cursor_image_set;
+} gsr_cursor;
+
+int gsr_cursor_init(gsr_cursor *self, gsr_egl *egl, Display *display);
+void gsr_cursor_deinit(gsr_cursor *self);
+
+int gsr_cursor_change_window_target(gsr_cursor *self, Window window);
+void gsr_cursor_update(gsr_cursor *self, XEvent *xev);
+
+#endif /* GSR_CURSOR_H */