Re: [AD] Using system mouse cursor

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


Evert Glebbeek wrote:
disable_hardware_cursor() isn't for hiding the hardware cursor - it's for disallowing it in case you want to use mickeys. Although I suppose that show_mouse(NULL) could hide the system pointer as well.

IMO, show_mouse(NULL) should hide the cursor regardless of which type it is or mode it's in.

Bear in mind the following distinction in the nomenclature:
 * Software cursor (the custom cursor drawn by Allegro)
 * Hardware cursor (the custom cursor drawn by the OS rather than Allegro)
 * System cursor (the system default cursor)

The system cursor is a different entity from the hardware cursor, although for platforms that have a system cursor it behaves in a similar way in that Allegro doesn't need to handle drawing it. It can be a software cursor if the platform doesn't have a native cursor and Allegro's defaults are used.

This is where you need to be careful. Again IMO, the system cursor should just be special extension to hardware cursors. If you do something to the hardware cursor, it should have the same exact effect on a system cursor. Don't forget, the system cursor is just a nice hack on top of hardware cursors, so trying to seperate them will only lead to problems.

Ultimately, the API should hide the differences as much as possible, and the end user would only see a `custom cursor' or a `system default' cursor.

Not even that, IMO. Unless you classify the Allegro defaults as system defaults. Because think about it.. if you call
set_mouse_sprite(MOUSE_CURSOR_ARROW, NULL);
there is now no way for the user to tell if they're using a system cursor, or if a system cursor isn't available and he got Allegro's default. This is why there should be very little, if not no, difference in the behavior of system and custom hardware cursors.

What I think is confusing is that the MOUSE_CURSOR_ARROW and such are really system cursors, which can be turned into custom cursors by specifying a bitmap for them which is not NULL.

You're kinda thinking backwards. It's not that custom cursors become a special case of system cursors with a specified bitmap. It's that system cursors are a special case of custom cursors when the specified bitmap is NULL /and/ the driver supports it.

- Kitty Cat




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