Re: [AD] Using system mouse cursor

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


> There shouldn't be much of a difference between hardware and system 
> cursors. The only difference should be if the hardware cursor being 
> requested has a user-specified bitmap. If not, try to set the system 
> cursor. If not, or if that doesn't work, set the default cursor Allegro 
> has. Why should they be any different beyond that?

I think we mean different things by the name hardware cursor.
The way I use it is in the sense of the current implementation: it is a 
custom cursor that is drawn by the OS rather than Allegro. So in that 
context, it does not make sense to talk about `if the hardware cursor has 
a user specified bitmap' because it does so by definition.

> Why don't you set mouse_sprite to NULL for custom hardware cursors?

Because you need the mouse_sprite to construct the custom cursor when 
show_mouse() is called, or when set_mouse_focus() is called (see the 
hardware_cursor_dirty flag in mouse .c to see what I mean).

> Or 
> turned around, why don't you set mouse_sprite to the Allegro default 
> when a system cursor is set?

That could work.

> But since Allegro is not designed for that kind of seperation, we should 
> make as few differences as possible.

Actually, what we are currently trying to do is what Allegro was not 
designed to do.

> The majority of API seperation 
> should be between software and hardware cursors (and even this should be 
> kept minimal), with system cursors being tacked on to hardware cursors 
> (and implicitly inherit the same behavior from them).

There is currently no distinction between hard and soft cursor at the API 
level, except that the former may need to be explicitly enabled to be 
used.
System cursors are, in principle, a different entity in that Allegro does 
not (normally) draw them, except when the system has no default cursor. In 
behavior, they are similar enough to hardware cursors (except when Allegro 
draws them) as to make the distinction irrelevant to the user of the 
library. The subtle difference matters to the internal library code 
though.

Evert





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