Colour mouse cursor under X11

Hi.
As i understood SDL supports only monochrome mouse cursors.
Is there any way to change my (hardware) mouse cursor to a colour one? If not
isnt that a good feature to be included in future SDL versions?

I dont have any experience in programming X11/XLib but can i use the XCursor lib
to change the mouse cursor used in SDL ?

Thanks.

Why not just use your own image and blit it to the screen?

ChrisOn 5/1/05, Filippos Papadopoulos wrote:

Hi.
As i understood SDL supports only monochrome mouse cursors.
Is there any way to change my (hardware) mouse cursor to a colour one? If not
isnt that a good feature to be included in future SDL versions?

I dont have any experience in programming X11/XLib but can i use the XCursor lib
to change the mouse cursor used in SDL ?


E-Mail: Chris Nystrom
Business: Best Online Vitamin and Supplement Store | Shaklee
Blog: http://conversazione.blogspot.com/
AIM: nystromchris

Hi.
As i understood SDL supports only monochrome mouse cursors.
Is there any way to change my (hardware) mouse cursor to a colour one? If not
isnt that a good feature to be included in future SDL versions?

I dont have any experience in programming X11/XLib but can i use the XCursor lib
to change the mouse cursor used in SDL ?

Why not just use your own image and blit it to the screen?

I already do this… I just wanted to use both ways, but it seems that the
other way is hard and it is not worth the challenge.On Sun, 1 May 2005, Chris Nystrom wrote:

On 5/1/05, Filippos Papadopoulos <@Filippos_Papadopoulo> wrote:

Why not just use your own image and blit it to the screen?

One reason that I would like to be able use native colour mouse cursors
is if they are in the native OS’s format, it is one less thing to blit
within the game loop, that I could be using for something else. I think
this may be why Age of Empires and I think Age of Mythology tended to
use native cursors, rather than bitmaps.

This is based on the assumption that the OS takes care of drawing the
native mouse cursors.

Dominique Louis.

Dominique Louis wrote:

Why not just use your own image and blit it to the screen?

One reason that I would like to be able use native colour mouse
cursors is if they are in the native OS’s format, it is one less thing
to blit within the game loop, that I could be using for something
else. I think this may be why Age of Empires and I think Age of
Mythology tended to use native cursors, rather than bitmaps.

This is based on the assumption that the OS takes care of drawing the
native mouse cursors.

Actually, it’s the hardware that draws the cursor as an overlay, so the
cursor rendering is free. But the main advantage is that it makes the
cursor a lot more responsive since it is refreshed more often, and thus
gameplay is way smoother.

Stephane

Why not just use your own image and blit it to the screen?

One reason that I would like to be able use native colour mouse cursors
is if they are in the native OS’s format, it is one less thing to blit
within the game loop, that I could be using for something else.

Yep, if the cursor hardware supports color cursors then doing it through
the windowing system will save a tiny bit of time. Generally it is not
enough that you need to worry about it though. OTOH, the windowing
system may draw the cursor the same way you do, by blitting it to the
screen, in which case you don’t save any thing at all.

I think
this may be why Age of Empires and I think Age of Mythology tended to
use native cursors, rather than bitmaps.

This is based on the assumption that the OS takes care of drawing the
native mouse cursors.

I know this is a touch picky, but you are asking about X11. X11 is not
part of the OS. It is a process that runs like any other process on your
computer. This is a huge difference between UNIX/Linux and Windows. On
Windows, the desktop graphic system is part of the OS.

Anyway, X11 may support rgba cursors. Take a look at
http://www.die.net/doc/linux/man/man3/xcursor.3.html or google for “man
page xcursor” for more info. As far as I can tell SDL does not support
color cursors. There is no guarantee that a given platform supports
color cursors, in fact there is no guarantee that a given platform will
support cursors at all (and many do not). So, SDL supports 2 plane
cursors, nice middle ground.

It looks like color cursor support was removed from SDL in version
0.9.14, a very long time ago. I’m sure there were good reasons for
removing it. I wonder if those reasons are still valid. I wasn’t around
this list back then so I don’t know the reasons.

	Bob PendletonOn Tue, 2005-05-03 at 22:13 +0100, Dominique Louis wrote:

Dominique Louis.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

It looks like color cursor support was removed from SDL in version
0.9.14, a very long time ago. I’m sure there were good reasons for
removing it. I wonder if those reasons are still valid. I wasn’t around
this list back then so I don’t know the reasons.

Color cursor support was implemented as a software surface managed by
SDL, which had the same problems as the existing cursor in fullscreen
hardware single-buffered mode, but all the time. :slight_smile:

I’m certainly not opposed to re-adding support for it to the API, as
long as there are enough back-ends that support it internally.

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