소스 검색

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 4 달 전
부모
커밋
7883c90c77
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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)