diff libcore/core/window.h @ 163:4bbfcd9180a8

core: add window_set_cursor function, closes #2502
author David Demelier <markand@malikania.fr>
date Sun, 18 Oct 2020 17:14:42 +0200
parents c3a40062acc2
children eb0a7ab71023
line wrap: on
line diff
--- a/libcore/core/window.h	Sun Oct 18 12:01:59 2020 +0200
+++ b/libcore/core/window.h	Sun Oct 18 17:14:42 2020 +0200
@@ -37,6 +37,20 @@
 };
 
 /**
+ * \brief Window mouse cursor.
+ */
+enum window_cursor {
+	WINDOW_CURSOR_ARROW,
+	WINDOW_CURSOR_EDIT,
+	WINDOW_CURSOR_WAIT,
+	WINDOW_CURSOR_CROSSHAIR,
+	WINDOW_CURSOR_SIZE,
+	WINDOW_CURSOR_NO,
+	WINDOW_CURSOR_HAND,
+	WINDOW_CURSOR_LAST
+};
+
+/**
  * \brief Access to global window structure.
  */
 extern struct window window;
@@ -54,6 +68,17 @@
 window_open(const char *title, unsigned int width, unsigned int height);
 
 /**
+ * Change the window cursor.
+ *
+ * You must open a window before calling this function.
+ *
+ * \pre cursor < WINDOW_CURSOR_LAST
+ * \param cursor the cursor
+ */
+void
+window_set_cursor(enum window_cursor cursor);
+
+/**
  * Close the window and destroy associated resources.
  */
 void