Re: [AD] Using system mouse cursor |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Evert Glebbeek 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.
It seems to be good, at least until I get around to testing it. But I do
have a couple questions.
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.
First, shouldn't show_mouse(NULL) remove the mouse cursor, despite the
mode? I can sort of understand not wanting to turn off the hardware
mouse for memory bitmaps, but there should be an easy way to disable the
mouse cursor completely while using the hardware cursor, IMO.
And I can't see anything where it tries to set a custom hardware/OS
cursor. Maybe I'm missing it, or the code is already there and just not
shown in the diff, but I don't see it.
Oh, couple more things I just noticed...
> +/* Mouse cursors */
> +#define MOUSE_CURSOR_ALLEGRO 0
> +#define MOUSE_CURSOR_NONE 0
Are those two supposed to be the same? And...
+ use_system_cursor = 0;
+ if (!cursors[cursor] || cursor != MOUSE_CURSOR_ALLEGRO) {
+ /* Use default system cursor */
+ if (mouse_driver && mouse_driver->select_system_cursor) {
+ use_system_cursor = mouse_driver->select_system_cursor(cursor);
+ if (use_system_cursor)
+ gfx_capabilities |= GFX_HW_CURSOR;
+ }
+ }
That means it'll try to select the default OS cursor if you're not using
MOUSE_CURSOR_ALLEGRO, regardless if you have a custom pointer set for it
or not. Changing the || to && should work, or you can just not test if
cursor != MOUSE_CURSOR_ALLEGRO and let the driver method fail (though I
prefer the former method.. change || to &&.. it'd be a touch quicker).
- Kitty Cat