Mouse resolution == 72dpi?

After playing with logicals Dungeon game
(http://coil.tempusmud.com/~jwatson/sdl-dg/)
and wondering about the jumpy mouse a bit, I implemented MouseLook in
GLtron. Same problem. Then I noticed that in SDL, mouse resolution is reduced
to pixel level on screen (which is at about 72-100dpi).

This is bad for smooth mouse movement. It’s ok for a cursor, but not for
controlling the camera. Try this: move the mouse continuasly, but very
slowly over the pad. Notive you your cursors motion is jumpy (pixel by pixel)
whereas your mouse moves continuosly).

I see two workarounds:

  1. add new fields x_rel_mouse, y_rel_mouse to the SDL_MouseMotionEvent, which
    reflect the mouse internal coordinates since the last movement (has nothing
    to do with screen coordinates )
  2. give SDL a way to change the mouse speed, so we can bump that up (increases
    mouse sensity).

I prefer 1), because 2) might mess up with other apps (especially in windowed
application) and gives problems when you reach the window’s border

What do you think?

After playing with logicals Dungeon game
(http://coil.tempusmud.com/~jwatson/sdl-dg/)
and wondering about the jumpy mouse a bit, I implemented MouseLook in
GLtron. Same problem. Then I noticed that in SDL, mouse resolution is reduced
to pixel level on screen (which is at about 72-100dpi).

X11 can never report mouse movement with greater precision than one pixel.
If you can do without a hardware mouse cursor, you could skip the
confinement of the mouse to the screen window when grabbing the pointer and
use the whole virtual frame buffer as mouse area, translating the coords.

  1. add new fields x_rel_mouse, y_rel_mouse to the SDL_MouseMotionEvent, which
    reflect the mouse internal coordinates since the last movement (has nothing
    to do with screen coordinates )

what internal mouse coordinates?

  1. give SDL a way to change the mouse speed, so we can bump that up (increases
    mouse sensity).

and how can that be implemented?

I’m not sure, but doesn’t DGA Mouse give access to higher than screen
resolution mouse movement? If so, the additonal feild could contain the
highest resolution data available for the given mode.

There’s no concept of screen resolution in the mouse code. SDL just
returns whatever the underlying operating system environment provides.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

I’m not sure, but doesn’t DGA Mouse give access to higher than screen
resolution mouse movement? If so, the additonal feild could contain the
highest resolution data available for the given mode.–
Stuart O. Anderson