Ver Fonte

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 há 2 meses atrás
pai
commit
7883c90c77
1 ficheiros alterados com 1 adições e 1 exclusões
  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)
 	{
 		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);
 			if (msg)