Skip to content

Commit

Permalink
Merge pull request #207 from Ersoga/master
Browse files Browse the repository at this point in the history
Add Delete Method On IndexBuffer & VetexBuffer
  • Loading branch information
dwmkerr authored Jul 12, 2022
2 parents 47373e9 + f445a24 commit a37721c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ _ReSharper*/
*.opensdf

# We don't want to ignore the main release folder scripts.
.vs
!/release/
/release/2.1*/
build/nuspec/SharpGLCore/lib/
Expand Down
5 changes: 5 additions & 0 deletions source/SharpGL/Core/SharpGL/VertexBuffers/IndexBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ public void Create(OpenGL gl)
bufferObject = ids[0];
}

public void Delete(OpenGL gl)
{
gl.DeleteBuffers(1, new uint[] { bufferObject });
}

public void SetData(OpenGL gl, ushort[] rawData)
{
gl.BufferData(OpenGL.GL_ELEMENT_ARRAY_BUFFER, rawData, OpenGL.GL_STATIC_DRAW);
Expand Down
5 changes: 5 additions & 0 deletions source/SharpGL/Core/SharpGL/VertexBuffers/VertexBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ public void Create(OpenGL gl)
vertexBufferObject = ids[0];
}

public void Delete(OpenGL gl)
{
gl.DeleteBuffers(1, new uint[] { vertexBufferObject });
}

public void SetData(OpenGL gl, uint attributeIndex, float[] rawData, bool isNormalised, int stride)
{
// Set the data, specify its shape and assign it to a vertex attribute (so shaders can bind to it).
Expand Down

0 comments on commit a37721c

Please sign in to comment.