Exemple #1
0
 /// <summary>
 /// Binds the VAO ready for drawing
 /// </summary>
 public void BindForDrawing(VertexLayout VertexLayout)
 {
     GL.BindVertexArray(handle);
     vbo.Bind();
     vbo.EnableAttribute(VertexLayout);
     vbo.SetAttribute(VertexLayout);
 }
Exemple #2
0
        /// <summary>
        /// Adds a VBO object to the VAO needs to have one to draw, if a second is added it will replace the first and the first will be disposed of
        /// </summary>
        /// <param name="VBO">The VBO object to be added</param>
        public void SetVBO(VertexBufferObject VBO)
        {
            if (vbo != null)
            {
                UnBind();
                vbo.Dispose();
                Bind();
            }

            vbo = VBO;
            vbo.Bind();
            vbo.BufferData();
        }
Exemple #3
0
 /// <summary>
 /// Sets the VAO vertex layout attributes
 /// </summary>
 /// <remarks>
 /// These attributes remain valid unless a different shader is used to draw the object, and will be remembered by the VAO
 /// </remarks>
 public void SetAttributes(VertexLayout VertexLayout)
 {
     vbo.Bind();
     vbo.EnableAttribute(VertexLayout);
     vbo.SetAttribute(VertexLayout);
 }
Exemple #4
0
 /// <summary>
 /// Update the VertexData into the the VBO
 /// </summary>
 public void UpdateVBO(LibRenderVertex[] VertexData, int Offset = 0)
 {
     vbo.Bind();
     vbo.BufferSubData(VertexData, Offset);
 }