Exemple #1
0
        public void Render(SharpGL.OpenGL gl, ShaderWrapper shader)
        {
             if (CancellationTokenSource != null && CancellationTokenSource.IsCancellationRequested)
            {
                m_cubeAnimator.AnimationFinished();
                return;
            }

            if (ShowAxes)
                m_axes.Render(gl, shader);

            m_cubeAnimator.Animate();
            RubiksCube.Render(gl, shader);
        }
        private void CreateShader(SharpGL.OpenGL gl)
        {
            //  Create the shader program.
            var vertexShaderSource = ManifestResourceLoader.LoadTextFile("Shader.vert");
            var fragmentShaderSource = ManifestResourceLoader.LoadTextFile("Shader.frag");
            m_shaderProgram = new ShaderProgram();
            m_shaderProgram.Create(gl, vertexShaderSource, fragmentShaderSource, null);
            m_shaderProgram.BindAttributeLocation(gl, AttributeIndexPosition, "in_Position");
            m_shaderProgram.BindAttributeLocation(gl, AttributeIndexColour, "in_Color");
            m_shaderProgram.AssertValid(gl);

            m_shader = new ShaderWrapper(m_shaderProgram, gl);
        }