Exemplo n.º 1
0
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            if (JeuDeLaVieTable.Stale)
            {
                JeuDeLaVieTable.GenerateNew(tailleX: windowSizeX, tailleY: windowSizeY);
            }
            //discard over the physical cap frames
            if (!FpsCounter.availableFrameT)
            {
                this.SuppressDraw();
            }
            else
            {
                tableTexture.SetData(JeuDeLaVieTable.DonneeTables);
            }

            thread1 = new Thread(JeuDeLaVieTable.CalculerCycle)
            {
                Priority = ThreadPriority.Highest
            };


            oldState = newState;
            newState = Mouse.GetState();

            KeyManage();

            DrawThread();
            thread1.Start();

            FpsCounter.Add((float)gameTime.ElapsedGameTime.TotalSeconds);

            thread1.Join();

            MouseManage();
        }