Re: [AD] Using system mouse cursor

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Peter Wang wrote:
>>>It was my understanding that Allegro was supposed to use the
>>>hardware/system cursor where possible anyway, as long as it could
>>>properly change it.
>>
>> I dunno.
>
> Well, the hardware cursor anyway.. though I think this should be applied
> to system cursors as well (pretty much anywhere when Allegro doesn't
> have to worry about drawing it).

Oh right.  I was only thinking of hardware cursors.

>
>> I don't think it's particularly difficult, but it's my understanding
>> that
>> hardware cursors are limited to b&w.
>
> I doubt that's true anymore. In any case, as long as the OS can handle
> the mouse graphic as-is for us, wouldn't it be best to let it? Even if
> it ends up using a non-hardware cursor to draw it (like Win9x), we
> wouldn't have to worry about drawing it in an timer. I know Windows can
> accept multi-colored cursors.. I've even seen Windows cursors that
> invert the colors on the screen where the mouse pointer is. I believe X
> can too.

I don't think I've seen coloured cursors in X... so far.  An interesting
thing to look at is GDK's cursor API:

http://developer.gnome.org/doc/API/2.0/gdk/gdk-Cursors.html

"GdkCursor*  gdk_cursor_new_from_pixbuf      (GdkDisplay *display,
                                             GdkPixbuf *pixbuf,
                                             gint x,
                                             gint y);

Creates a new cursor from a pixbuf.

Not all GDK backends support RGBA cursors. If they are not supported, a
monochrome approximation will be displayed. The functions
gdk_display_supports_cursor_alpha() and
gdk_display_supports_cursor_color() can be used to determine whether RGBA
cursors are supported; gdk_display_get_default_cursor_size() and
gdk_display_get_maximal_cursor_size() give information about cursor sizes.

On the X backend, support for RGBA cursors requires a sufficently new
version of the X Render extension."


Peter

PS. Sorry if I accidentally sent off two extra copies of this message.





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/