Ejemplo n.º 1
0
        protected override void Update(GameTimeService gameTime)
        {
            ClientMsg_Queue = Serv.CliManagement.GetAndFreeQueue();

            if (ClientMsg_Queue.Count > 0)
            {

            }

            //timeLooping++;
            //oneSec += gameTime.EllaspedTimeInMs;

            //if (oneSec >= 1000)
            //{
            //    WriteLine("FPS : " + timeLooping);
            //    timeLooping = 0;
            //    oneSec = 0;
            //}

            base.Update(gameTime);
        }
Ejemplo n.º 2
0
        protected virtual void Update(GameTimeService gameTime)
        {
            int diff = DateTime.Now.Millisecond - previousTime.Millisecond;

            if (diff < 0)
            {
                diff += 1000;
            }

            if (tempsParTour - diff > 0)
            {
                Thread.Sleep(tempsParTour - diff);
                gameTime.isRunningSlowly = false;
            }
            else if (tempsParTour - diff < 0)
            {
                gameTime.isRunningSlowly = true;
            }

            gameTime.EllapsedTimeInMs = tempsParTour;
            gameTime.TotalTimeInMs += tempsParTour;
            previousTime = DateTime.Now;
        }