[SDL] mouse problems

Sam Lantinga slouken at devolution.com
Mon Aug 2 01:56:14 PDT 1999


> But there is no way to get the *current* mouse position quickly and 
> without having having to rely on X events.

Unfortunately, you're stuck with this when using X.
SDL is going to support one or more fullscreen APIs under Linux which 
shouldn't suffer from the same problem.  It's work in progress.

> Imho buffering mouse events, as X does, is highly inappropriate for
> games.  I just don't care about the exact path along which the mouse was
> moved, if the framerate of my game isn't high enough to let me draw all
> those intermediate mouse cursors.  It also seems like the X event queue
> is *really* slow.  You might try running SDLdoom on a "slow" computer
> (like my P100). It works nicely -- as long as you don't touch the
> mouse!  Whenever you do this, the game slows down to a crawl.   I know,
> a P100 isn't really "state-of-the-art", but moving the mouse shouldn't
> have that much impact on the game speed, should it?

No, it shouldn't. Were I to have time, I would check it out, but unfortunately
I'm swamped with life right now. :)

> I don't want to quibble over minor things, but SDL_GetMouseState() isn't
> as "Direct" as you (or, well, at least `I') would expect it to be.  This
> is the only thing about SDL that irks me; I don't really care about
> internationalized error messages (although introducing
> SDL_SomethingErr() functions seems to be a good idea). But fast and
> direct access to the mouse cursor is important for many games.

Very good points.

The next development version of SDL will involve some internal restructuring,
making it more modular and allowing you to get even closer to the hardware 
than you are now.

	-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software
--
"Any sufficiently advanced bug is indistinguishable from a feature"
						 -- Rich Kulawiec 



More information about the SDL mailing list