Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add SDL_GetDefaultCursor.

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 85a015b5206a884193bd8149f70d0305441b94e5
Showing with 16 additions and 0 deletions.
  1. +5 −0 include/SDL_mouse.h
  2. +11 −0 src/events/SDL_mouse.c
@@ -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().
*
@@ -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)
{

0 comments on commit 85a015b

Please sign in to comment.