[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: SDL vs GLUT (multiplexing of mouse and keyboard events)
- To: firstname.lastname@example.org
- Subject: Re: SDL vs GLUT (multiplexing of mouse and keyboard events)
- From: Steve Baker <email@example.com>
- Date: Fri, 01 Aug 2003 16:53:40 -0500
- Delivered-to: firstname.lastname@example.org
- Delivered-to: mailing list email@example.com
- Delivery-date: Fri, 01 Aug 2003 17:54:32 -0400
- In-reply-to: <20030729004834.A1556@teleport.edu>
- Mailing-list: contact firstname.lastname@example.org; run by ezmlm
- References: <20030729004834.A1556@teleport.edu>
- Reply-to: email@example.com
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030507
Abhir Joshi wrote:
I have observed that SDL does better multiplexing of mouse and
keyboard events than GLUT.
For instance, consider we have a space program with a space ship
moving. I am using mouse to control the direction of motion and
keyboard for applying forward thrust. With SDL event handling it
works perfect, but with GLUT, the mouse events are given priority over
I don't think GLUT does anything at all fancy. As each X event is
reported, GLUT calls the appropriate callback.
I can't imagine what SDL might be doing that's different.
Initially, say, I am moving the ship forward using keyboard. When I
move the mouse, this forward motion virtually stops and the ship just
changes direction and when I stop the movement of mouse, the ship's
forward motion starts again.
I've never seen this kind of behavior.
Are you maybe doing something like redrawing the scene in the mouse/keyboard
How can this problem be solved with GLUT? Can multi-threading help in
You shouldn't need to do that.
PUI uses GLUT's event callbacks. So using PUI, I will have the same
problem. Isn't PUI written using SDL event handling?
No - PUI doesn't require any special windowing system interface. It uses
neither GLUT nor SDL.
The application program tells PUI when to redraw and what keystrokes and
mouse clicks it should use.
---------------------------- Steve Baker -------------------------
HomeEmail: <firstname.lastname@example.org> WorkEmail: <email@example.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net http://tuxaqfh.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----