Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Add SDL_GetDefaultCursor.
Browse files Browse the repository at this point in the history
This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1798
Thanks to Alex Szpakowski for suggestion & patch.
  • Loading branch information
jorgenpt committed Apr 24, 2013
1 parent 4d375fc commit 85a015b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/SDL_mouse.h
Expand Up @@ -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().
*
Expand Down
11 changes: 11 additions & 0 deletions src/events/SDL_mouse.c
Expand Up @@ -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)
{
Expand Down

0 comments on commit 85a015b

Please sign in to comment.