We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2290

Summary: Request: SDL/SDL_cursor.h With SDLCursorTypes For Standard Cursors
Product: SDL Reporter: N. de Jonge <mail>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 CC: icculus
Version: HG 2.1   
Hardware: x86   
OS: Linux   

Description N. de Jonge 2013-12-09 12:15:08 UTC
This is a feature request. I would like to be able to include SDL/SDL_cursor.h and then pick a SDLCursorType that will allow me to use one of various standard cursors with SDL_SetCursor. This would be similar to what GDK allows me to do:
https://developer.gnome.org/gdk/stable/gdk-Cursors.html
(Scroll down to see the GdkCursorTypes and their respective images.)
Comment 1 Ryan C. Gordon 2013-12-10 02:07:07 UTC
Does SDL_CreateSystemCursor() not fit your needs?

--ryan.
Comment 2 N. de Jonge 2013-12-10 10:37:05 UTC
Thanks Ryan, it is indeed what I was looking for.

Before closing this report, would you be willing to make some simple changes to the Wiki. (If not, please let me know and I'll e-mail Sam to request an account at the Wiki to make the changes myself.) The changes are:

At
http://wiki.libsdl.org/SDL_CreateCursor
please add, after the first sentence at the top, something along the lines of:
-----
Since SDL 2.0.0 the [[SDL_CreateSystemCursor]] function is available, which provides twelve readily available system cursors to pick from.
-----

At
http://wiki.libsdl.org/SDL_CreateSystemCursor
please add, in the "Function Parameters" section:
-----
Valid ids are:
SDL_SYSTEM_CURSOR_ARROW
SDL_SYSTEM_CURSOR_IBEAM
SDL_SYSTEM_CURSOR_WAIT
SDL_SYSTEM_CURSOR_CROSSHAIR
SDL_SYSTEM_CURSOR_WAITARROW
SDL_SYSTEM_CURSOR_SIZENWSE
SDL_SYSTEM_CURSOR_SIZENESW
SDL_SYSTEM_CURSOR_SIZEWE
SDL_SYSTEM_CURSOR_SIZENS
SDL_SYSTEM_CURSOR_SIZEALL
SDL_SYSTEM_CURSOR_NO
SDL_SYSTEM_CURSOR_HAND
-----

At
http://wiki.libsdl.org/SDL_CreateSystemCursor
please add, in the "Code Examples" section:
-----
SDL_Cursor* cursor;
cursor = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_HAND);
SDL_SetCursor(cursor);
-----
Comment 3 N. de Jonge 2014-01-22 02:02:58 UTC
I've applied the changes I suggested to the SDL wiki.
Closing this report.