//////////////////////////////////////////////////////////////////////// /// /// @fn public void MettreAJour(double tempsInterAffichage) /// @brief Mise a jour du panneau OpenGL. /// @param[in] tempsInterAffichage : Objet duquel provient un evenement. /// @return Aucune. /// //////////////////////////////////////////////////////////////////////// public void MettreAJour(double tempsInterAffichage) { try { this.Invoke((MethodInvoker) delegate { FonctionsNatives.refreshText(panel_GL.Size.Width, panel_GL.Size.Height); if (peutAnimer) { FonctionsNatives.animer(tempsInterAffichage); if (Program.compteurFrames == 0) { pointsPartie = FonctionsNatives.obtenirNombreDePointsDePartie(); // TODO Exemple a delete StringBuilder precedentText = Points; Points = new StringBuilder("Points : " + pointsPartie.ToString()); FonctionsNatives.updateText(precedentText, precedentText.Capacity, Points, Points.Capacity); // FIN DE L'EXEMPLE } } if (Program.compteurFrames == 0) { FonctionsNatives.dessinerOpenGL(); } billesEnJeu = FonctionsNatives.obtenirNombreBillesCourante(); billesPerdus = FonctionsNatives.obtenirNombreBillesPerdus(); billesDisponibles = nombreBillesInit + nombreDeBillesGagnes - billesPerdus - billesEnJeu; if (billesEnJeu < nombreBillesMax && (billesDisponibles > 0)) { // Wait a certain time CreerBille(); } if (billesDisponibles == 0 && boolTemp && billesEnJeu == 0) { if (nbZones == 1) { FinCampagne(false, pointsPartie); } else { FinCampagne(false, -5); } } if (pointsPartie >= nombreDeBillesGagnes * pointsGagnerBille + pointsGagnerBille) { FonctionsNatives.jouerSon(newBallSFX, newBallSFX.Length); nombreDeBillesGagnes++; label_nbGagnes.Text = nombreDeBillesGagnes.ToString(); } label_nbPoints.Text = pointsPartie.ToString(); if (billesDisponibles >= 0) { label_nbBilles.Text = billesDisponibles.ToString(); StringBuilder precedentText = Billes; Billes = new StringBuilder("Billes : " + billesDisponibles.ToString()); FonctionsNatives.updateText(precedentText, precedentText.Capacity, Billes, Billes.Capacity); } if (pointsPartie >= pointsGagnerPartie && boolTemp && (nbZones > 1)) { if (currentZone >= nbZones) { FinCampagne(true, -5); } else { ProchainePartie(); } } if (currentZoom <= 0) { FonctionsNatives.resetZoom(); currentZoom = FonctionsNatives.obtenirZoomCourant(); } }); } catch (Exception) { } }