SDL2: Event Dispatch Wait and Mobile Events

Two questions, somewhat unrelated as I haven’t gotten back to SDL in a while.

For my 3D engine dim3, I have one user who has about a 200 ms wait from mouse input. I haven’t seen this myself, nor have I found anybody else it happens to. I’m tried artificially killing the framerate and even that doesn’t do it. Has anybody seen anything like this (OS X, macbook, trackpad) on their SDL2 applications? I’m using PollEvent and letting it exhaust itself before moving on.

At one time, wasn’t there a flag for events on a separate thread? I know it was the cause of many problems, but I don’t see the same API in 2. Did I miss that? It would at least be something to try.

Also, obviously pollevent is calling pumpevent (I don’t call it myself.) Would calling this myself have any effect?

As you can see, I can’t recreate, so I’m hoping somebody else ran into something similar they could recreate and found a solution.

Part 2: Did any decision get made on the critical mobile events (iOS mostly.) I’m running with a hacked version (which is why I haven’t updated in months), and was wondering if something finally came up or got implemented.

[>] Brian

I had similar problems with mouse input on OS X. In my case the call to
WarpMouse function caused this (I do the warp every frame to keep the
cursor in the center of the window). Every time I called
SDL_WarpMouseInWindow I had to wait around 200-400 ms for it to execute. It
started happening after switching to SDL 1.3 from 1.2 for me (possibly
combined with some Apple’s update).

You may want to have a look at this thread:
http://forums.libsdl.org/viewtopic.php?t=8627

MaciejOn Mon, Dec 10, 2012 at 3:09 AM, Brian Barnes wrote:

Two questions, somewhat unrelated as I haven’t gotten back to SDL in a
while.

For my 3D engine dim3, I have one user who has about a 200 ms wait from
mouse input. I haven’t seen this myself, nor have I found anybody else it
happens to. I’m tried artificially killing the framerate and even that
doesn’t do it. Has anybody seen anything like this (OS X, macbook,
trackpad) on their SDL2 applications? I’m using PollEvent and letting it
exhaust itself before moving on.

At one time, wasn’t there a flag for events on a separate thread? I know
it was the cause of many problems, but I don’t see the same API in 2. Did
I miss that? It would at least be something to try.

Also, obviously pollevent is calling pumpevent (I don’t call it myself.)
Would calling this myself have any effect?

As you can see, I can’t recreate, so I’m hoping somebody else ran into
something similar they could recreate and found a solution.

Part 2: Did any decision get made on the critical mobile events (iOS
mostly.) I’m running with a hacked version (which is why I haven’t updated
in months), and was wondering if something finally came up or got
implemented.

[>] Brian


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

if the problem is warping the mouse every frame then dont do that!

you should be calling CGAssociateMouseAndMouseCursorPosition (http://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/Quartz_Services_Ref/Reference/reference.html#//apple_ref/c/func/CGAssociateMouseAndMouseCursorPosition) if you want to keep the cursor centered.[/url]

Maciej Kot wrote:

I had similar problems with mouse input on OS X. In my case the call to
WarpMouse function caused this (I do the warp every frame to keep the
cursor in the center of the window). Every time I called
SDL_WarpMouseInWindow I had to wait around 200-400 ms for it to execute. It
started happening after switching to SDL 1.3 from 1.2 for me (possibly
combined with some Apple’s update).

You may want to have a look at this thread:
http://forums.libsdl.org/viewtopic.php?t=8627

Maciej

Good information, Maciej. I alerted my user to check his acceleration
and get back to me. If this turns out to be the problem, the fix seems
here:

Though that’s a pretty old page, googling hits code for ioquake3, so it
seems to be the code to use.

Of course, now I know why when certain programs crash, my mouse settings
are funky. This is sadly very hacky but that’s actually Apple’s problem.

SDL Folk: Would this be something useful in SDL? It seems OS X only,
which means no, but windows does seem to have these options, also (but I
never heard a complaint on windows, which probably means the raw input
on windows is skipping the acceleration step.)

For now I’ll just implement myself.

[>] Brian