コード例 #1
0
        public NSTimerTimeSource(iPhoneOSGameView 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));
        }
コード例 #2
0
        public CADisplayLinkTimeSource(iPhoneOSGameView view, int frameInterval)
        {
            this.view = view;

            if (displayLink != null)
            {
                displayLink.Invalidate();
            }

            displayLink = CADisplayLink.Create(this, selRunIteration);
            displayLink.FrameInterval = frameInterval;
            displayLink.Paused        = true;
        }