예제 #1
0
            private void DisableVertexAttribute(GraphicsContext ctx, ShaderProgram.AttributeBinding attributeBinding)
            {
                // Avoid rendundant buffer binding and relative vertex array setup
                if (ctx.Caps.GlExtensions.VertexArrayObject_ARB && IsDirty == false)
                {
#if DEBUG
                    // Check effective state
                    int vertexAttribArrayEnabled;

                    // Attribute enabled
                    Gl.GetVertexAttrib(attributeBinding.Location, Gl.VERTEX_ATTRIB_ARRAY_ENABLED, out vertexAttribArrayEnabled);
                    Debug.Assert(vertexAttribArrayEnabled == Gl.TRUE);
#endif
                    return;
                }

                // Enable vertex attribute
                Gl.DisableVertexAttribArray(attributeBinding.Location);
            }
 /// <summary>
 /// Disable the generic vertex attribute.
 /// </summary>
 /// <param name="ctx">
 /// The <see cref="GraphicsContext"/> on which the shader program is bound.
 /// </param>
 /// <param name="attributeBinding">
 /// The <see cref="ShaderProgram.AttributeBinding"/> representing the generic vertex attribute.
 /// </param>
 internal virtual void DisableVertexAttribute(GraphicsContext ctx, ShaderProgram.AttributeBinding attributeBinding)
 {
     // Enable vertex attribute
     Gl.DisableVertexAttribArray(attributeBinding.Location);
 }