free frame buffer
This commit is contained in:
@@ -72,5 +72,6 @@ public class Renderer implements Closeable {
|
||||
public void close() throws IOException {
|
||||
this.boardShader.close();
|
||||
this.pieceShader.close();
|
||||
this.frameBuffer.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,12 @@ import static org.lwjgl.opengl.GL11.glClear;
|
||||
import static org.lwjgl.opengl.GL11.glTexImage2D;
|
||||
import static org.lwjgl.opengl.GL11.glViewport;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.lwjgl.opengl.GL30;
|
||||
|
||||
public class FrameBuffer {
|
||||
public class FrameBuffer implements Closeable {
|
||||
|
||||
private int fbo;
|
||||
private int renderTexture;
|
||||
@@ -103,4 +106,11 @@ public class FrameBuffer {
|
||||
return renderTexture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
GL30.glDeleteFramebuffers(this.fbo);
|
||||
GL30.glDeleteRenderbuffers(this.depthBuffer);
|
||||
GL30.glDeleteTextures(this.renderTexture);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user