CSharpGL.ShaderProgram.Unbind C# (CSharp) Method

Unbind() public method

Stop using this program.
public Unbind ( ) : void
return void
        public void Unbind()
        {
            glUseProgram(0);
        }

Usage Example

        /// <summary>
        ///
        /// </summary>
        /// <param name="program"></param>
        /// <param name="vaos"></param>
        /// <param name="switchList"></param>
        public void Draw(ShaderProgram program, VertexArrayObject[] vaos, GLSwitchList switchList = null)
        {
            // 绑定shader
            program.Bind();
            program.PushUniforms(); // push new uniform values to GPU side.

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

            this.Bind();
            foreach (var vao in vaos)
            {
                DrawMode mode = vao.DrawCommand.CurrentMode;
                this.Begin(mode);
                vao.Bind();
                this.Draw(mode);
                vao.Unbind();
                this.End();
            }
            this.Unbind();

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

            // 解绑shader
            program.Unbind();
        }
All Usage Examples Of CSharpGL.ShaderProgram::Unbind