Beispiel #1
0
        /// <summary>
        /// Makes a new instance of <see cref="GameLoop"/> class.
        /// </summary>
        /// <param name="action">Delegate that will be executed on each frame.</param>
        /// <param name="threadName">Name of the associated thread.</param>
        public GameLoop(Action <IFrameBasedClock> action, string threadName)
        {
            pLoopAction = action;
            ExitRequest = false;
            ThreadName  = threadName;

            // - Initialize performance collector
            Performance = new PerformanceCollector(threadName);

            // - Initialize scheduler
            Scheduler = new Scheduler();

            // - Initialize clock
            Clock = new ThrottledFramedClock();
        }
Beispiel #2
0
        /// <summary>
        /// Makes a new instance of <see cref="GameLoop"/> class.
        /// </summary>
        /// <param name="actionToDo">Delegate that will be executed on each frame.</param>
        /// <param name="threadName">Name of the associated thread.</param>
        public GameLoop(TimedAction actionToDo, string threadName)
        {
            loopAction      = actionToDo;
            ExitRequest     = false;
            this.threadName = threadName;

            // - Initialize performance collector
            Performance = new PerformanceCollector(threadName);

            // - Initialize scheduler
            Scheduler = new Scheduler();

            // - Initialize clock
            Clock = new ThrottledFramedClock();
        }