Re: [AD] Using system mouse cursor

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


On Sunday 03 October 2004 00:43, Chris wrote:
> If Allegro can't set a system cursor, no it shouldn't switch back to a 
> software cursor. It should switch to a custom hardware cursor, using 
> Allegro's default cursors.

Not all drivers support hardware cursors - and most drivers that do also 
support system cursors. So switching to a custom cursor when there is no 
system cursor isn't that useful if it should only be done for hardware 
cursors IMO.

> Why are these seperate at the API level? The only way to get a system 
> cursor is to pass NULL to set_mouse_cursor, but this can still give you 
> a custom cursor if a system one isn't available. How does/why should the 
> API differ past that?

Ok, maybe not API. I meant from the user's perspective.
The user decides if he wants a system or a custom cursor. Allegro decides 
if it uses a hard or soft cursor to display it. That's what I meant (I 
think - too late to think clearly).

> I think you're over-analyzing it. Custom cursors are done in software, 
> unless the mouse driver can put them into hardware/the OS (and the 
> appropriate function has been called). If a NULL cursor bitmap has been 
> set to use, it selects a system cursor if available, or else it uses 
> Allegro's default (in hardware).

The latter part is what can't be guarenteed (hardware cursors aren't 
supported by all drivers).

> * If bitmap is NULL, try to set a system cursor (done by the OS/
hardware).
> * If that fails/isn't available/bitmap isn't NULL, try to set a custom 
> hardware cursor using bitmap (if not NULL) or Allegro's default.
> * If that fails (shouldn't if bitmap is NULL), set a software cursor.

Yes. This is what the code I posted does (although it could be cleaned up).

At this point, I think the discussion is mostly about semantics on what 
under which circumstances should be called a system/hardware or software 
cursor.

Evert





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