Allows to enable the debug pipeline
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9908 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
@@ -45,6 +45,8 @@ import java.awt.GraphicsDevice;
|
|||||||
import java.awt.GraphicsEnvironment;
|
import java.awt.GraphicsEnvironment;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
import javax.media.opengl.DebugGL4bc;
|
||||||
|
import javax.media.opengl.GL;
|
||||||
import javax.media.opengl.GLAutoDrawable;
|
import javax.media.opengl.GLAutoDrawable;
|
||||||
import javax.media.opengl.GLCapabilities;
|
import javax.media.opengl.GLCapabilities;
|
||||||
import javax.media.opengl.GLEventListener;
|
import javax.media.opengl.GLEventListener;
|
||||||
@@ -118,19 +120,19 @@ public abstract class JoglAbstractDisplay extends JoglContext implements GLEvent
|
|||||||
canvas.setIgnoreRepaint(true);
|
canvas.setIgnoreRepaint(true);
|
||||||
canvas.addGLEventListener(this);
|
canvas.addGLEventListener(this);
|
||||||
|
|
||||||
|
if (settings.getBoolean("GraphicsDebug")) {
|
||||||
|
canvas.invoke(false, new GLRunnable() {
|
||||||
|
|
||||||
|
public boolean run(GLAutoDrawable glad) {
|
||||||
|
GL gl = glad.getGL();
|
||||||
|
if (gl.isGL4bc()) {
|
||||||
|
canvas.setGL(new DebugGL4bc(gl.getGL4bc()));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 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
|
|
||||||
// }
|
|
||||||
renderer = new JoglRenderer();
|
renderer = new JoglRenderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user