CSharpGL.VertexArrayObject.Unbind C# (CSharp) Method

Unbind() private method

private Unbind ( ) : void
return void
        private void Unbind()
        {
            glBindVertexArray(0);
        }

Usage Example

Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="program"></param>
        /// <param name="vao"></param>
        /// <param name="stateList"></param>
        public void Draw(ShaderProgram program, VertexArrayObject vao, GLStateList stateList = null)
        {
            // 绑定shader
            program.Bind();
            program.PushUniforms(); // push new uniform values to GPU side.

            if (stateList != null)
            {
                stateList.On();
            }

            DrawMode mode = vao.IndexBuffer.Mode;

            this.Bind();
            this.Begin(mode);
            vao.Bind();
            this.Draw(mode);
            vao.Unbind();
            this.End();
            this.Unbind();

            if (stateList != null)
            {
                stateList.Off();
            }

            // 解绑shader
            program.Unbind();
        }