Beispiel #1
0
        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));
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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;
        }