From 2e977f653578ca151018b4ced3a732b380b573cd Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Fri, 28 Aug 2015 19:09:52 +0200 Subject: [PATCH] Fixes a GLException caused by a regression on the management of the gamma correction in the JOGL backend --- .../java/com/jme3/system/jogl/JoglAbstractDisplay.java | 7 ++++++- .../java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglAbstractDisplay.java b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglAbstractDisplay.java index a7f7fbfd7..f90e812db 100644 --- a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglAbstractDisplay.java +++ b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglAbstractDisplay.java @@ -167,7 +167,12 @@ public abstract class JoglAbstractDisplay extends JoglContext implements GLEvent renderer = new JoglRenderer(); - renderer.setMainFrameBufferSrgb(settings.getGammaCorrection()); + canvas.invoke(false, new GLRunnable() { + public boolean run(GLAutoDrawable glad) { + renderer.setMainFrameBufferSrgb(settings.getGammaCorrection()); + return true; + } + }); } protected void startGLCanvas() { diff --git a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java index cb75d5d37..5239db8e8 100644 --- a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java +++ b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java @@ -146,7 +146,12 @@ public abstract class JoglNewtAbstractDisplay extends JoglContext implements GLE renderer = new JoglRenderer(); - renderer.setMainFrameBufferSrgb(settings.getGammaCorrection()); + canvas.invoke(false, new GLRunnable() { + public boolean run(GLAutoDrawable glad) { + renderer.setMainFrameBufferSrgb(settings.getGammaCorrection()); + return true; + } + }); } protected void startGLCanvas() {