swapTexWrap added

This commit is contained in:
Antoine
2021-05-20 19:02:28 +02:00
parent 859344b131
commit 4fc87e7b08
6 changed files with 56 additions and 7 deletions

View File

@ -64,4 +64,12 @@ public class Texture {
glBindTexture(GL_TEXTURE_2D, 0);
}
public int getWidth(){
return width;
}
public int getHeight(){
return height;
}
}

View File

@ -59,6 +59,16 @@ public class VertexArray {
glEnableVertexAttribArray(2);
}
public void swapVertexBufferObject(float[] vertices){
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, BufferUtils.createFloatBuffer(vertices), GL_STATIC_DRAW);
}
public void swapTextureBufferObject(float [] texture){
glBindBuffer(GL_ARRAY_BUFFER, TBO);
glBufferData(GL_ARRAY_BUFFER, BufferUtils.createFloatBuffer(texture), GL_STATIC_DRAW);
}
public void bind(){
glBindVertexArray(this.VAO);
}