public void Dispose() { if (vertexID != -1) { GL.DeleteBuffers(1, ref vertexID); } if (indexID != -1) { GL.DeleteBuffers(1, ref indexID); } if (vaoID != -1) { GL.DeleteVertexArrays(1, ref vaoID); } if (Shader != null) { Shader.Dispose(); } vertexID = indexID = vaoID = -1; Shader = null; if (numOfIndices > 0) { Log.WriteLine("Disposed: VBO", false); } numOfIndices = 0; }
public override void Dispose() { if (particleTex != null) { particleTex.Dispose(); } if (depthShader != null) { depthShader.Dispose(); } particleTex = null; depthShader = null; particles.Clear(); Log.WriteLine("Disposed: Particles", false); }