MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / glfwCreateCursor

Function glfwCreateCursor

extern/glfw/src/input.c:746–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

744}
745
746GLFWAPI 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
774GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape)
775{

Callers

nothing calls this directly

Calls 3

_glfwInputErrorFunction · 0.85
glfwDestroyCursorFunction · 0.85

Tested by

no test coverage detected