mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-30 07:57:59 +01:00
Synchronize the create/destroy and instance access to GLWindow... -_-
This commit is contained in:
parent
4ee7d2d88e
commit
5aafc83fd9
1 changed files with 3 additions and 3 deletions
|
@ -55,7 +55,7 @@ public class GLWindow extends DropTarget {
|
||||||
/**
|
/**
|
||||||
* Destroys the current GLWindow context and restores default behaviour.
|
* Destroys the current GLWindow context and restores default behaviour.
|
||||||
*/
|
*/
|
||||||
public static void dispose() {
|
public static synchronized void dispose() {
|
||||||
if (instance != null) {
|
if (instance != null) {
|
||||||
instance.close();
|
instance.close();
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ public class GLWindow extends DropTarget {
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void open() throws LWJGLException {
|
private synchronized void open() throws LWJGLException {
|
||||||
// Dimensions from LWJGL may have a non 1:1 scale on high DPI monitors.
|
// Dimensions from LWJGL may have a non 1:1 scale on high DPI monitors.
|
||||||
int x = getScaledPixelUnit(Display.getX());
|
int x = getScaledPixelUnit(Display.getX());
|
||||||
int y = getScaledPixelUnit(Display.getY());
|
int y = getScaledPixelUnit(Display.getY());
|
||||||
|
@ -151,7 +151,7 @@ public class GLWindow extends DropTarget {
|
||||||
ready = true;
|
ready = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void close() {
|
private synchronized void close() {
|
||||||
closeRequested = true;
|
closeRequested = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue