1
0
Fork 0

in fgWarpMouse() we need to flush all mouse motion events before we can set

the mouse pointer to a new position. Otherwise it can happen that the new
position is first set, but then come a few still unprocessed events for the
old position. This makes ugly jumps in mouse view mode.
This commit is contained in:
mfranz 2006-02-16 21:02:09 +00:00
parent bcb193f38b
commit 8e8b2bba04

View file

@ -241,6 +241,9 @@ int fgGetKeyModifiers()
void fgWarpMouse(int x, int y)
{
SDL_Event e[10];
SDL_PumpEvents();
SDL_PeepEvents(e, 10, SDL_GETEVENT, SDL_MOUSEMOTIONMASK);
SDL_WarpMouse(x, y);
}