File tree Expand file tree Collapse file tree
jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -492,6 +492,13 @@ 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+ }
495502
496503 while (true ) {
497504 if (needResize .getAndSet (false )) {
@@ -552,7 +559,7 @@ public void run() {
552559 // All this does is call swapBuffers().
553560 // If the canvas is not active, there's no need to waste time
554561 // doing that.
555- if (renderable .get () && canvas .hasContext ()) {
562+ if (renderable .get () && canvas .hasContext () && canvas . isValid () ) {
556563 try {
557564 if (allowSwapBuffers && autoFlush ) {
558565 // calls swap buffers | lock, etc.
@@ -715,6 +722,7 @@ protected void createContext(AppSettings settings) {
715722
716723 canvas .createContext ();
717724 canvas .makeCurrent ();
725+ canvas .validate ();
718726
719727 // This will activate the "effective data" scrubber.
720728 if (settings .getBoolean ("GLDataEffectiveDebug" )) {
You can’t perform that action at this time.
0 commit comments