summaryrefslogtreecommitdiffstats
path: root/src/demos/es2
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-08-02 05:15:22 -0700
committerSven Gothel <[email protected]>2009-08-02 05:15:22 -0700
commit911ead38d92310bcce1e1f79ff0d1f57a4748ced (patch)
tree64bd48b7bf5e97edec60b822b415f0867b169038 /src/demos/es2
parentf1ac38bdf71d0f9c8c2c34650f119bf3cc9b8900 (diff)
RedSquare: '-debug' option enables Debug/Trace using new GLPipelineFactory
Diffstat (limited to 'src/demos/es2')
-rwxr-xr-xsrc/demos/es2/RedSquare.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java
index 8b23ddc..da4505c 100755
--- a/src/demos/es2/RedSquare.java
+++ b/src/demos/es2/RedSquare.java
@@ -194,16 +194,15 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
System.err.println(glp+" swapInterval: " + swapInterval + " (GL: "+gl.getSwapInterval()+")");
System.err.println(glp+" GLU: " + glu);
- /***
- // Debug ..
- DebugGL2ES2 gldbg = new DebugGL2ES2(gl);
- gl.getContext().setGL(gldbg);
- gl = gldbg;
-
- // Trace ..
- TraceGL2ES2 gltrace = new TraceGL2ES2(gl, System.err);
- gl.getContext().setGL(gltrace);
- gl = gltrace; **/
+ if(debuggl) {
+ try {
+ // Debug ..
+ gl = (GL2ES2) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES2.class, gl, null) );
+
+ // Trace ..
+ gl = (GL2ES2) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES2.class, gl, new Object[] { System.err } ) );
+ } catch (Exception e) {e.printStackTrace();}
+ }
pmvMatrix = new PMVMatrix();
@@ -320,6 +319,7 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
public static boolean oneThread = false;
public static boolean pumpOnce = true;
public static int swapInterval = -1;
+ public static boolean debuggl = false;
public static void main(String[] args) {
int type = USE_NEWT ;
@@ -330,6 +330,8 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
try {
swapInterval = Integer.parseInt(args[i]);
} catch (Exception ex) { ex.printStackTrace(); }
+ } else if(args[i].equals("-debug")) {
+ debuggl=true;
} else if(args[i].equals("-pumponce")) {
pumpOnce=true;
} else if(args[i].equals("-1thread")) {