| 744 | } |
| 745 | |
| 746 | GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot) |
| 747 | { |
| 748 | _GLFWcursor* cursor; |
| 749 | |
| 750 | assert(image != NULL); |
| 751 | assert(image->pixels != NULL); |
| 752 | |
| 753 | _GLFW_REQUIRE_INIT_OR_RETURN(NULL); |
| 754 | |
| 755 | if (image->width <= 0 || image->height <= 0) |
| 756 | { |
| 757 | _glfwInputError(GLFW_INVALID_VALUE, "Invalid image dimensions for cursor"); |
| 758 | return NULL; |
| 759 | } |
| 760 | |
| 761 | cursor = calloc(1, sizeof(_GLFWcursor)); |
| 762 | cursor->next = _glfw.cursorListHead; |
| 763 | _glfw.cursorListHead = cursor; |
| 764 | |
| 765 | if (!_glfwPlatformCreateCursor(cursor, image, xhot, yhot)) |
| 766 | { |
| 767 | glfwDestroyCursor((GLFWcursor*) cursor); |
| 768 | return NULL; |
| 769 | } |
| 770 | |
| 771 | return (GLFWcursor*) cursor; |
| 772 | } |
| 773 | |
| 774 | GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape) |
| 775 | { |
nothing calls this directly
no test coverage detected