From 7f9fff1ffecf43f97f002ea5d96fbecabebbe6b7 Mon Sep 17 00:00:00 2001 From: httpdigest Date: Mon, 31 Aug 2015 11:08:32 +0200 Subject: [PATCH 1/2] Add support for a wait/hourglass cursor This adds support for the wait/hourglass cursor with a Windows implementation using ICL_WAIT. --- include/GLFW/glfw3.h | 5 +++++ src/input.c | 3 ++- src/win32_window.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index ac9638204..9994e4a35 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -684,6 +684,11 @@ extern "C" { * The vertical resize arrow shape. */ #define GLFW_VRESIZE_CURSOR 0x00036006 +/*! @brief The wait/hourglass shape. + * + * The wait/hourglass shape. + */ +#define GLFW_WAIT_CURSOR 0x00036007 /*! @} */ #define GLFW_CONNECTED 0x00040001 diff --git a/src/input.c b/src/input.c index eefbf0860..a5593811c 100644 --- a/src/input.c +++ b/src/input.c @@ -389,7 +389,8 @@ GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape) shape != GLFW_CROSSHAIR_CURSOR && shape != GLFW_HAND_CURSOR && shape != GLFW_HRESIZE_CURSOR && - shape != GLFW_VRESIZE_CURSOR) + shape != GLFW_VRESIZE_CURSOR && + shape != GLFW_WAIT_CURSOR) { _glfwInputError(GLFW_INVALID_ENUM, "Invalid standard cursor"); return NULL; diff --git a/src/win32_window.c b/src/win32_window.c index 944564ce8..18d9d1848 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -148,6 +148,8 @@ static LPWSTR translateCursorShape(int shape) return IDC_SIZEWE; case GLFW_VRESIZE_CURSOR: return IDC_SIZENS; + case GLFW_WAIT_CURSOR: + return IDC_WAIT; } return NULL; From a38682cee423fdc60c07ff1858ac7ed5d3195923 Mon Sep 17 00:00:00 2001 From: httpdigest Date: Mon, 31 Aug 2015 11:18:41 +0200 Subject: [PATCH 2/2] Add wait/hourglass cursor implementation via XC_watch This adds support for the wait/hourglass cursor shape on X11 using XC_watch --- src/x11_window.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/x11_window.c b/src/x11_window.c index 251e09adc..35e967e6f 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -123,6 +123,8 @@ static int translateCursorShape(int shape) return XC_sb_h_double_arrow; case GLFW_VRESIZE_CURSOR: return XC_sb_v_double_arrow; + case GLFW_WAIT_CURSOR: + return XC_watch; } return 0;