Example #1
0
 /// <summary>
 /// Retourne la valeur a afficher, avec un decalage partiel (ex: decalage partiel par seconde pour afficher
 /// les minutes
 /// </summary>
 /// <param name="maintenant"></param>
 /// <param name="value"></param>
 /// <param name="decalage"></param>
 protected abstract void getValue(Temps maintenant, out float value, out float decalage);
Example #2
0
 /// <summary>
 /// Date changee: changer l'image du fond de l'horloge qui contient
 /// la date et la phase lunaire
 /// </summary>
 /// <param name="g"></param>
 /// <param name="maintenant"></param>
 public override void DateChangee(OpenGL gl, Temps maintenant)
 {
     CreerBitmapFond(gl);
 }
Example #3
0
        public override void AfficheOpenGL(OpenGL gl, Temps maintenant, Rectangle tailleEcran, Color couleur)
        {
#if TRACER
            RenderStart(CHRONO_TYPE.RENDER);
#endif

            if (_textureFondHorloge == null)
            {
                CreerBitmapFond(gl);
            }
            CentreX = _trajectoire._Px + _rayon;
            CentreY = _trajectoire._Py + _rayon;
            gl.Clear(OpenGL.GL_DEPTH_BUFFER_BIT);
            gl.PushMatrix();
            gl.MatrixMode(OpenGL.GL_PROJECTION);
            gl.PushMatrix();
            gl.LoadIdentity();
            gl.Ortho2D(0.0, tailleEcran.Width, 0.0, tailleEcran.Height);
            gl.MatrixMode(OpenGL.GL_MODELVIEW);

            gl.Disable(OpenGL.GL_LIGHTING);
            gl.Disable(OpenGL.GL_DEPTH);
            gl.Enable(OpenGL.GL_TEXTURE_2D);
            gl.Enable(OpenGL.GL_BLEND);
            gl.BlendFunc(OpenGL.GL_SRC_ALPHA, OpenGL.GL_ONE_MINUS_SRC_ALPHA);

            float[] col = { couleur.R / 512.0f, couleur.G / 512.0f, couleur.B / 512.0f, 1 };
            gl.Color(col);

            _textureFondHorloge.Bind(gl);
            gl.Translate(CentreX, CentreY, 0);
            gl.Begin(OpenGL.GL_QUADS);
            gl.TexCoord(0.0f, 0.0f); gl.Vertex(-_rayon, _rayon);
            gl.TexCoord(0.0f, 1.0f); gl.Vertex(-_rayon, -_rayon);
            gl.TexCoord(1.0f, 1.0f); gl.Vertex(_rayon, -_rayon);
            gl.TexCoord(1.0f, 0.0f); gl.Vertex(_rayon, _rayon);
            gl.End();

            gl.Disable(OpenGL.GL_TEXTURE_2D);
            DessineAiguille(gl, maintenant._Seconde, 60.0f, 0.8f, -0.2f, EPAISSEUR_TROTTEUSE / 2.0f);
            //Minutes
            DessineAiguille(gl, maintenant._Minute + maintenant._Seconde / 60.0f, 60.0f, 0.7f, 0, EPAISSEUR_MINUTES / 2.0f);
            // Heure
            DessineAiguille(gl, maintenant._Heure + maintenant._Minute / 60.0f, 12.0f, 0.7f, 0, EPAISSEUR_HEURES / 2.0f);

            // Secondes continues
            //CentreY += ((_diametre * RATIO_TROTTEUSE_CONTINUE) * 0.9f);
            gl.Translate(0, -((_diametre * RATIO_TROTTEUSE_CONTINUE) * 0.9f), 0);
            DessineAiguille(gl, maintenant._Millieme, 1000.0f, 0.12f, -0.02f, EPAISSEUR_TROTTEUSE_CONTINUE / 2.0f);


            gl.DrawText(10, 10, 0, 1, 0, "Arial.ttf", 172, "texte");
            gl.MatrixMode(OpenGL.GL_PROJECTION);
            gl.PopMatrix();
            gl.MatrixMode(OpenGL.GL_MODELVIEW);
            gl.PopMatrix();

#if TRACER
            RenderStop(CHRONO_TYPE.RENDER);
#endif
        }
Example #4
0
 /// <summary>
 /// Date changee: changer l'image du fond de l'horloge qui contient
 /// la date et la phase lunaire
 /// </summary>
 /// <param name="g"></param>
 /// <param name="maintenant"></param>
 public override void DateChangee(Graphics g, Temps maintenant)
 {
     CreerBitmapFond(g);
 }