Beispiel #1
0
        public void glDraw()
        {
            //  Get the OpenGL object.
            //OpenGL gl = openGLControl.OpenGL;
            objOpengGL = openGLControl.OpenGL;



            /*objOpengGL.DrawText(100, 100, 128.0f, 128.0f, 128.0f, "Arial", 24.0f, "Drawing maze");
             * objOpengGL.DrawText(0, 0, 1f, 1f, 1f, "verdana", 20, "Paused");
             *
             * objOpengGL.DrawText3D("Arial", 30f, 0, 0, "Sasasasaa");*/

            //tableLayoutPanel1.SetRow(l1, 2);


            //  Clear the color and depth buffer.
            objOpengGL.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);

            //  Load the identity matrix.
            objOpengGL.MatrixMode(OpenGL.GL_MODELVIEW);
            objOpengGL.LoadIdentity();

            objOpengGL.Rotate((float)rotacionX, 1.0f, 0.0f, 0.0f);
            objOpengGL.Rotate((float)rotacionY, 0.0f, 1.0f, 0.0f);

            //gl.Color(0.0f,0.0f,1.0f);
            contenedor.dibujar(objOpengGL);
            //gl.Translate(5, 5, 5);
            // gl.Rotate(rot, 0, 0);
            // gl.Translate(-5.5f, -4.5f, -5.5f);

            //rot += 90;
            //gl.Translate(0,0,zzz);
            // gl.Rotate(0, 0, 90);
            //   gl.Rotate(0, 90, 0);

            //  ju.piezaPintado(gl);

            juegoController.pintarPiezaSiguiente(objOpengGL);

            juegoController.piezaPintado(objOpengGL);
            // control de tiempo para accion de movimiento de las piezas
            DateTime fin  = DateTime.Now;
            TimeSpan span = fin - inicio;                    // tiempo transcurrido

            if (span.Seconds == configUser.velocidadFiguras) // tiempo parametrizable
            {
                inicio = DateTime.Now;
                bool termino;
                juegoController.avanzarVerificandoFilaCompleta(out termino);
                lblPuntos.Text = juegoController.puntos.ToString();
                if (termino)
                {
                    MessageBox.Show($"Juego terminado, su puntuacion es : {juegoController.puntos}");
                }
            }
            // metodo para pintar
            juegoController.pintarPiezaDelBoard(objOpengGL);
            // falta validar (PG)
            //label1.Text = "PUNTUACION \n " + ju.getPuntuacion();
            //juegoController.avanzar();
            // ju.piezaPintado(gl);
        }