free opengl resources
This commit is contained in:
@@ -23,15 +23,13 @@ public class DDDView extends GameAdaptator {
|
||||
|
||||
private final CommandExecutor commandExecutor;
|
||||
private final Window window;
|
||||
private final Renderer renderer;
|
||||
private final World world;
|
||||
private BoardEntity boardEntity;
|
||||
|
||||
public DDDView(CommandExecutor commandExecutor) {
|
||||
this.commandExecutor = commandExecutor;
|
||||
this.renderer = new Renderer();
|
||||
this.world = new World();
|
||||
this.window = new Window(this.renderer, this.world, new Camera());
|
||||
this.window = new Window(new Renderer(), this.world, new Camera());
|
||||
}
|
||||
|
||||
// Invoked when a cell is clicked
|
||||
@@ -114,6 +112,14 @@ public class DDDView extends GameAdaptator {
|
||||
// cam.setRotateAngle(cam.getRotateAngle() + angle * delta);
|
||||
// });
|
||||
this.window.run();
|
||||
|
||||
// free OpenGL resources
|
||||
try {
|
||||
this.window.close();
|
||||
this.world.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user