Added delete function in VertexArray
This commit is contained in:
parent
37e4771d95
commit
a282a48612
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -398,9 +398,9 @@ public class match {
|
||||
timer = 99 - frameCount/60;
|
||||
|
||||
timeStamp2 = System.currentTimeMillis();
|
||||
// while(timeStamp2-timeStamp1<(1000/(60 * slowFactor))) {
|
||||
// timeStamp2 = System.currentTimeMillis();
|
||||
// }
|
||||
while(timeStamp2-timeStamp1<(1000/(60 * slowFactor))) {
|
||||
timeStamp2 = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
frameCounter++;
|
||||
if (System.currentTimeMillis() - timeStampFpsCounter >= 1000){
|
||||
|
Loading…
x
Reference in New Issue
Block a user