public NSTimerTimeSource(iOSGameView view, double updatesPerSecond) { this.view = view; // Can't use TimeSpan.FromSeconds() as that only has 1ms // resolution, and we need better (e.g. 60fps doesn't fit nicely // in 1ms resolution, but does in ticks). timeout = new TimeSpan((long)(((1.0 * TimeSpan.TicksPerSecond) / updatesPerSecond) + 0.5)); }
public CADisplayLinkTimeSource(iOSGameView view, int frameInterval) { this.view = view; if (displayLink != null) { displayLink.Invalidate(); } displayLink = CADisplayLink.Create(this, selRunIteration); displayLink.FrameInterval = frameInterval; displayLink.Paused = true; }
public CADisplayLinkTimeSource(iOSGameView view, int preferredFramesPerSecond) { this.view = view; if (displayLink != null) { displayLink.Invalidate(); } displayLink = CADisplayLink.Create(this, selRunIteration); displayLink.PreferredFramesPerSecond = preferredFramesPerSecond; displayLink.Paused = true; }