Exemple #1
0
        public void SetShaderProgram(ShaderProgram program)
        {
            if (this.vertexArrayGenerated)
            {
                GL.DeleteVertexArrays(1, ref this.handle);
            }

            GL.GenVertexArrays(1, out this.handle);
            this.vertexArrayGenerated = true;

            GL.BindVertexArray(this.handle);

            GL.BindBuffer(BufferTarget.ArrayBuffer, this.vertexBuffer);

            program.SetVertexAttributes(new TVertexData().VertexAttributes());

            GL.BindVertexArray(0);
            GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
        }