diff options
author | Sven Gothel <[email protected]> | 2008-08-19 13:29:35 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-08-19 13:29:35 +0000 |
commit | 53b839d9c65114998b561a9a9f9309dff9636f77 (patch) | |
tree | df1b70c6d3a1abd48120cdd36b524f33fb4dbd9e | |
parent | 4093a4980a5610f62edaec97328577decefb9ce0 (diff) |
Some performance test changes
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@276 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
-rw-r--r-- | src/demos/es1/cube/CubeImmModeSink.java | 1 | ||||
-rw-r--r-- | src/jbullet/src/javabullet/demos/genericjoint/GenericJointDemo.java | 6 | ||||
-rw-r--r-- | src/jbullet/src/javabullet/demos/opengl/DemoApplication.java | 49 | ||||
-rwxr-xr-x | wince/ragdoll-es2-l1-args.txt | 1 | ||||
-rwxr-xr-x | wince/ragdoll-es2-l1.lnk | 1 | ||||
-rwxr-xr-x | wince/ragdoll-es2-l2-args.txt | 1 | ||||
-rwxr-xr-x | wince/ragdoll-es2-l2.lnk | 1 |
7 files changed, 43 insertions, 17 deletions
diff --git a/src/demos/es1/cube/CubeImmModeSink.java b/src/demos/es1/cube/CubeImmModeSink.java index 0427094..219e5fd 100644 --- a/src/demos/es1/cube/CubeImmModeSink.java +++ b/src/demos/es1/cube/CubeImmModeSink.java @@ -401,6 +401,7 @@ public class CubeImmModeSink implements GLEventListener { window.addGLEventListener(this); + window.enablePerfLog(true); // Size OpenGL to Video Surface window.setSize(width, height); window.setFullscreen(true); diff --git a/src/jbullet/src/javabullet/demos/genericjoint/GenericJointDemo.java b/src/jbullet/src/javabullet/demos/genericjoint/GenericJointDemo.java index 5de2626..bf786c1 100644 --- a/src/jbullet/src/javabullet/demos/genericjoint/GenericJointDemo.java +++ b/src/jbullet/src/javabullet/demos/genericjoint/GenericJointDemo.java @@ -52,8 +52,8 @@ public class GenericJointDemo extends DemoApplication { private List<RagDoll> ragdolls = new ArrayList<RagDoll>(); - public GenericJointDemo() { - super(); + public GenericJointDemo(String[] args) { + super(args); } public void initPhysics() { @@ -113,7 +113,7 @@ public class GenericJointDemo extends DemoApplication { } public static void main(String[] args) { - GenericJointDemo demoApp = new GenericJointDemo(); + GenericJointDemo demoApp = new GenericJointDemo(args); demoApp.initPhysics(); demoApp.setCameraDistance(10f); diff --git a/src/jbullet/src/javabullet/demos/opengl/DemoApplication.java b/src/jbullet/src/javabullet/demos/opengl/DemoApplication.java index c36db00..fb03ee9 100644 --- a/src/jbullet/src/javabullet/demos/opengl/DemoApplication.java +++ b/src/jbullet/src/javabullet/demos/opengl/DemoApplication.java @@ -112,10 +112,21 @@ public abstract class DemoApplication protected GLU glu=null; protected GLSRT glsrt=null; - public DemoApplication() { + protected boolean useLight0 = true; + protected boolean useLight1 = true; + + public DemoApplication(String[] args) { // debugMode |= DebugDrawModes.DRAW_WIREFRAME; debugMode |= DebugDrawModes.NO_HELP_TEXT; //debugMode |= DebugDrawModes.DISABLE_BULLET_LCP; + + for(int i=args.length-1; i>=0; i--) { + if(args[i].equals("-nolight0")) { + useLight0=false; + } else if(args[i].equals("-nolight1")) { + useLight1=false; + } + } } public abstract void initPhysics() throws Exception; @@ -155,19 +166,29 @@ public abstract class DemoApplication System.err.println(gl.glGetString(gl.GL_EXTENSIONS)); glsrt = new GLSRT(glu, gl); - gl.glLightfv(gl.GL_LIGHT0, gl.GL_AMBIENT, light_ambient, 0); - gl.glLightfv(gl.GL_LIGHT0, gl.GL_DIFFUSE, light_diffuse, 0); - gl.glLightfv(gl.GL_LIGHT0, gl.GL_SPECULAR, light_specular, 0); - gl.glLightfv(gl.GL_LIGHT0, gl.GL_POSITION, light_position0, 0); + if(useLight0) { + gl.glLightfv(gl.GL_LIGHT0, gl.GL_AMBIENT, light_ambient, 0); + gl.glLightfv(gl.GL_LIGHT0, gl.GL_DIFFUSE, light_diffuse, 0); + gl.glLightfv(gl.GL_LIGHT0, gl.GL_SPECULAR, light_specular, 0); + gl.glLightfv(gl.GL_LIGHT0, gl.GL_POSITION, light_position0, 0); + } - gl.glLightfv(gl.GL_LIGHT1, gl.GL_AMBIENT, light_ambient, 0); - gl.glLightfv(gl.GL_LIGHT1, gl.GL_DIFFUSE, light_diffuse, 0); - gl.glLightfv(gl.GL_LIGHT1, gl.GL_SPECULAR, light_specular, 0); - gl.glLightfv(gl.GL_LIGHT1, gl.GL_POSITION, light_position1, 0); + if(useLight1) { + gl.glLightfv(gl.GL_LIGHT1, gl.GL_AMBIENT, light_ambient, 0); + gl.glLightfv(gl.GL_LIGHT1, gl.GL_DIFFUSE, light_diffuse, 0); + gl.glLightfv(gl.GL_LIGHT1, gl.GL_SPECULAR, light_specular, 0); + gl.glLightfv(gl.GL_LIGHT1, gl.GL_POSITION, light_position1, 0); + } - gl.glEnable(gl.GL_LIGHTING); - gl.glEnable(gl.GL_LIGHT0); - gl.glEnable(gl.GL_LIGHT1); + if(useLight0 || useLight1) { + gl.glEnable(gl.GL_LIGHTING); + } + if(useLight0) { + gl.glEnable(gl.GL_LIGHT0); + } + if(useLight1) { + gl.glEnable(gl.GL_LIGHT1); + } gl.glShadeModel(gl.GL_SMOOTH); @@ -936,7 +957,7 @@ public abstract class DemoApplication float yStart = 20f; float yIncr = 20f; - gl.glDisable(gl.GL_LIGHTING); + // gl.glDisable(gl.GL_LIGHTING); // JAU gl.glColor4f(0f, 0f, 0f, 0f); /* @@ -1095,7 +1116,7 @@ public abstract class DemoApplication resetPerspectiveProjection(); } */ - gl.glEnable(gl.GL_LIGHTING); + // gl.glEnable(gl.GL_LIGHTING); } } diff --git a/wince/ragdoll-es2-l1-args.txt b/wince/ragdoll-es2-l1-args.txt new file mode 100755 index 0000000..b8da4e5 --- /dev/null +++ b/wince/ragdoll-es2-l1-args.txt @@ -0,0 +1 @@ +"-Dsun.boot.library.path=\Storage Card\bin" "-Xbootclasspath/a:\Storage Card\gluegen-rt.jar" "-Xbootclasspath/a:\Storage Card\jogl.core.jar" "-Xbootclasspath/a:\Storage Card\jogl.egl.jar" "-Xbootclasspath/a:\Storage Card\jogl.gles2.jar" "-Xbootclasspath/a:\Storage Card\jogl.fixed.jar" "-Xbootclasspath/a:\Storage Card\newt.jar" "-Xbootclasspath/a:\Storage Card\ragdoll.jar" "-Xopt:stdioPrefix=\Storage Card" javabullet.demos.genericjoint.GenericJointDemo -width 800 -height 480 -nolight1 diff --git a/wince/ragdoll-es2-l1.lnk b/wince/ragdoll-es2-l1.lnk new file mode 100755 index 0000000..d9a37a0 --- /dev/null +++ b/wince/ragdoll-es2-l1.lnk @@ -0,0 +1 @@ +01#"\Storage Card\bin\cvm.exe" -f "\Storage Card\ragdoll-es2-l1-args.txt" diff --git a/wince/ragdoll-es2-l2-args.txt b/wince/ragdoll-es2-l2-args.txt new file mode 100755 index 0000000..be8ea16 --- /dev/null +++ b/wince/ragdoll-es2-l2-args.txt @@ -0,0 +1 @@ +"-Dsun.boot.library.path=\Storage Card\bin" "-Xbootclasspath/a:\Storage Card\gluegen-rt.jar" "-Xbootclasspath/a:\Storage Card\jogl.core.jar" "-Xbootclasspath/a:\Storage Card\jogl.egl.jar" "-Xbootclasspath/a:\Storage Card\jogl.gles2.jar" "-Xbootclasspath/a:\Storage Card\jogl.fixed.jar" "-Xbootclasspath/a:\Storage Card\newt.jar" "-Xbootclasspath/a:\Storage Card\ragdoll.jar" "-Xopt:stdioPrefix=\Storage Card" javabullet.demos.genericjoint.GenericJointDemo -width 800 -height 480 -nolight1 -nolight0 diff --git a/wince/ragdoll-es2-l2.lnk b/wince/ragdoll-es2-l2.lnk new file mode 100755 index 0000000..c18a1fd --- /dev/null +++ b/wince/ragdoll-es2-l2.lnk @@ -0,0 +1 @@ +01#"\Storage Card\bin\cvm.exe" -f "\Storage Card\ragdoll-es2-l2-args.txt" |