Re: [AD] Using system mouse cursor

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


On Sunday 05 September 2004 02:20, Chris wrote:
> Nope, changes nothing. :/

Ok, I'm going to revert in my local tree then. It seems to cause some 
erratic behavior in some of my own programs.

> I did, however, completely rebuild AllegroGL (since that's what my 
> program uses) and it cleared up some of the problems, but the mouse 
> still seems to be eratic when reentering the game window. It'll stutter 
> around, sometimes fixing itself after a few moments and other times not.

Are you using the mickeys at all? Or just with reading the mouse position 
and displaying it on the screen?

> Me and Elias were discussing, before you had a chance to get on IRC.. 
> and we think the best thing to do is remove the mouse warping hack. I 
> think what we should do is require the user to periodically call 
> position_mouse if they want continued movement, and either leave 
> get_mouse_mickeys undefined when it goes past the screen edge or force 
> it to not get movement when it does (for platforms that do get continued 
> movement).

I think this makes sense for windowed mode at least. I'd like the mouse to 
have two modes: a mickey mode and a normal mode. Mickey mode disables the 
hardware cursor and re-enables the mouse warping.
As far as I can tell, this is what SDL does too. The problem is that it 
breaks the API somewhat. On the plus side, it eliminates a lot of problems 
caused by features someone may not want to use at all.

> The only places get_mouse_mickeys has ever worked right, 
> AFAIK, is DOS, fullscreen modes in Windows (windowed modes have problems 
> when hitting the edge of the desktop), and possibly Linux console. 
> Everywhere else has either not worked right or required hacks to do so.

I think that's right.

> PS. BTW, what would happen if a program tracked the mouse via 
> get_mouse_mickeys and drew it manually? Like if they want to implement 
> some kind of mouse smoothing feature (like many FPSs do nowadays). 
> AFAICS, the mouse would enter "mickey mode" and then get stuck in one 
> spot. The warp hack assumes the user won't be calling get_mouse_mickeys 
> if they're drawing it manually.

The mouse_x and mouse_y variables (positioning Allegro's mouse) continue to 
be updated normally. I'm not sure if that's what you meant?

> Plus, it seems to have a nasty habit of 
> making Allegro switch to drawing it in the timer and back again if 
> conditions are "just right". IMO, the only thing that should cause it to 
> switch back to timered drawing is an invalid (to the system) image.. 
> having it possibly do it literally at any time is very ugly.

Yes, it is.
The mouse routines could actually benefit from a rewrite too, I guess...

Evert





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