Re: [AD] Using system mouse cursor

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


Evert Glebbeek wrote:
Right. Can't say I like it that well myself, but I couldn't think of a
viable alternative either. I can change it before commiting the patch
though (or after, but then it becomes somewhat more complicated).

Well, I did have an idea. First, the function would be named select_hardware_cursor. It would also be paired with a function set_hardware_cursor, to which you can pass bitmaps for the different cursor states (or NULL for system or Allegro default, depending on what's available). You would use it like so:

// Set default cursor types
set_hardware_cursor(CURSOR_POINTER, custom_pointer);
set_hardware_cursor(CURSOR_WAIT, custom_waitpointer);
/* etc... */

Then to use them:
select_hardware_cursor(CURSOR_POINTER);
foo();
select_hardware_cursor(CURSOR_WAIT);
bar();

And set_hardware_cursor would update the cursor in real time, so if you have CURSOR_WAIT selected, and subsequently change CURSOR_WAIT, the mouse would update on-screen automatically (useful for animated cursors).

These functions would also behave exactly the same for drivers where there is a real hardware (not OS) cursor.. except passing NULL to set_hardware_cursor would set it to Allegro's default cursor(s).

- Kitty Cat




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