/// <summary> /// /// </summary> /// <param name="mainForm">Can be null</param> /// <param name="onNewFrame"></param> public GameLoop(Form mainForm, Action<RealTime> onNewFrame) { this.mainForm = mainForm; this.onNewFrame = onNewFrame; realTime = new RealTime(); startTicks = Stopwatch.GetTimestamp(); Application.Idle += OnIdle; }
void OnNewFrame(RealTime realTime) { foreach (var window in windows) window.OnNewFrame(); if (NewFrame != null) NewFrame(realTime); }
public Timer() { realTime = new RealTime(); }
public LoopTimer() { realTime = new RealTime(); startTicks = Stopwatch.GetTimestamp(); }