protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); tableTexture = new Texture2D(GraphicsDevice, windowSizeX, windowSizeY); plusButtonTexture = Content.Load <Texture2D>("Textures/plus"); minusButtonTexture = Content.Load <Texture2D>("Textures/minus"); blackRectangle = new Texture2D(GraphicsDevice, 1, 1); blackRectangle.SetData(new[] { Color.Black }); font = Content.Load <SpriteFont>("daFont"); JeuDeLaVieTable.GenerateNew(tailleX: windowSizeX, tailleY: windowSizeY); generateMenuTexture(); generateArrowTexture(); }
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(); }