private void MainLoop()
{
var stopwatch = new Stopwatch();
stopwatch.Start();
long last = stopwatch.ElapsedMilliseconds;
Application.Idle +=
delegate
{
NativeMessage message;
while (!PeekMessage(out message, IntPtr.Zero, 0, 0, 0))
{
long now = stopwatch.ElapsedMilliseconds;
float frametime = (now - last) / 1000.0f;
last = now;
Update(new FrameInfo(frametime, now / 1000.0f));
Render();
//AssertWithScreenshot();
}
};
}