mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-09 07:20:04 -04:00
Handle Game Window closing by closing connection and being prepared for a new Connection
This commit is contained in:
parent
4f26204355
commit
7466f01589
@ -76,6 +76,11 @@ public class GameWindow {
|
||||
glPopMatrix();
|
||||
glfwSwapBuffers(openGLWindow.getWindowId());
|
||||
}
|
||||
// The window was closed, close everything
|
||||
currentConnection.disconnect();
|
||||
currentConnection = null;
|
||||
running = false;
|
||||
openGLWindow.close();
|
||||
}
|
||||
|
||||
public static void pause() {
|
||||
|
@ -49,6 +49,10 @@ public class OpenGLWindow {
|
||||
gluPerspective(fovY, width / (float) height, 0.1f, 500f);
|
||||
}
|
||||
|
||||
public void close() {
|
||||
glfwDestroyWindow(windowId);
|
||||
}
|
||||
|
||||
public void init() {
|
||||
GLFWErrorCallback.createPrint(System.err).set();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user