Function glfwCreateCursor

  • Creates a new custom cursor image that can be set for a window with glfwSetCursor. The cursor can be destroyed with glfwDestroyCursor. Any remaining cursors are destroyed by glfwTerminate.

    The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. They are arranged canonically as packed sequential rows, starting from the top-left corner.

    The cursor hotspot is specified in pixels, relative to the upper-left corner of the cursor image. Like all other coordinate systems in GLFW, the X-axis points to the right and the Y-axis points down.

    Parameters

    • image: GLFWimage

      The desired cursor image.

    • xhot: number

      The desired x-coordinate, in pixels, of the cursor hotspot.

    • yhot: number

      The desired y-coordinate, in pixels, of the cursor hotspot.

    Returns GLFWcursor

    The handle of the created cursor, or NULL if an error occurred.

Generated using TypeDoc