free opengl resources

This commit is contained in:
2025-04-28 18:23:29 +02:00
parent 0fb24263e0
commit ec98b05d61
12 changed files with 113 additions and 33 deletions

View File

@@ -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();
}
}
}