Colourfull Cursors

Hi all,
As I did not want the overhead ( little as it is ) of drawing the
mouse cursor I was thinking of going the Age of Empires route and using
colour cursors.

  1. Does SDL support all xpm formats ( both colour and black and white )?
  2. Are people writing their own cursor handling classes ( for animated
    cursors etc ) or does everyone just use bitmaps?
  3. Any plans to add Windows style cursor support?

Thanks,

Dominique
http://www.DelphiGamer.com := go on, write a game instead;

Disclaimer: I am not an expert.

When I last reviewed SDL’s cursor-related classes and support, my
conclusion was that the dedicated cursor options were fairly limited.
I decided that this was a limitation based on SDL’s crossplatform
nature, to ensure as wide as possible support for SDL’s cursor
routines. It seemed possible (in fact, reasonably trivial) to
implement blit-based cursors of arbitrary size, shape, color,
animation, by supressing the ‘true’ cursor display and blitting
surfaces of my choice to the location of the cursor. However, I did
not and do not plan to implement that, as my understanding was that
the ‘basic’ SDL cursor is very programmically efficent and makes good
use of hardware-based cursor acceleration on most platforms, where a
re-implementation using surfaces would involve all the inefficencies
involved in the use of surfaces and blits.

Disclaimer: I am not an expert.

When I last reviewed SDL’s cursor-related classes and support, my
conclusion was that the dedicated cursor options were fairly limited.
I decided that this was a limitation based on SDL’s crossplatform
nature, to ensure as wide as possible support for SDL’s cursor
routines. It seemed possible (in fact, reasonably trivial) to
implement blit-based cursors of arbitrary size, shape, color,
animation, by supressing the ‘true’ cursor display and blitting
surfaces of my choice to the location of the cursor. However, I did
not and do not plan to implement that, as my understanding was that
the ‘basic’ SDL cursor is very programmically efficent and makes good
use of hardware-based cursor acceleration on most platforms, where a
re-implementation using surfaces would involve all the inefficencies
involved in the use of surfaces and blits.

Great summary. :slight_smile:

I’ll add that if you’re using fullscreen hardware surfaces then you’ll
need to draw your own cursor anyway, as SDL has no idea what you’re doing
to the video memory and can’t draw the cursor into video memory itself
without clobbering what you’re doing. There are hardware overlays for
the cursor on some video cards, but that’s not guaranteed to be available.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment