# SDL Cursors in color?

**URL:** <https://discourse.libsdl.org/t/sdl-cursors-in-color/6349>\
**Category:** SDL Development\
**Created:** [April 2, 2002, 7:05pm UTC](https://discourse.libsdl.org/t/sdl-cursors-in-color/6349 "2002-04-02T19:05:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaB\_JacKaL](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/h/41988e/32.png) [@HaB\_JacKaL](https://discourse.libsdl.org/u/HaB_JacKaL)\
**Post date:** [April 2, 2002, 7:05pm UTC](https://discourse.libsdl.org/t/sdl-cursors-in-color/6349/1 "2002-04-02T19:05:01Z")

</div>

Using the example code on the manpage for SDL\_SetCursor, I can get the  
cursor to change, but if I try to add colors other than black/white or None  
to the pixmap, I get no colors, and usually the system cursor.

Is there a way to do custom cursors in color?

I writing a game in which the user aims with the mouse, so I’m going for a  
red crosshair sort of thing here…

TIA

-HaB\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
MSN Photos is the easiest way to share and print your photos:  
[http://photos.msn.com/support/worldwide.aspx](http://photos.msn.com/support/worldwide.aspx)

---

<div class="post-metadata">

**Author:** ![Rainer\_Deyke](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/a9a28c/32.png) [@Rainer\_Deyke](https://discourse.libsdl.org/u/Rainer_Deyke)\
**Post date:** [April 2, 2002, 7:16pm UTC](https://discourse.libsdl.org/t/sdl-cursors-in-color/6349/2 "2002-04-02T19:16:01Z")

</div>

“HaB JacKaL” wrote in message  
news:mailman.1017803103.25337.sdl at [libsdl.org](http://libsdl.org)…

> Using the example code on the manpage for SDL\_SetCursor, I can get  
> the  
> cursor to change, but if I try to add colors other than black/white  
> or None  
> to the pixmap, I get no colors, and usually the system cursor.
> 
> Is there a way to do custom cursors in color?

Yes: draw it yourself.–  
Rainer Deyke | root at [rainerdeyke.com](http://rainerdeyke.com) | [http://rainerdeyke.com](http://rainerdeyke.com)

---

<div class="post-metadata">

**Author:** ![HaB\_JacKaL](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/h/41988e/32.png) [@HaB\_JacKaL](https://discourse.libsdl.org/u/HaB_JacKaL)\
**Post date:** [April 2, 2002, 7:43pm UTC](https://discourse.libsdl.org/t/sdl-cursors-in-color/6349/3 "2002-04-02T19:43:00Z")

</div>

> “HaB JacKaL” \<@HaB\_JacKaL\> wrote in message  
> news:mailman.1017803103.25337.sdl at [libsdl.org](http://libsdl.org)…
> 
> > Using the example code on the manpage for SDL\_SetCursor, I can get  
> > the  
> > cursor to change, but if I try to add colors other than black/white  
> > or None  
> > to the pixmap, I get no colors, and usually the system cursor.
> > 
> > Is there a way to do custom cursors in color?
> 
> Yes: draw it yourself.

Er…sorry. Isn’t that what I was doing? I was editing the pixmap myself,  
and adding color to it, and changing the shape of it. Or do you mean  
something else?

-HaB\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
Chat with friends online, try MSN Messenger: [http://messenger.msn.com](http://messenger.msn.com)

---

<div class="post-metadata">

**Author:** ![Jason\_Hoffoss](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/a9adbd/32.png) [@Jason\_Hoffoss](https://discourse.libsdl.org/u/Jason_Hoffoss)\
**Post date:** [April 2, 2002, 8:12pm UTC](https://discourse.libsdl.org/t/sdl-cursors-in-color/6349/4 "2002-04-02T20:12:01Z")

</div>

> > > “HaB JacKaL” wrote in message  
> > > news:mailman.1017803103.25337.sdl at [libsdl.org](http://libsdl.org)…
> > > 
> > > > Using the example code on the manpage for SDL\_SetCursor, I can get  
> > > > the  
> > > > cursor to change, but if I try to add colors other than black/white  
> > > > or None  
> > > > to the pixmap, I get no colors, and usually the system cursor.
> > > > 
> > > > Is there a way to do custom cursors in color?
> > > 
> > > Yes: draw it yourself.
> > 
> > Er…sorry. Isn’t that what I was doing? I was editing the pixmap  
> > myself,  
> > and adding color to it, and changing the shape of it. Or do you mean  
> > something else?
> 
> No, you are trying to use SDL\_SetCursor() to set a cursor for SDL to draw,  
> yes? That isn’t drawing it yourself, that’s SDL drawing it for you. Use  
> SDL\_BlitSurface() instead and you will be drawing it yourself. Make sense?  
> 🙂
> 
> -Jason
> 
> > ----- Original Message -----  
> > From: [feelthel0ve@hotmail.com](mailto:feelthel0ve@hotmail.com) (HaB JacKaL)  
> > To:   
> > Sent: Tuesday, April 02, 2002 10:41 PM  
> > Subject: Re: [SDL] SDL Cursors in color?
