glfwCreateStandardCursor

Function glfwCreateStandardCursor 

Source
pub unsafe extern "C" fn glfwCreateStandardCursor(
    shape: i32,
) -> *mut GLFWcursor
Expand description

@brief Creates a cursor with a standard shape.

Returns a cursor with a standard shape, that can be set for a window with @ref glfwSetCursor. The images for these cursors come from the system cursor theme and their exact appearance will vary between platforms.

Most of these shapes are guaranteed to exist on every supported platform but a few may not be present. See the table below for details.

Cursor shapeWindowsmacOSX11Wayland
@ref GLFW_ARROW_CURSORYesYesYesYes
@ref GLFW_IBEAM_CURSORYesYesYesYes
@ref GLFW_CROSSHAIR_CURSORYesYesYesYes
@ref GLFW_POINTING_HAND_CURSORYesYesYesYes
@ref GLFW_RESIZE_EW_CURSORYesYesYesYes
@ref GLFW_RESIZE_NS_CURSORYesYesYesYes
@ref GLFW_RESIZE_NWSE_CURSORYesYes1Maybe2Maybe2
@ref GLFW_RESIZE_NESW_CURSORYesYes1Maybe2Maybe2
@ref GLFW_RESIZE_ALL_CURSORYesYesYesYes
@ref GLFW_NOT_ALLOWED_CURSORYesYesMaybe2Maybe2
  1. This uses a private system API and may fail in the future.

  2. This uses a newer standard that not all cursor themes support.

If the requested shape is not available, this function emits a @ref GLFW_CURSOR_UNAVAILABLE error and returns NULL.

@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.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_INVALID_ENUM, @ref GLFW_CURSOR_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.

@thread_safety This function must only be called from the main thread.

@sa @ref cursor_standard @sa @ref glfwCreateCursor

@since Added in version 3.1.

@ingroup input