Re: [AD] Mouse cusor documentation

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


Evert Glebbeek wrote:
(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).

Actually it does, just not as badly as X. In X you'll lose mickeys after leaving/hitting the edge of the program. In Windows you'll lose mickeys when hitting the edge of the desktop.

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);

This looks perfect to me. Although I would like to request if you could make gfx_capabilities & GFX_HW_MOUSE (or whatever it is) be true if the mouse is shown on a NULL bitmap and the driver supports the current pointer.. this way you don't have to display the pointer if you want to find out if the current mouse pointer will work.

One thing I noticed though is that you use is_same_bitmap (_mouse_screen, screen) to test if the mouse pointer is on the screen or not. This won't work very good on platforms where ALLEGRO_VRAM_SINGLE_SURFACE is defined, since _mouse_screen could be pointing to any video bitmap. I think it'd be better to just test if _mouse_screen == screen.

- Kitty Cat




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