Re: [AD] Using system mouse cursor

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


On Fri, 1 Oct 2004 22:59:38 +0200, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> Next iteration attached. I think this implements most of the behavior that
> was discussed earlier: passing NULL selects the system default (or
> Allegro's if that is not available) cursor.
> What I haven't changed is the behavior of show_mouse(): this will not draw
> a new cursor even if the requested surface is a memory bitmap if the
> hardware cursor is being displayed. I don't think that would really make
> much sense.
> 

Yes - there should never be two mouse pointers at the same time. But
maybe show_mouse should disable the hardware cursor - it would just
need to call disable_hardware_cursor at the beginning. And
show_mouse(NULL) as a way to always remove any mouse cursor, software
or not, also seems to be a good idea to me.

// default: no mouse at all inside the Allegro window
show_mouse(my_bitmap)
// now I can be sure the mouse is drawn into that bitmap (from a timer)
enable_hardware_cursor()
// now the hardware cursor is drawn - if possible, else it stays in my_bitmap
show_mouse(NULL)
// no more mouse is displayed
enable_hardware_cursor()
// the hardware mouse is displayed again
show_mouse(my_bitmap)
// the mouse again is in my_bitmap
disable_hardware_cursor()
// it is drawn in my_bitmap again

Would all the comments above be true with your patch? I think the
behavior implied by them makes sense..




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