Re: [AD] mouse_api branch |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] mouse_api branch
- From: Elias Pschernig <elias@xxxxxxxxxx>
- Date: Sun, 27 Aug 2006 03:56:06 +0200
On Sun, 2006-08-27 at 11:34 +1000, Peter Wang wrote:
>
> > 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.
Under X11, I think we should use the "confine_to" parameter here:
http://ftp.x.org/pub/X11R7.0/doc/html/XGrabPointer.3.html
It's what the FPS games I played under X11 seem to do (probably combined
with a warp-to-center hack as we do in Allegro). The only annoying
aspect of it is when they forget to provide a way to un-confine the
mouse.. but that's nothing we should care about in Allegro.
About the API, I would be against using special cased INT_MIN/INT_MAX
parameters, and instead have a separate function like al_capture_mouse.
I think at least under Windows, it can be implemented just as easily.
--
Elias Pschernig