Browse Source

love.event.pump uses SDL_PeepEvents instead of SDL_PollEvent to grab remaining events after the first one.

Fixes #2183. Also reduces stuttering when moving or resizing on Windows.
Sasha Szpakowski 2 months ago
parent
commit
7883c90c77
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/event/sdl/Event.cpp

+ 1 - 1
src/modules/event/sdl/Event.cpp

@@ -172,7 +172,7 @@ void Event::pump(float waitTimeout)
 	if (shouldPoll)
 	if (shouldPoll)
 	{
 	{
 		SDL_Event e;
 		SDL_Event e;
-		while (SDL_PollEvent(&e))
+		while (SDL_PeepEvents(&e, 1, SDL_GETEVENT, SDL_EVENT_FIRST, SDL_EVENT_LAST) > 0)
 		{
 		{
 			StrongRef<Message> msg(convert(e), Acquire::NORETAIN);
 			StrongRef<Message> msg(convert(e), Acquire::NORETAIN);
 			if (msg)
 			if (msg)