diff --git a/include/SDL_mouse.h b/include/SDL_mouse.h index 1cfe09260..c91dfbdeb 100644 --- a/include/SDL_mouse.h +++ b/include/SDL_mouse.h @@ -174,6 +174,11 @@ extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); */ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); +/** + * \brief Return the default cursor. + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); + /** * \brief Frees a cursor created with SDL_CreateCursor(). * diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 67a143902..89ac786d2 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -626,6 +626,17 @@ SDL_GetCursor(void) return mouse->cur_cursor; } +SDL_Cursor * +SDL_GetDefaultCursor(void) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + if (!mouse) { + return NULL; + } + return mouse->def_cursor; +} + void SDL_FreeCursor(SDL_Cursor * cursor) {