Added delete function in VertexArray
This commit is contained in:
@ -183,6 +183,7 @@ public class Engine {
|
||||
}
|
||||
|
||||
public void remove_objectGl(ObjectGl obj) {
|
||||
obj.delete();
|
||||
this.objectsGl.remove(obj);
|
||||
}
|
||||
|
||||
|
@ -86,4 +86,15 @@ public class VertexArray {
|
||||
unbind();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete every buffers used
|
||||
*/
|
||||
public void delete(){
|
||||
glDeleteBuffers(VBO);
|
||||
glDeleteBuffers(EBO);
|
||||
glDeleteBuffers(CBO);
|
||||
glDeleteBuffers(TBO);
|
||||
glDeleteVertexArrays(VAO);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -291,4 +291,8 @@ public class ObjectGl {
|
||||
this.shader.disable();
|
||||
}
|
||||
|
||||
public void delete(){
|
||||
this.vertexArray.delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user