Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public void run() {
// All this does is call swapBuffers().
// If the canvas is not active, there's no need to waste time
// doing that.
if (renderable.get() && canvas.hasContext()) {
if (renderable.get() && canvas.hasContext() && canvas.isValid()) {
try {
if (allowSwapBuffers && autoFlush) {
// calls swap buffers | lock, etc.
Expand Down Expand Up @@ -646,6 +646,18 @@ public void create(boolean waitFor) {
this.contextFlag.set(true);
}

/**(non-Javadoc)
* @param createdVal boolean
*/
@Override
protected void waitFor(boolean createdVal) {
// AWT together with LWJGLX cannot handle waitFor() in the best way,
// since the context is created on the fly.
if (createdVal) {
LOGGER.log(Level.WARNING, "create(true) is not supported for AWT!");
}
}

/**
* (non-Javadoc)
* @see com.jme3.system.lwjgl.LwjglWindow#destroyContext()
Expand Down Expand Up @@ -716,6 +728,10 @@ protected void createContext(AppSettings settings) {
canvas.createContext();
canvas.makeCurrent();

SwingUtilities.invokeLater(() -> {
canvas.validate();
});

// This will activate the "effective data" scrubber.
if (settings.getBoolean("GLDataEffectiveDebug")) {
LOGGER.log(Level.INFO, "[ DEBUGGER ] :Effective data to initialize the LWJGL3-AWT context\n{0}",
Expand Down
Loading