| 802 | } |
| 803 | |
| 804 | GLFWAPI void glfwDestroyCursor(GLFWcursor* handle) |
| 805 | { |
| 806 | _GLFWcursor* cursor = (_GLFWcursor*) handle; |
| 807 | |
| 808 | _GLFW_REQUIRE_INIT(); |
| 809 | |
| 810 | if (cursor == NULL) |
| 811 | return; |
| 812 | |
| 813 | // Make sure the cursor is not being used by any window |
| 814 | { |
| 815 | _GLFWwindow* window; |
| 816 | |
| 817 | for (window = _glfw.windowListHead; window; window = window->next) |
| 818 | { |
| 819 | if (window->cursor == cursor) |
| 820 | glfwSetCursor((GLFWwindow*) window, NULL); |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | _glfwPlatformDestroyCursor(cursor); |
| 825 | |
| 826 | // Unlink cursor from global linked list |
| 827 | { |
| 828 | _GLFWcursor** prev = &_glfw.cursorListHead; |
| 829 | |
| 830 | while (*prev != cursor) |
| 831 | prev = &((*prev)->next); |
| 832 | |
| 833 | *prev = cursor->next; |
| 834 | } |
| 835 | |
| 836 | free(cursor); |
| 837 | } |
| 838 | |
| 839 | GLFWAPI void glfwSetCursor(GLFWwindow* windowHandle, GLFWcursor* cursorHandle) |
| 840 | { |
no test coverage detected