Re: [AD] Using system mouse cursor

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


> I've used the mickeys function directly and I've tried just 
> repositioning the mouse and getting the difference myself. They both 
> have stuttering problems, though the mickeys function moreso.

Weird... I don't understand this problem at all really... I'll see if I can 
reproduce it when I use some of my own programs a bit more (not just the 
tests provided by Allegro).

> I wasn't fully aware it did that, but it would still behave differently. 
> Under such circumstances, the mouse would not be able to leave the 
> program window unless there was a fast mouse jerk so that it moves out 
> of the window before Allegro catches it again, because "mickey mode" has 
> the OS cursor locked in place.

What I'd propose is the following: disable the mouse warping hack in X11 
windowed mode (so that it behaves as Windows does), but have a default 
warping mode in fullscreen mode. In this case, Allegro is responsible for 
drawing the mouse cursor, otherwise we can use the system cursor.
Add a function that allows the user to override this behavior explicitly 
say, 
int set_mouse_mode(int mode)
where mode can be any of (say) MOUSE_WARP, MOUSE_NORMAL, MOUSE_AUTO. 
MOUSE_WARP enables the mouse warping, MOUSE_NORMAL disables it, MOUSE_AUTO 
switches to whatever is the default (non-warped for X11 Windowed, warped 
for X11 fullscreen and non-warped for Windows in any case. Not sure how 
the MacOS X port handles these things). Returns 0 on succes, non-zero on 
failure (in Windows, it wouldn't do anything with the current design, or 
rather, it wouldn't be nescessary).
We can add a flag to gfx_capabilities to tell the user wether or not mouse 
mickeys requires warping the cursor (although this may be abuse of the 
gfx_capabilities variable).

Evert





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