Re: [AD] mouse_api branch

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


On 2006-08-26, Peter Hull <peterhull90@xxxxxxxxxx> wrote:
> On 8/26/06, Robert Ohannessian <ROhannessian@xxxxxxxxxx> wrote:
> > For any game where mouse movements are used, not having events generated
> > when the mouse is outside the window will make it very annoying for
> > users.
> Right - the demo game for OpenLayer is a case in point.

This is about FPS-style games which require infinite movement in any
direction, right?  That requires not just mouse events when outside the
window, but the mouse should not be allowed to leave the window,
otherwise you couldn't click to fire.

Back in the alleg-bigfive days, we had functions in the proposal[1] to
switch into such a mode.  On window systems that supported it, the mouse
would be trapped in the window.  On other window systems, we'd resort to
hacks like centering the mouse cursor every time it moved.

Also, maybe we should leave it platform specific whether mouse events
could be generated outside of the window.  Taking the X port as an
example, it does generate events after your cursor leaves the window if
you were holding down a mouse button when the cursor left.  That's just
how X naturally works.  If some other platform works a different way, we
can allow that to be exposed to the Allegro user.

> There is a function in the vtable mouse_set_range() which could be
> called with (INT_MIN, INT_MIN, INT_MAX, INT_MAX)  to 'unconstrain' the
> mouse and (0, 0, SCREEN_W, SCREEN_H) to constrain it. There could be
> convenience functions for these two cases.

I don't like the set_range() functions at all, as I'm not sure what it
should do in a windowing environment.

Peter

[1] http://alleg.sourceforge.net/future/pointer.txt





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