Re: [AD] Mouse cusor documentation

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


On Sun, 2004-10-03 at 17:02 +0200, Evert Glebbeek wrote:

> // 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.
> 

Well, you save commands with my way in a double buffered app:

enable_hardware_cursor()
while(1)
    if (no hw cursor) draw_sprite

vs.

enable_hardware_cursor()
show_mouse(screen)
if (no hw cursor)
    show_mouse(NULL)
while(1)
    if (no hw cursor) draw_sprite

And, you even might get a short mouse flicker in the case there's no HW
cursor available. If enable_hardware_cursor would have the behavior I
was suggesting, it would either display the hw cursor or not - so in the
above case, I'd prefer it.

In the case of an old GUI app, you would need a single call to
enable_hardware_cursor in both cases (with the current behavior, before
show_mouse(screen), with my behavior, after). But maybe the function I
want should better be called show_hardware_cursor.

-- 
Elias Pschernig





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