Changing cursor in C++/SDL possible?
Hello all,
I"m starting to get into game development. I know C++ and chose SDL to start learning. I'm up to creating a full screen tiled 2d game where the user can move a ship with the keyboard (basic stuff). Now i was wondering if it is possible to change the cursor to an image.
Thanks, Ed
I"m starting to get into game development. I know C++ and chose SDL to start learning. I'm up to creating a full screen tiled 2d game where the user can move a ship with the keyboard (basic stuff). Now i was wondering if it is possible to change the cursor to an image.
Thanks, Ed
If you want a proper image (i.e colour, animation, et al) as your cursor, you'll need to use a SDL_Surface as the cursor, polling for SDL_MOUSEMOTION events and updating that surface's position to the mouse position during the update loop, and with a call to SDL_ShowCursor( SDL_DISABLE ) to hide the system cursor.
If you don't mind your cursor having all the limitations of the lowest common denominator system cursor, look at SDL_CreateCursor()
If you don't mind your cursor having all the limitations of the lowest common denominator system cursor, look at SDL_CreateCursor()
Mark Bishop
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Hiding the Cursor in Carbon? | DoG | 1 | 2,270 |
Feb 17, 2006 02:33 AM Last Post: DoG |
|
| Cursor coordinates off during resolution change | akb825 | 2 | 3,046 |
Aug 19, 2005 08:21 PM Last Post: akb825 |
|

