Просмотр исходного кода

Use SDL_PollEvent() instead of SDL_PumpEvents() / SDL_PeepEvent() for subjectively smoother mouse input under vsync (Windows.)

Lasse Öörni 11 лет назад
Родитель
Сommit
52aa4bc780
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      Source/Urho3D/Input/Input.cpp

+ 1 - 2
Source/Urho3D/Input/Input.cpp

@@ -159,9 +159,8 @@ void Input::Update()
     }
     }
 
 
     // Check and handle SDL events
     // Check and handle SDL events
-    SDL_PumpEvents();
     SDL_Event evt;
     SDL_Event evt;
-    while (SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) > 0)
+    while (SDL_PollEvent(&evt))
         HandleSDLEvent(&evt);
         HandleSDLEvent(&evt);
 
 
     if (mouseVisible_ && mouseMode_ == MM_WRAP)
     if (mouseVisible_ && mouseMode_ == MM_WRAP)