Re: [AD] Using system mouse cursor |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Saturday 02 October 2004 14:13, Chris wrote:
> When I say hardware cursor, I mean a cursor (typically custom, but it
> not need be so) that is drawn by something above Allegro (the graphics
> hardware and/or the OS). In my mind it would be silly to seperate the
> two (hardware and OS cursor) since that is solely up to the mouse (and
> possibly graphics) drivers to implement.
Except that the term hardware cursor is already used by Allegro in the
sense in which I used it and the term system cursors was not yet defined.
So the distinction is in that sense historical.
> Allegro had some design plans for hardware cursors.. whether they were
> ever fully fleshed out or not I can't say (didn't the VBE/AF driver
> support hardware cursors?).
They were. Adding hardware cursors to the X11 and DirectX windowed drivers
was only a matter of filling in the respective vtable entries. The VBA/AF
driver was supposed to support hardware cursors, but it is marked in the
code as `todo' (which obviously never happened). The Linux console divers
support one, I think, and the GDI driver fakes one. They were already
mentioned in the 3.11 docs, so I can only assume that the old DOS port of
Allegro already supported them in some circumstances (as I recall, DOS
could do 16x16 black and white cursors).
> If the system has no default cursor, wouldn't there be no system
> cursor(s) to draw?
Allegro draws its own default cursor (the black arrow or the black watch)
in that case, with the current setup. To be honest, I'd rather have it
fail outright when a system cursor is requested that isn't available
instead of switching back to a soft cursor.
> But Allegro itself would never draw system or (custom) hardware cursors.
See above. Allegro draws its own default cursor as a system cursor if there
is no real system cursor to draw.
> That's the whole point of them, to leave the hardware and/or OS to do it
> for us. Allegro would only ever draw its own (default or user-supplied)
> when the software cursor is used.
Ok, thought about it some more and I think I have the naming mess/confusion
sorted out. The problem is that at the driver level there are two types of
mouse cursor: hard (drawn by the system) and soft (drawn by Allegro from a
timer).
At the API level, there are two other types of cursor: custom and system.
Custom cursors are typically soft cursors, although some drivers can use a
hard cursor to display a custom cursor shape. This is the only cursor type
that existed in Allegro upto now.
System cursors are typically hard cursors where the shape is determined by
the OS, except when the driver does not offer this functionality: then
they are soft cursors drawn by Allegro with their shape determined by
Allegro.
It is this non one-to-one mapping that gives me a headache because I find
it tricky to implement consistent behavior in all circumstances. It would
be a lot easier if system cursors are always hard cursors (meaning that
Allegro will never try to draw its own).
Evert