예제 #1
0
 async void StartLoop(Application app)
 {
     while (!Paused && app != null && app.IsActive)
     {
         var elapsed   = app.Engine.RunFrame();
         var targetMax = 1000000L / FpsLimit;
         if (elapsed >= targetMax)
         {
             await Task.Yield();
         }
         else
         {
             await Task.Delay(TimeSpan.FromMilliseconds((targetMax - elapsed) / 1000d));
         }
         if (!UnderlyingPanel.Focused && ForceFocus)
         {
             UnderlyingPanel.Focus();
         }
     }
 }
예제 #2
0
파일: UrhoSurface.cs 프로젝트: yrest/urho
 void UrhoSurface_MouseDown(object sender, MouseEventArgs e)
 {
     UnderlyingPanel?.Focus();
 }