From ae1ca3f2cae849f5e5a44538284082e861a98de1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 23 Nov 2010 05:07:51 +0100 Subject: Adapt to JOGL 7262641429b542929efc699e392f410f1dee2187 --- java-win32-dbg.bat | 4 +-- java-win32-gl2es12-dbg.bat | 6 ++--- java-win32.bat | 4 +-- java-win64-dbg.bat | 25 ++++++++++++++++++ java-win64.bat | 14 ++++++++++ jnlp-files/HDRDebug.jnlp | 37 +++++++++++++++++++++++++++ make/make.jogl.all.win32.bat | 4 +-- make/make.jogl.all.win64.bat | 13 ++++++++++ src/demos/GLInfo.java | 2 +- src/demos/GLNewtRun.java | 1 - src/demos/applets/JOGLNewtApplet1Run.java | 2 +- src/demos/applets/JOGLNewtAppletBase.java | 4 +-- src/demos/context/DualContext.java | 3 ++- src/demos/es1/RedSquare.java | 4 +-- src/demos/es2/RedSquare.java | 4 +-- src/demos/misc/GLCapsTableDemo.java | 18 +++++++------ src/demos/proceduralTexturePhysics/Water.java | 3 ++- 17 files changed, 119 insertions(+), 29 deletions(-) create mode 100644 java-win64-dbg.bat create mode 100644 java-win64.bat create mode 100755 jnlp-files/HDRDebug.jnlp create mode 100644 make/make.jogl.all.win64.bat diff --git a/java-win32-dbg.bat b/java-win32-dbg.bat index 9de5f1f..bd19b64 100644 --- a/java-win32-dbg.bat +++ b/java-win32-dbg.bat @@ -1,6 +1,6 @@ -set J2RE_HOME=c:\jre1.6.0_20_x32 -set JAVA_HOME=c:\jdk1.6.0_20_x32 +set J2RE_HOME=c:\jre1.6.0_22_x32 +set JAVA_HOME=c:\jdk1.6.0_22_x32 set JAR_DIR=..\jogl\build-win32\jar set LIB_DIR=..\jogl\build-win32\lib diff --git a/java-win32-gl2es12-dbg.bat b/java-win32-gl2es12-dbg.bat index f1942d5..3baf934 100644 --- a/java-win32-gl2es12-dbg.bat +++ b/java-win32-gl2es12-dbg.bat @@ -1,8 +1,6 @@ -set J2RE_HOME=c:\jre6 -set JAVA_HOME=c:\jdk6 -REM set J2RE_HOME=c:\jdk1.4.2_21 -REM set JAVA_HOME=c:\jdk1.4.2_21 +set J2RE_HOME=c:\jre1.6.0_22_x32 +set JAVA_HOME=c:\jdk1.6.0_22_x32 set JAR_DIR=jogl\lib set LIB_DIR=jogl\lib diff --git a/java-win32.bat b/java-win32.bat index c9dc916..1e92a89 100644 --- a/java-win32.bat +++ b/java-win32.bat @@ -1,6 +1,6 @@ -set J2RE_HOME=c:\jre1.6.0_20_x32 -set JAVA_HOME=c:\jdk1.6.0_20_x32 +set J2RE_HOME=c:\jre1.6.0_22_x32 +set JAVA_HOME=c:\jdk1.6.0_22_x32 set JAR_DIR=..\jogl\build-win32\jar set LIB_DIR=..\jogl\build-win32\lib diff --git a/java-win64-dbg.bat b/java-win64-dbg.bat new file mode 100644 index 0000000..f5ef8f2 --- /dev/null +++ b/java-win64-dbg.bat @@ -0,0 +1,25 @@ + +set J2RE_HOME=c:\jre1.6.0_22_x64 +set JAVA_HOME=c:\jdk1.6.0_22_x64 + +set JAR_DIR=..\jogl\build-win64\jar +set LIB_DIR=..\jogl\build-win64\lib + +set CP_ALL=.;%JAR_DIR%\jogl.all.jar;%JAR_DIR%\nativewindow.all.jar;%JAR_DIR%\newt.all.jar;%JAR_DIR%\gluegen-rt.jar;build-win64\jogl-demos.jar;build-win64\jogl-demos-util.jar;build-win64\jogl-demos-data.jar + +echo CP_ALL %CP_ALL% + +REM "-Djogamp.debug.ProcAddressHelper=true" +REM "-Djogamp.debug.NativeLibrary=true" +REM "-Dnativewindow.debug=all" +REM "-Djogl.debug=all" +REM "-Dnewt.debug=all" + +set D_ARGS="-Djogamp.debug.JNILibLoader=true" "-Djogamp.debug.NativeLibrary=true" "-Djogamp.debug.NativeLibrary.Lookup=true" "-Djogl.debug.GLProfile=true" +REM D_ARGS="-Djogl.debug=all -Dnewt.debug=all -Dnativewindow.debug=all" + +set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true" + +%J2RE_HOME%\bin\java -classpath %CP_ALL% "-Djava.library.path=%LIB_DIR%" %D_ARGS% %X_ARGS% %1 %2 %3 %4 %5 %6 %7 %8 %9 > java-win64-dbg.log 2>&1 + + diff --git a/java-win64.bat b/java-win64.bat new file mode 100644 index 0000000..45f1d73 --- /dev/null +++ b/java-win64.bat @@ -0,0 +1,14 @@ + +set J2RE_HOME=c:\jre1.6.0_22_x64 +set JAVA_HOME=c:\jdk1.6.0_22_x64 + +set JAR_DIR=..\jogl\build-win64\jar +set LIB_DIR=..\jogl\build-win64\lib + +set CP_ALL=.;%JAR_DIR%\jogl.all.jar;%JAR_DIR%\nativewindow.all.jar;%JAR_DIR%\newt.all.jar;%JAR_DIR%\gluegen-rt.jar;build-win64\jogl-demos.jar;build-win64\jogl-demos-util.jar;build-win64\jogl-demos-data.jar + +echo CP_ALL %CP_ALL% + +%J2RE_HOME%\bin\java -classpath %CP_ALL% "-Djava.library.path=%LIB_DIR%" "-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true" %1 %2 %3 %4 %5 %6 %7 %8 %9 > java-win64.log 2>&1 + + diff --git a/jnlp-files/HDRDebug.jnlp b/jnlp-files/HDRDebug.jnlp new file mode 100755 index 0000000..1f93b65 --- /dev/null +++ b/jnlp-files/HDRDebug.jnlp @@ -0,0 +1,37 @@ + + + + JOGL High Dynamic Range Rendering Demo + JogAmp Community + + High Dynamic Range Rendering Demo + NVidia's High Dynamic Range (HDR) rendering demo ported to Java and JOGL. + + + + + + + + + + + + + + + + + + + + demos/data/images/stpeters_cross.hdr + 512 + 384 + 2 + 7 + 3 + demos/data/models/teapot.obj + + diff --git a/make/make.jogl.all.win32.bat b/make/make.jogl.all.win32.bat index 3165ba5..ba37559 100644 --- a/make/make.jogl.all.win32.bat +++ b/make/make.jogl.all.win32.bat @@ -1,7 +1,7 @@ set THISDIR="C:\JOGL" -set J2RE_HOME=c:\jre1.6.0_20_x32 -set JAVA_HOME=c:\jdk1.6.0_20_x32 +set J2RE_HOME=c:\jre1.6.0_22_x32 +set JAVA_HOME=c:\jdk1.6.0_22_x32 set ANT_PATH=C:\apache-ant-1.8.0 set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH% diff --git a/make/make.jogl.all.win64.bat b/make/make.jogl.all.win64.bat new file mode 100644 index 0000000..3ffc828 --- /dev/null +++ b/make/make.jogl.all.win64.bat @@ -0,0 +1,13 @@ +set THISDIR="C:\JOGL" + +set J2RE_HOME=c:\jre1.6.0_22_x64 +set JAVA_HOME=c:\jdk1.6.0_22_x64 +set ANT_PATH=C:\apache-ant-1.8.0 + +set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw64\bin;c:\mingw\bin;%PATH% + +set LIB_GEN=%THISDIR%\lib +set CLASSPATH=.;%THISDIR%\build-win64\classes +REM -Djogl.cg=1 + +ant -Djogl.cg=1 -Drootrel.build=build-win64 %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win64.log 2>&1 diff --git a/src/demos/GLInfo.java b/src/demos/GLInfo.java index 9cd055d..c49a578 100755 --- a/src/demos/GLInfo.java +++ b/src/demos/GLInfo.java @@ -82,7 +82,7 @@ public class GLInfo extends Thread implements GLEventListener { window.display(); // Shut things down cooperatively - window.destroy(true); + window.destroy(); System.out.println(glp+" GLInfo shut down cleanly."); } catch (Throwable t) { t.printStackTrace(); diff --git a/src/demos/GLNewtRun.java b/src/demos/GLNewtRun.java index 40e5e1a..5310a93 100755 --- a/src/demos/GLNewtRun.java +++ b/src/demos/GLNewtRun.java @@ -217,7 +217,6 @@ public class GLNewtRun extends WindowAdapter implements KeyListener, MouseListen } } nWindow.setUndecorated(undecorated); - nWindow.getScreen().setDestroyWhenUnused(true); window = GLWindow.create(nWindow); if(!setField(demo, "window", window)) { diff --git a/src/demos/applets/JOGLNewtApplet1Run.java b/src/demos/applets/JOGLNewtApplet1Run.java index 936e7b9..0a5311b 100755 --- a/src/demos/applets/JOGLNewtApplet1Run.java +++ b/src/demos/applets/JOGLNewtApplet1Run.java @@ -86,7 +86,7 @@ public class JOGLNewtApplet1Run extends Applet { glWindow.setVisible(false); // hide 1st glWindow.reparentWindow(null); // get out of newtCanvasAWT this.remove(newtCanvasAWT); // remove newtCanvasAWT - base.destroy(true); // destroy glWindow unrecoverable + base.destroy(); // destroy glWindow unrecoverable base=null; } } diff --git a/src/demos/applets/JOGLNewtAppletBase.java b/src/demos/applets/JOGLNewtAppletBase.java index da8565c..9fa1bdc 100755 --- a/src/demos/applets/JOGLNewtAppletBase.java +++ b/src/demos/applets/JOGLNewtAppletBase.java @@ -152,7 +152,7 @@ public class JOGLNewtAppletBase extends WindowAdapter implements KeyListener, Mo } } - public void destroy(boolean unrecoverable) { + public void destroy() { isValid = false; if(null!=glAnimator) { glAnimator.stop(); @@ -160,7 +160,7 @@ public class JOGLNewtAppletBase extends WindowAdapter implements KeyListener, Mo glAnimator=null; } if(null!=glWindow) { - glWindow.destroy(unrecoverable); + glWindow.destroy(); glWindow=null; } } diff --git a/src/demos/context/DualContext.java b/src/demos/context/DualContext.java index d77c49a..562b1fd 100755 --- a/src/demos/context/DualContext.java +++ b/src/demos/context/DualContext.java @@ -145,8 +145,9 @@ public class DualContext extends Canvas { GLProfile glp = GLProfile.getDefault(); // warm up .. AWTGraphicsScreen screen = (AWTGraphicsScreen)AWTGraphicsScreen.createDefault(); + GLCapabilities caps = new GLCapabilities(glp); AWTGraphicsConfiguration config = (AWTGraphicsConfiguration) - GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(new GLCapabilities(glp), null, screen); + GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(caps, caps, null, screen); final DualContext dc = new DualContext(config); frame.getContentPane().add(dc, BorderLayout.CENTER); diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java index 4c3d299..a0faf9b 100755 --- a/src/demos/es1/RedSquare.java +++ b/src/demos/es1/RedSquare.java @@ -173,10 +173,10 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo try { System.out.println("SHUTDOWN "+Thread.currentThread()+" START"); // Shut things down cooperatively - window.destroy(true); + window.destroy(); window = null; if(null!=nWindow) { - nWindow.destroy(true); + nWindow.destroy(); nWindow=null; } System.out.println("SHUTDOWN "+Thread.currentThread()+" FIN"); diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java index ec126db..54c44eb 100755 --- a/src/demos/es2/RedSquare.java +++ b/src/demos/es2/RedSquare.java @@ -146,10 +146,10 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo public void shutdown() { try { // Shut things down cooperatively - window.destroy(true); + window.destroy(); window = null; if(null!=nWindow) { - nWindow.destroy(true); + nWindow.destroy(); nWindow=null; } System.out.println("SHUTDOWN "+Thread.currentThread()+" cleanly"); diff --git a/src/demos/misc/GLCapsTableDemo.java b/src/demos/misc/GLCapsTableDemo.java index 701712c..abfef88 100755 --- a/src/demos/misc/GLCapsTableDemo.java +++ b/src/demos/misc/GLCapsTableDemo.java @@ -20,6 +20,8 @@ import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLCapabilitiesChooser; import javax.media.opengl.awt.GLCanvas; import com.jogamp.opengl.util.FPSAnimator; +import javax.media.nativewindow.CapabilitiesImmutable; +import javax.media.opengl.GLCapabilitiesImmutable; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JFrame; @@ -68,17 +70,17 @@ public class GLCapsTableDemo private DefaultGLCapabilitiesChooser choiceExaminer = // new DefaultGLCapabilitiesChooser() { - public int chooseCapabilities(Capabilities _desired, - Capabilities[] _available, + public int chooseCapabilities(CapabilitiesImmutable _desired, + CapabilitiesImmutable[] _available, int windowSystemRecommendedChoice) { - GLCapabilities desired = (GLCapabilities) _desired; - GLCapabilities[] available = (GLCapabilities[]) _available; + GLCapabilitiesImmutable desired = (GLCapabilitiesImmutable) _desired; + GLCapabilitiesImmutable[] available = (GLCapabilitiesImmutable[]) _available; if ( available != null ) for (int i = 0; i < available.length; i++) { - GLCapabilities c = available[i]; + GLCapabilitiesImmutable c = available[i]; if (c != null) { - GLCapsTableDemo.this.available.add((GLCapabilities) c.clone()); + GLCapsTableDemo.this.available.add((GLCapabilities) c.cloneMutable()); GLCapsTableDemo.this.indices.add(new Integer(i)); } } @@ -130,8 +132,8 @@ public class GLCapsTableDemo * @see javax.media.opengl.GLCapabilitiesChooser#chooseCapabilities(javax.media.nativewindow.Capabilities, * javax.media.nativewindow.Capabilities[], int) */ - public int chooseCapabilities(Capabilities desired, - Capabilities[] available, + public int chooseCapabilities(CapabilitiesImmutable desired, + CapabilitiesImmutable[] available, int windowSystemRecommendedChoice) { int row = capsTable.getSelectedRow(); diff --git a/src/demos/proceduralTexturePhysics/Water.java b/src/demos/proceduralTexturePhysics/Water.java index 593c2f0..1710ef4 100644 --- a/src/demos/proceduralTexturePhysics/Water.java +++ b/src/demos/proceduralTexturePhysics/Water.java @@ -49,6 +49,7 @@ import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLCapabilitiesImmutable; import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.GLEventListener; import javax.media.opengl.GLException; @@ -203,7 +204,7 @@ public class Water { String cubeMapFilenamePrefix, String cubeMapFilenameSuffix, GLAutoDrawable parentWindow) { - GLCapabilities caps = parentWindow.getChosenGLCapabilities(); + GLCapabilities caps = (GLCapabilities) parentWindow.getChosenGLCapabilities().cloneMutable(); loadInitialTexture(caps.getGLProfile(), initialMapFilename); tmpSpinFilename = spinFilename; -- cgit v1.2.3