Mouse input issue

Hello everyone, I’m using SDL 1.2 on a Windows Vista system, and compiled my project using CodeBlocks + MinGW.
I’m experiencing some problems related to input management: basically, whenever I move the mouse cursor, AND no mouse button is pressed, my FPS drop down from 75 to 50, which is quite noticeable and annoying. This doesn’t happen when I run the same code on my laptop, though.
I’m pretty sure it’s an SDL-related issue, because it keeps happening even if I put an “empty” input handling loop, like this:

SDL_Event event;
while(SDL_PollEvent(&event)){}.

However, everything runs fine and smoothly if I completely remove those 2 lines above.
I tried to replace the event filter with SDL_SetEventFilter(), but even if I tell him to completely ignore mouse movement events, the problem is still there.

Looking around for answers, I found the very same complaint by some guy working on a port of Quake 3 for SDL, who also seems to suggest some ways around it:
http://lists.libsdl.org/pipermail/sdl-libsdl.org/2008-August/066246.html

My question is: are developers aware of this issue, and did they (or are they willing to) fix this for SDL 1.3?
And for now (i.e. until SDL 1.3 is released), is there a way I can fix my code so that it works with SDL 1.2?

Thanks in advance.

Tim’s changes are in the latest SDL snapshot and you can check it out here:
http://www.libsdl.org/tmp/SDL-1.2.zipOn Sun, Sep 27, 2009 at 3:16 AM, MindFlyer wrote:

Hello everyone, I’m using SDL 1.2 on a Windows Vista system, and compiled my
project using CodeBlocks + MinGW.
I’m experiencing some problems related to input management: basically,
whenever I move the mouse cursor, AND no mouse button is pressed, my FPS
drop down from 75 to 50, which is quite noticeable and annoying. This
doesn’t happen when I run the same code on my laptop, though.
I’m pretty sure it’s an SDL-related issue, because it keeps happening even
if I put an “empty” input handling loop, like this:

SDL_Event event;
while(SDL_PollEvent(&event)){}.

However, everything runs fine and smoothly if I completely remove those 2
lines above.
I tried to replace the event filter with SDL_SetEventFilter(), but even if I
tell him to completely ignore mouse movement events, the problem is still
there.

Looking around for answers, I found the very same complaint by some guy
working on a port of Quake 3 for SDL, who also seems to suggest some ways
around it:
http://lists.libsdl.org/pipermail/sdl-libsdl.org/2008-August/066246.html

My question is: are developers aware of this issue, and did they (or are
they willing to) fix this for SDL 1.3?
And for now (i.e. until SDL 1.3 is released), is there a way I can fix my
code so that it works with SDL 1.2?

Thanks in advance.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Hello everyone, I’m using SDL 1.2 on a Windows Vista system, and
compiled my project using CodeBlocks + MinGW. I’m experiencing some
problems related to input management: basically, whenever I move the
mouse cursor, AND no mouse button is pressed, my FPS drop down from
75 to 50, which is quite noticeable and annoying.

This doesn’t really sound that much like what was happening with ioq3.
The problems experienced there were really more about the quality of
the mouse input as opposed to any FPS drops (presumably you’re seeing
corresponding CPU usage spikes?).

My question is: are developers aware of this issue, and did they (or
are they willing to) fix this for SDL 1.3? And for now (i.e. until
SDL 1.3 is released), is there a way I can fix my code so that it
works with SDL 1.2?

As Sam has said, give the 1.2 snapshot a go. Also it’s worth noting that
1.3 uses a completely different means to gather mouse input on Windows
compared to 1.2, so you probably won’t get the same set of results. If
you’re developing something new and it’s easy to switch to using 1.3, I
would recommend going with that. If having done this you still get
similar problems I would suggest you have more fundamental OS/hardware
issues.On Sun, 27 Sep 2009 03:16:55 -0700 MindFlyer wrote:

I have this EXACT same issue using my application in windows XP. Oddly, the
bug disappears on my Vista laptop and my linux machine.

I have documented my steps to debug the problem on this forum:

I will try Tim’s changes in the latest SDL snapshot when I get some time.
Hopefully is solves this problem.

Sam Lantinga-4 wrote:>

Tim’s changes are in the latest SDL snapshot and you can check it out
here:
http://www.libsdl.org/tmp/SDL-1.2.zip

On Sun, Sep 27, 2009 at 3:16 AM, MindFlyer wrote:

Hello everyone, I’m using SDL 1.2 on a Windows Vista system, and compiled
my
project using CodeBlocks + MinGW.
I’m experiencing some problems related to input management: basically,
whenever I move the mouse cursor, AND no mouse button is pressed, my FPS
drop down from 75 to 50, which is quite noticeable and annoying. This
doesn’t happen when I run the same code on my laptop, though.
I’m pretty sure it’s an SDL-related issue, because it keeps happening
even
if I put an “empty” input handling loop, like this:

SDL_Event event;
while(SDL_PollEvent(&event)){}.

However, everything runs fine and smoothly if I completely remove those 2
lines above.
I tried to replace the event filter with SDL_SetEventFilter(), but even
if I
tell him to completely ignore mouse movement events, the problem is still
there.

Looking around for answers, I found the very same complaint by some guy
working on a port of Quake 3 for SDL, who also seems to suggest some ways
around it:
http://lists.libsdl.org/pipermail/sdl-libsdl.org/2008-August/066246.html

My question is: are developers aware of this issue, and did they (or are
they willing to) fix this for SDL 1.3?
And for now (i.e. until SDL 1.3 is released), is there a way I can fix my
code so that it works with SDL 1.2?

Thanks in advance.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


View this message in context: http://www.nabble.com/Mouse-input-issue-tp25635424p25653193.html
Sent from the SDL mailing list archive at Nabble.com.