Hi,
My dream of writing a quake style shooter in Gem (heh) has been foiled. Apparently neither Gem nor luagl support the glutWarpPointer call which many shooters use to restrict the mouse to the centre of the screen between reads of the mouse pointer movements (so the mouse can't move off the screen). That and the fact that the Gem window sometimes seems to not pick up key presses in full screen mode. Any chance we can add glutWarpPointer to Gem? Any other ideas?
Best,
Chris.
It would mean requiring GLUT to build GEM, which is a dependency we removed a while ago. Also, this function apparently does not work on OSX.
On Dec 14, 2007 4:43 AM, Chris McCormick chris@mccormick.cx wrote:
Hi,
My dream of writing a quake style shooter in Gem (heh) has been foiled. Apparently neither Gem nor luagl support the glutWarpPointer call which many shooters use to restrict the mouse to the centre of the screen between reads of the mouse pointer movements (so the mouse can't move off the screen). That and the fact that the Gem window sometimes seems to not pick up key presses in full screen mode. Any chance we can add glutWarpPointer to Gem? Any other ideas?
Best,
Chris.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Dec 14, 2007 4:43 AM, Chris McCormick chris@mccormick.cx wrote:
My dream of writing a quake style shooter in Gem (heh) has been foiled. Apparently neither Gem nor luagl support the glutWarpPointer call which
On Fri, Dec 14, 2007 at 09:43:24AM -0600, chris clepper wrote:
It would mean requiring GLUT to build GEM, which is a dependency we removed a while ago. Also, this function apparently does not work on OSX.
Ah ok, I'm glad Gem doesn't depend on GLUT. Do you know how games like Quake get mouse-look values on OSX without allowing the mouse to go outside the window?
Best,
Chris.
On Dec 16, 2007, at 1:07 AM, Chris McCormick wrote:
On Dec 14, 2007 4:43 AM, Chris McCormick chris@mccormick.cx wrote:
My dream of writing a quake style shooter in Gem (heh) has been
foiled. Apparently neither Gem nor luagl support the glutWarpPointer call
whichOn Fri, Dec 14, 2007 at 09:43:24AM -0600, chris clepper wrote:
It would mean requiring GLUT to build GEM, which is a dependency
we removed a while ago. Also, this function apparently does not work on OSX.Ah ok, I'm glad Gem doesn't depend on GLUT. Do you know how games like Quake get mouse-look values on OSX without allowing the mouse to go outside the window?
They probably use the USB HID API for getting the data directly from
the devices. Then you can turn off the mouse pointer and ignore it
completely.
.hc
"Free software means you control what your computer does. Non-free
software means someone else controls that, and to some extent
controls you." - Richard M. Stallman
On Mon, Dec 17, 2007 at 12:14:25AM -0500, Hans-Christoph Steiner wrote:
On Dec 16, 2007, at 1:07 AM, Chris McCormick wrote:
On Dec 14, 2007 4:43 AM, Chris McCormick chris@mccormick.cx wrote:
My dream of writing a quake style shooter in Gem (heh) has been
foiled. Apparently neither Gem nor luagl support the glutWarpPointer call
whichOn Fri, Dec 14, 2007 at 09:43:24AM -0600, chris clepper wrote:
It would mean requiring GLUT to build GEM, which is a dependency
we removed a while ago. Also, this function apparently does not work on OSX.Ah ok, I'm glad Gem doesn't depend on GLUT. Do you know how games like Quake get mouse-look values on OSX without allowing the mouse to go outside the window?
They probably use the USB HID API for getting the data directly from
the devices. Then you can turn off the mouse pointer and ignore it
completely.
That didn't sound portable enough to me (not all mice are USB), so I checked the Quake3 source code and they use a Core Graphics call/callback on Mac OSX.
I think I'll wrap SDL in some externals and let it take care of all of this for me.
Best,
Chris.
On Dec 16, 2007, at 10:31 PM, Chris McCormick wrote:
On Mon, Dec 17, 2007 at 12:14:25AM -0500, Hans-Christoph Steiner
wrote:On Dec 16, 2007, at 1:07 AM, Chris McCormick wrote:
On Dec 14, 2007 4:43 AM, Chris McCormick chris@mccormick.cx
wrote:My dream of writing a quake style shooter in Gem (heh) has been foiled. Apparently neither Gem nor luagl support the glutWarpPointer call which
On Fri, Dec 14, 2007 at 09:43:24AM -0600, chris clepper wrote:
It would mean requiring GLUT to build GEM, which is a dependency we removed a while ago. Also, this function apparently does not work on OSX.
Ah ok, I'm glad Gem doesn't depend on GLUT. Do you know how games
like Quake get mouse-look values on OSX without allowing the mouse to go outside the window?They probably use the USB HID API for getting the data directly from the devices. Then you can turn off the mouse pointer and ignore it completely.
That didn't sound portable enough to me (not all mice are USB), so I checked the Quake3 source code and they use a Core Graphics call/ callback on Mac OSX.
I think I'll wrap SDL in some externals and let it take care of all of this for me.
I think an SDL external can be useful. I chose not to use SDL for
[hid] because it does not allow raw access to the data from the
device. [hid] doesn't work on Windows, [hidio] isn't done yet, but
that will work on all three platforms.
.hc
Looking at things from a more basic level, you can come up with a
more direct solution... It may sound small in theory, but it in
practice, it can change entire economies. - Amy Smith
On Fri, 14 Dec 2007, Chris McCormick wrote:
My dream of writing a quake style shooter in Gem (heh) has been foiled. Apparently neither Gem nor luagl support the glutWarpPointer call which many shooters use to restrict the mouse to the centre of the screen between reads of the mouse pointer movements (so the mouse can't move off the screen). That and the fact that the Gem window sometimes seems to not pick up key presses in full screen mode. Any chance we can add glutWarpPointer to Gem? Any other ideas?
I explained part of the full-screen key event problem on #dataflow a few days ago. It involves registering <Enter> and <Leave> events, and then handling them using XSetInputFocus, or perhaps just use XSetInputFocus directly, but I was trying to think of the case where a window is borderless and not fullscreen, so this is why I think of <Enter> and <Leave> events.
For the other, I know that X11 also has XWarpPointer, no idea about glutWarpPointer, I don't know any GLUT. If none of the gem devs want it, you could make yourself a very small external that wouldn't depend on gem but would just call glutWarpPointer or XWarpPointer. I know that for the latter, the code wouldn't need to be more than 20 lines.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
On Dec 14, 2007 10:49 AM, Mathieu Bouchard matju@artengine.ca wrote:
For the other, I know that X11 also has XWarpPointer, no idea about glutWarpPointer, I don't know any GLUT. If none of the gem devs want it, you could make yourself a very small external that wouldn't depend on gem but would just call glutWarpPointer or XWarpPointer. I know that for the latter, the code wouldn't need to be more than 20 lines.
the GLUT call is probably just a wrapper for the x11 one.
On Fri, Dec 14, 2007 at 12:56:37PM -0600, chris clepper wrote:
On Dec 14, 2007 10:49 AM, Mathieu Bouchard matju@artengine.ca wrote:
For the other, I know that X11 also has XWarpPointer, no idea about glutWarpPointer, I don't know any GLUT. If none of the gem devs want it, you could make yourself a very small external that wouldn't depend on gem but would just call glutWarpPointer or XWarpPointer. I know that for the latter, the code wouldn't need to be more than 20 lines.
the GLUT call is probably just a wrapper for the x11 one.
Yes it is.
Chris.
You could probably do it by using [hid] to get the mouse events.
Also, my new [cursor] object will give you the screen pixel coords,
which might be easier than the relative data direct from the mouse/hid.
.hc
On Dec 14, 2007, at 5:43 AM, Chris McCormick wrote:
Hi,
My dream of writing a quake style shooter in Gem (heh) has been
foiled. Apparently neither Gem nor luagl support the glutWarpPointer call
which many shooters use to restrict the mouse to the centre of the screen between reads of the mouse pointer movements (so the mouse can't move off the screen). That and the fact that the Gem window sometimes seems to not pick up key presses in full screen mode. Any chance we can add glutWarpPointer to Gem? Any other ideas?Best,
Chris.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
"It is convenient to imagine a power beyond us because that means we
don't have to examine our own lives.", from "The Idols of
Environmentalism", by Curtis White
On Fri, Dec 14, 2007 at 01:17:39PM -0500, Hans-Christoph Steiner wrote:
You could probably do it by using [hid] to get the mouse events.
Also, my new [cursor] object will give you the screen pixel coords,
which might be easier than the relative data direct from the mouse/hid.
Thanks for the hints. I can already get screen pixel coordinates of the mouse using Gem functions. The problem is when the mouse hits the edge of the screen, or leaves the window, they stop coming in. Maybe [hid] solves that problem, but aren't there cross platform issues with [hid]? I think I am basically going to have to wrap some functions of the SDL library in an external since that's very cross platform, and very widely supported. I've been meaning to do it to get in joystick data for ergates for a while now.
Best,
Chris.
the idea (and watch out the max/jitter list during the next day for announcements...) would be to integrate a whole gameengine module. it would take care of character animation and scene management. don't know about warp pointer, though... marius.
Chris McCormick wrote:
Hi,
My dream of writing a quake style shooter in Gem (heh) has been foiled. Apparently neither Gem nor luagl support the glutWarpPointer call which many shooters use to restrict the mouse to the centre of the screen between reads of the mouse pointer movements (so the mouse can't move off the screen). That and the fact that the Gem window sometimes seems to not pick up key presses in full screen mode. Any chance we can add glutWarpPointer to Gem? Any other ideas?
Best,
Chris.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Chris McCormick wrote:
My dream of writing a quake style shooter in Gem (heh) has been foiled. Apparently neither Gem nor luagl support the glutWarpPointer call which
On Fri, Dec 14, 2007 at 02:42:09PM -0500, marius schebella wrote:
the idea (and watch out the max/jitter list during the next day for announcements...) would be to integrate a whole gameengine module. it would take care of character animation and scene management. don't know about warp pointer, though...
Well yes, that's one other way of doing it which I thought about. However, character animation and scene management are only useful if your application has traditional notions of characters and scenes. Otherwise it's total overkill, and more cruft in the source. The other problems with that solution are: 1. I like the live-coded nature of Pd and Gem, which wrapping an existing body of code won't give me. I like that I can change things at run time. 2. Wrapping a larger body of code creates cross platform support issues if I want to distribute the code on multiple platforms.
Best,
Chris.