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:
parent
bcb193f38b
commit
8e8b2bba04
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue