Re: [AD] Mouse cusor documentation

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


> I think enable_hardware_cursor should be more than just signalling that
> it is ok to use hardware cursor. I'd actually like it to enable the
> hardware cursor immediately, like show_mouse(screen) does with the
> software cursor.

No. Remember: enable_hardware_cursor() was initially only added because the 
hardware cursor under X11 is incompatible with get_mouse_mickeys(). 
Hardware cursor in this context also only refers to a cursor drawn by the 
OS as opposed to being drawn by Allegro. It doesn't have anything at all 
to do with Allegro using the system default cursors, which still needs to 
be finalized.

If you want to use the software cursor, simply disable the hardware one. 
show_mouse() shouldn't change this preference, but merely do what it's 
told to do: display the mouse cursor, whichever form this takes.

> This won't break the API, 

Yes, it will. It will change how hardware cursors (supposedly) work in 
earlier versions of Allegro. Also, it will make it harder for existing 
programs to benefit from the hardware cursor, because you need to do two 
seperate things depending on wether you want a hardware cursor or not 
(call show_mouse() or not).
Otherwise, you just need to call enable_hardware_cursor() once, which is an 
addition of one line, for the program to take advantage of the new feature 
(and actually, Windows programs benefit automatically as there is no 
reason not to use the hardware cursor there by default - it doesn't 
conflict with mouse mickeys).

> Well, if enable_hardware_cursor() immediately enables the cursor if
> possible, there's no need to use show_mouse(screen).

enable_hardware_cursor() should not duplicate show_mouse(). The user may 
call enable_hardware_cursor() whenever he or she wants, without having any 
intention to have a mouse cursor pop up at that time. Basically, all it 
does is set a hint for show_mouse() on how to do this.

> show_mouse(screen)
> wouldn't need to change at all. And show_mouse(NULL) would disable any
> cursor, software or not. So, no API breakage at all.

Currently, we have

// Let OS draw the cursor for us if it can
enable_hardware_cursor();

// display the mouse on screen (OS will do this if the driver supports it)
show_mouse(screen);

// hide mouse
show_mouse(NULL);

// Draw mouse on backbuffer (OS can't do this, so Allegro does)
show_mouse(buffer);

I'm not exactly sure what the discussion is about. This behavior is 
consistent with the existing API and behavior and has a minimum amount of 
effort needed to make use of the new features.

Evert





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