[SDL] Why do I get so few points(SDL_MOUSEMOTION) when I move fast

Ismael Serrano faluk.isma at gmail.com
Tue Sep 13 14:03:40 PDT 2016


Or you can get the current position on the update and compare with the
previous to check if there is any difference.

    ///--- Store the current information to the previous
    m_iPreviousCoordX=m_iCurrentCoordX;
    m_iPreviousCoordY=m_iCurrentCoordY;
    m_uPreviousMouseState=m_uCurrentMouseState;

    ///--- Update the current state of the mouse
    m_uCurrentMouseState=SDL_GetMouseState(&m_iCurrentCoordX,
&m_iCurrentCoordY);

2016-09-13 22:58 GMT+02:00 Eric Wasylishen <ewasylishen at gmail.com>:

> Hi,
> Try using relative mouse mode (SDL_SetRelativeMouseMode(SDL_True); ) -
> this requests raw mouse events, with no acceleration and at the full
> rate your mouse can send them. This is implemented on Windows, and I
> think, Linux.
>
> What OS / SDL version / mouse model was this on? The maximum event
> rate depends on the mouse.
> Eric
>
> On Tue, Sep 13, 2016 at 9:20 AM, Alex Barry <alex.barry at gmail.com> wrote:
> > I think most apps interpolate with curves, which isn't too bad if you
> have
> > at least 3 points.  I've seen this behaviour for years, and I don't think
> > it's an issue with SDL.
> >
> > On Tue, Sep 13, 2016 at 11:11 AM, sgrsgsrg <thephanoo at gmail.com> wrote:
> >>
> >> I think it's limited by what windows sends with its API, maybe it's
> locked
> >> on the main display frequency? If you want more points you'll need to
> >> interpolate between them. Like when you draw with a painting program,
> they
> >> all use some sort of bezier interpolation to make nice curves,
> otherwise it
> >> would looks like multiple segments linked to each other.
> >>
> >> _______________________________________________
> >> SDL mailing list
> >> SDL at lists.libsdl.org
> >> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >>
> >
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20160913/46974a08/attachment.htm>


More information about the SDL mailing list