MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / glfwCreateStandardCursor

Function glfwCreateStandardCursor

src/custom/glfw.cpp:51–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51GLFWAPI GLFWcursor* glfwCreateStandardCursor(const int shape)
52{
53 static GLFWcursor cursors[] = {
54 { kMouseCursorArrow }, // GLFW_ARROW_CURSOR
55 { kMouseCursorCaret }, // GLFW_IBEAM_CURSOR
56 { kMouseCursorCrosshair }, // GLFW_CROSSHAIR_CURSOR
57 { kMouseCursorHand }, // GLFW_POINTING_HAND_CURSOR
58 { kMouseCursorNotAllowed }, // GLFW_NOT_ALLOWED_CURSOR
59 { kMouseCursorLeftRight }, // GLFW_RESIZE_EW_CURSOR
60 { kMouseCursorUpDown }, // GLFW_RESIZE_NS_CURSOR
61 { kMouseCursorUpLeftDownRight }, // GLFW_RESIZE_NWSE_CURSOR
62 { kMouseCursorUpRightDownLeft }, // GLFW_RESIZE_NESW_CURSOR
63 { kMouseCursorAllScroll }, // GLFW_RESIZE_ALL_CURSOR
64 };
65
66 switch (shape)
67 {
68 case GLFW_ARROW_CURSOR:
69 return &cursors[kMouseCursorArrow];
70 case GLFW_IBEAM_CURSOR:
71 return &cursors[kMouseCursorCaret];
72 case GLFW_CROSSHAIR_CURSOR:
73 return &cursors[kMouseCursorCrosshair];
74 case GLFW_POINTING_HAND_CURSOR:
75 return &cursors[kMouseCursorHand];
76 case GLFW_NOT_ALLOWED_CURSOR:
77 return &cursors[kMouseCursorNotAllowed];
78 case GLFW_RESIZE_EW_CURSOR:
79 return &cursors[kMouseCursorLeftRight];
80 case GLFW_RESIZE_NS_CURSOR:
81 return &cursors[kMouseCursorUpDown];
82 case GLFW_RESIZE_NWSE_CURSOR:
83 return &cursors[kMouseCursorUpLeftDownRight];
84 case GLFW_RESIZE_NESW_CURSOR:
85 return &cursors[kMouseCursorUpRightDownLeft];
86 case GLFW_RESIZE_ALL_CURSOR:
87 return &cursors[kMouseCursorAllScroll];
88 default:
89 return nullptr;
90 }
91}
92
93GLFWAPI void glfwSetCursor(GLFWwindow*, GLFWcursor* const cursor)
94{

Callers 1

onEnterMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected