Flush all events when mouse has been warped.

This commit is contained in:
Steve 2015-12-14 08:33:14 +00:00
parent 1577907390
commit 76f1b9786a
1 changed files with 9 additions and 2 deletions

View File

@ -56,9 +56,16 @@ void doMouseWheel(SDL_MouseWheelEvent *event)
void setMouse(int x, int y)
{
app.mouse.x = x;
app.mouse.y = y;
SDL_Event event;
app.mouse.x = x * app.scaleX;
app.mouse.y = y * app.scaleY;
SDL_WarpMouseInWindow(app.window, x, y);
while (SDL_PollEvent(&event))
{
}
}
void drawMouse(void)