Re: [AD] Using system mouse cursor |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Chris wrote:
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).
Better leave get_mouse_mickeys() to do whatever is most natural in the
current gfx mode, and have a flag (or function) that tells the user
whether they need to keep calling position_mouse() or not. For example,
RTS games could take advantage of infinite mouse mickeys for scrolling,
but if infinite mouse mickeys are not available they could resort to
scrolling when the mouse hits the edge (I imagine it'd be less
comfortable, but would still be acceptable).
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.
For the record, it works in Linux console. And fullscreen in Windows is
probably the most used target of all.
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.
It should work just fine. The warping hack affects the X system mouse
cursor, which does not necessarily correspond to the position reported
by mouse_x, mouse_y.
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.
Peter