Skip to content

Commit feb5c1f

Browse files
committed
fix: waitFor not supported
1 parent bcc8fc2 commit feb5c1f

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,6 @@ public void run() {
492492
}
493493

494494
LOGGER.log(Level.FINE, "Using LWJGL {0}", Version.getVersion());
495-
496-
// HACK: If you use waitFor(), unlock it beforehand to initialize the
497-
// context on the fly.
498-
synchronized (createdLock) {
499-
created.set(true);
500-
createdLock.notifyAll();
501-
}
502495

503496
while (true) {
504497
if (needResize.getAndSet(false)) {
@@ -653,6 +646,18 @@ public void create(boolean waitFor) {
653646
this.contextFlag.set(true);
654647
}
655648

649+
/**(non-Javadoc)
650+
* @param createdVal boolean
651+
*/
652+
@Override
653+
protected void waitFor(boolean createdVal) {
654+
// AWT together with LWJGLX cannot handle waitFor() in the best way,
655+
// since the context is created on the fly.
656+
if (createdVal) {
657+
LOGGER.log(Level.WARNING, "create(true) is not supported for AWT!");
658+
}
659+
}
660+
656661
/**
657662
* (non-Javadoc)
658663
* @see com.jme3.system.lwjgl.LwjglWindow#destroyContext()

0 commit comments

Comments
 (0)