Added glfwCreateStandardCursor.

This function allows the creation of cursor objects using one of several
standard cursor shapes from the current system cursor theme.
This commit is contained in:
Camilla Berglund
2014-09-02 16:52:16 +02:00
parent 1495134398
commit 2a1375e97c
11 changed files with 246 additions and 8 deletions
+63 -1
View File
@@ -672,6 +672,42 @@ extern "C" {
#define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001
#define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002
/*! @defgroup shapes Standard cursor shapes
* @ingroup input
* @{ */
/*! @brief The regular arrow cursor shape.
*
* The regular arrow cursor.
*/
#define GLFW_ARROW_CURSOR 0x00036001
/*! @brief The text input I-beam cursor shape.
*
* The text input I-beam cursor shape.
*/
#define GLFW_IBEAM_CURSOR 0x00036002
/*! @brief The crosshair shape.
*
* The crosshair shape.
*/
#define GLFW_CROSSHAIR_CURSOR 0x00036003
/*! @brief The hand shape.
*
* The hand shape.
*/
#define GLFW_HAND_CURSOR 0x00036004
/*! @brief The horizontal resize arrow shape.
*
* The horizontal resize arrow shape.
*/
#define GLFW_HRESIZE_CURSOR 0x00036005
/*! @brief The vertical resize arrow shape.
*
* The vertical resize arrow shape.
*/
#define GLFW_VRESIZE_CURSOR 0x00036006
/*! @} */
#define GLFW_CONNECTED 0x00040001
#define GLFW_DISCONNECTED 0x00040002
@@ -2606,7 +2642,7 @@ GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
*/
GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
/*! @brief Creates a cursor.
/*! @brief Creates a custom cursor.
*
* Creates a new cursor that can be made the system cursor for a window with
* @ref glfwSetCursor. The cursor can be destroyed with @ref
@@ -2633,6 +2669,7 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
*
* @sa @ref input_cursor
* @sa glfwDestroyCursor
* @sa glfwCreateStandardCursor
*
* @par History
* Added in GLFW 3.1.
@@ -2641,6 +2678,31 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
*/
GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);
/*! @brief Creates a cursor with a standard shape.
*
* Returns a cursor with a [standard shape](@ref shapes), which can be made the
* system cursor for a window with @ref glfwSetCursor.
*
* @param[in] shape One of the [standard shapes](@ref shapes).
*
* @return A new cursor ready to use or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @note This function may not be called from a callback.
*
* @par Thread Safety
* This function may only be called from the main thread.
*
* @sa @ref input_cursor
* @sa glfwCreateCursor
*
* @par History
* Added in GLFW 3.1.
*
* @ingroup input
*/
GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape);
/*! @brief Destroys a cursor.
*
* This function destroys a cursor previously created with @ref