Exemplo n.º 1
0
        public DebugOverlay(GameContainer container, MouseInputService mouseInputService)
        {
            Container         = container;
            MouseInputService = mouseInputService;

            Resource.AddResource("ForegroundBrush", new SolidColorBrushResource(new RawColor4(1, 1, 1, .9f)));
            format = new TextFormat(Container.DWFactory, "Consolas", FontWeight.Normal, FontStyle.Normal, 16);

            UpdateTimeQueue.Enqueue(0);            //dummy
        }
Exemplo n.º 2
0
 protected override void Update()
 {
     lock (UpdateTimeQueue)
     {
         var current = Container.Elapsed.TotalMilliseconds;
         UpdateTimeQueue.Enqueue(current - beforeUpdateTime);
         if (UpdateTimeQueue.Count > 100)
         {
             UpdateTimeQueue.Dequeue();
         }
         beforeUpdateTime = current;
     }
 }