Add SDL_GetDefaultCursor.

This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1798
Thanks to Alex Szpakowski for suggestion & patch.
This commit is contained in:
Jørgen P. Tjernø 2013-04-24 10:42:44 -07:00
parent 8836a99081
commit 69bc11e564
2 changed files with 16 additions and 0 deletions

View file

@ -174,6 +174,11 @@ extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
*/ */
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); 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(). * \brief Frees a cursor created with SDL_CreateCursor().
* *

View file

@ -626,6 +626,17 @@ SDL_GetCursor(void)
return mouse->cur_cursor; return mouse->cur_cursor;
} }
SDL_Cursor *
SDL_GetDefaultCursor(void)
{
SDL_Mouse *mouse = SDL_GetMouse();
if (!mouse) {
return NULL;
}
return mouse->def_cursor;
}
void void
SDL_FreeCursor(SDL_Cursor * cursor) SDL_FreeCursor(SDL_Cursor * cursor)
{ {