[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Tuesday 22 March 2005 21:12, Elias Pschernig wrote:
> Attached is a new patch (still needs some cleanup). It does this
> compared to the last:
>
> - You can now use custom bitmaps with MOUSE_CURSOR_ALLEGRO, and hide the
> cursor with MOUSE_CURSOR_NONE. So that makes show_os_cursor complete.
First of all, great! But I have some questions/concerns:
Can I still use the show_mouse() API and get the benefit of hardware
cursors if they are available, ie, without having to change too much code?
If not, any chance of getting that back (shouldn't be too hard - just use
the hardware cursor if the target bitmap is the screen)? For me, the
hardware cursor loses much of its usefulness if it doesn't.
How does your patch affect scare_mouse()? Do I need to encapsulate every
call to scare_mouse() with a check if I have a hardware cursor active? I
got the impression you removed the flags from gfx_capabilities - is there
a different way for me to check this?
But again, if I can't tell Allegro to use the hardware cursor (with a
custom bitmap) if it's available with show_mouse() or fall back to
software rendering if it isn't and not think about this in the rest of my
code it is almost useless to me. Native OS pointers are a different issue
as they didn't exist in Allegro until recently. For them, I think it's
perfectly fine and sensible to have a seperate API.
> - The functions enable_hardware_cursor, disable_hardware_cursor,
> select_mouse_cursor are gone, since they are no longer needed.
Hmm... can we remove symbols between WIPs? I guess so, as the docs
explicitly state that WIP releases can break compatibility, but this still
feels a bit iffy to me. I think this has always meant that symbols can be
added in previous releases. Are there precedents for this?
> - In X11, the mouse mickey hack is gone.
I object to this because I think it is a mistake. It means that
get_mouse_mickeys() is broken in X11. Remember that in X, the mouse only
generates movement events while it is within the window, meaning you don't
even get movement events if the mouse is on the edge of the screen for
fullscreen modes or outside the window in windowed modes. That breaks
existing programmes without an obvious fix for the end user of the
library.
The reason is that mouse mickeys cannot be retrieved reliably across
different platforms, but this is something that should have been realized
and put into Allegro's docs back when the X11 port was made and Allegro
became cross-platform, I don't think we should change it now. Of course,
such things are easier to say with hindsight.
As much as I hate the mickey hack and how it uglifies and complicates the
X11 mouse driver code, unless we can come up with something that provides
the same functionality (ie, mouse mickeys) I think it should stay. For
reference, SDL uses the same hack Allegro uses (warping the mouse to the
centre of the window) but it needs to be enabled explicitly by switching
the mouse to `relative' mode rather than `absolute' mode as opposed to
providing both relative and absolute coordinates as Allegro does.
> I also added show_os_cursor to exmouse to test it. But the real
> advantage is in programs who use e.g. double buffering.
What's the advantage over the current way with a call to
enable_hardware_cursor() at the start? It shouldn't make any difference at
all with the current implementation as far as I can see.
Evert