diff --git a/engine/src/jogl/com/jme3/system/jogl/JoglAbstractDisplay.java b/engine/src/jogl/com/jme3/system/jogl/JoglAbstractDisplay.java index 0801c1687..8540c0ac6 100644 --- a/engine/src/jogl/com/jme3/system/jogl/JoglAbstractDisplay.java +++ b/engine/src/jogl/com/jme3/system/jogl/JoglAbstractDisplay.java @@ -45,6 +45,8 @@ import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Logger; +import javax.media.opengl.DebugGL4bc; +import javax.media.opengl.GL; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLEventListener; @@ -118,19 +120,19 @@ public abstract class JoglAbstractDisplay extends JoglContext implements GLEvent canvas.setIgnoreRepaint(true); canvas.addGLEventListener(this); - + if (settings.getBoolean("GraphicsDebug")) { + canvas.invoke(false, new GLRunnable() { - // N.B: it is too early to get the GL instance from the canvas - // if (false){ - // trace mode - // jME already uses err stream, use out instead - // gl = new TraceGL(gl, System.out); - // }else if (false){ - // debug mode - // gl = new DebugGL(gl); - // }else{ - // production mode - // } + public boolean run(GLAutoDrawable glad) { + GL gl = glad.getGL(); + if (gl.isGL4bc()) { + canvas.setGL(new DebugGL4bc(gl.getGL4bc())); + } + return true; + } + }); + } + renderer = new JoglRenderer(); }