Beispiel #1
0
 /// <summary>
 /// Indicates that the specified vertex array object has been deleted and updates the OpenGL state accordingly.
 /// </summary>
 /// <param name="vertexArrayObject">The vertex array object to delete.</param>
 /// <param name="arrayBuffer">The array buffer to delete.</param>
 /// <param name="elementArrayBuffer">The element array buffer to delete.</param>
 public static void DeleteVertexArrayObject(UInt32 vertexArrayObject, UInt32 arrayBuffer, UInt32 elementArrayBuffer)
 {
     if (GL_VERTEX_ARRAY_BINDING == vertexArrayObject)
     {
         GL_VERTEX_ARRAY_BINDING.Update(0);
         GL_ARRAY_BUFFER_BINDING.Update(0);
         GL_ELEMENT_ARRAY_BUFFER_BINDING.Update(0);
         VerifyCache();
     }
 }
Beispiel #2
0
        /// <summary>
        /// Immediately binds a vertex array object to the OpenGL context and updates the state cache.
        /// </summary>
        /// <param name="vertexArrayObject">The vertex array object to bind to the context.</param>
        /// <param name="arrayBuffer">The vertex array's associated array buffer.</param>
        /// <param name="elementArrayBuffer">The vertex array's associated element array buffer.</param>
        public static void BindVertexArrayObject(UInt32 vertexArrayObject, UInt32 arrayBuffer, UInt32 elementArrayBuffer)
        {
            gl.BindVertexArray(vertexArrayObject);
            gl.ThrowIfError();

            GL_VERTEX_ARRAY_BINDING.Update(vertexArrayObject);
            GL_ARRAY_BUFFER_BINDING.Update(arrayBuffer);
            GL_ELEMENT_ARRAY_BUFFER_BINDING.Update(elementArrayBuffer);
            VerifyCache();
        }