summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-04-15 03:46:16 +0200
committerSven Gothel <[email protected]>2010-04-15 03:46:16 +0200
commit4ff184fd14376241b5a28b3a93f84a849d33f002 (patch)
tree10bf9a19fcded63b0132ec9e626a986595985464
parentaa2f05ff1ab182fdb6f724a6aedf91de201efe7e (diff)
Fixes to match JOGL 2ae28d54858ff684bc2368e0476a7a357dc63432
-rwxr-xr-xjava-dbg-newt.sh2
-rw-r--r--java-dbg-swing.sh20
-rw-r--r--java-run-swing.sh19
-rw-r--r--make/build.xml10
-rw-r--r--setenv-jogl.sh8
-rwxr-xr-xsrc/demos/es1/RedSquare.java2
-rwxr-xr-xsrc/demos/hdr/HDR.java2
-rw-r--r--src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java2
-rwxr-xr-xsrc/demos/misc/TiledRendering.java2
-rw-r--r--src/demos/proceduralTexturePhysics/Water.java2
-rwxr-xr-xsrc/demos/readbuffer/Main.java36
-rwxr-xr-xsrc/demos/texture/TextureConvert.java2
12 files changed, 90 insertions, 17 deletions
diff --git a/java-dbg-newt.sh b/java-dbg-newt.sh
index c24987e..68a0685 100755
--- a/java-dbg-newt.sh
+++ b/java-dbg-newt.sh
@@ -16,6 +16,8 @@ if [ $CPOK -eq 0 ] ; then
else
# D_ARGS="-Dgluegen.debug.ProcAddressHelper=true -Dgluegen.debug.NativeLibrary=true -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all -Djogl.debug.GLSLState"
+ #D_ARGS="-Dnativewindow.debug.X11Util=true -Djogl.debug.GLDrawableFactory=true"
+ #D_ARGS="-Dnativewindow.debug.X11Util=true"
if [ $MOSX -eq 1 ] ; then
X_ARGS="-XstartOnFirstThread"
fi
diff --git a/java-dbg-swing.sh b/java-dbg-swing.sh
new file mode 100644
index 0000000..afebefa
--- /dev/null
+++ b/java-dbg-swing.sh
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+CPOK=0
+echo $CLASSPATH | grep jogl && CPOK=1
+
+#SWING_PROPS="-Dsun.java2d.noddraw=true -Dsun.java2d.opengl=true"
+#SWING_PROPS_DBG="-Djnlp.jogl.debug.GLJPanel=true"
+SWING_PROPS_DBG="-Dnewt.debug=all -Dnativewindow.debug=all -Djogl.debug=all"
+
+if [ $CPOK -eq 0 ] ; then
+ # Only valid for autobuild .. otherwise run manually with build-dir
+ . ./setenv-jogl.sh JOGL_ALL
+ echo $CLASSPATH | grep jogl && CPOK=1
+fi
+if [ $CPOK -eq 0 ] ; then
+ echo No JOGL in CLASSPATH
+else
+ java $SWING_PROPS $SWING_PROPS_DBG $* 2>&1 | tee java-dbg-swing.log
+fi
+
diff --git a/java-run-swing.sh b/java-run-swing.sh
new file mode 100644
index 0000000..5ea0e6f
--- /dev/null
+++ b/java-run-swing.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+CPOK=0
+echo $CLASSPATH | grep jogl && CPOK=1
+
+#SWING_PROPS="-Dsun.java2d.noddraw=true -Dsun.java2d.opengl=true"
+SWING_PROPS_DBG="-Djnlp.jogl.debug.GLJPanel=true"
+
+if [ $CPOK -eq 0 ] ; then
+ # Only valid for autobuild .. otherwise run manually with build-dir
+ . ./setenv-jogl.sh JOGL_ALL
+ echo $CLASSPATH | grep jogl && CPOK=1
+fi
+if [ $CPOK -eq 0 ] ; then
+ echo No JOGL in CLASSPATH
+else
+ java $SWING_PROPS $SWING_PROPS_DBG $* 2>&1 | tee java-run-swing.log
+fi
+
diff --git a/make/build.xml b/make/build.xml
index f376fa4..ae41a6c 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -112,7 +112,8 @@
<target name="nurbs" if="jogl.nurbs">
<!-- NOTE: this target requires a 1.5 javac to be on the PATH -->
- <javac destdir="${classes}" includes="demos/nurbs/**" source="1.5" debug="true" debuglevel="source,lines">
+ <javac destdir="${classes}" includes="demos/nurbs/**" source="1.5" debug="true" debuglevel="source,lines"
+ includeantruntime="false">
<src path="${src}" />
<classpath refid="jogl-demos.classpath" />
</javac>
@@ -129,7 +130,8 @@
</target>
<target name="redbook-javac">
- <javac destdir="${classes}" source="1.5" target="1.5" debug="true" debuglevel="source,lines">
+ <javac destdir="${classes}" source="1.5" target="1.5" debug="true" debuglevel="source,lines"
+ includeantruntime="false">
<src path="${src}/redbook/src" />
<classpath refid="jogl-demos.classpath" />
</javac>
@@ -164,7 +166,8 @@
<pathelement location="${swt.jar}" />
</path>
<!-- For the time being we exclude the VertexArrayRange and HDR demos, which rely on NVIDIA-specific extensions -->
- <javac destdir="${classes}" excludes="${jogl.cg.excludes},demos/nurbs/**,${jogl.swt.excludes},jbullet/**,${jogl.redbook.excludes},demos/vertexArrayRange/**" source="1.4" target="1.4" debug="true" debuglevel="source,lines">
+ <javac destdir="${classes}" excludes="${jogl.cg.excludes},demos/nurbs/**,${jogl.swt.excludes},jbullet/**,${jogl.redbook.excludes},demos/vertexArrayRange/**" source="1.4" target="1.4" debug="true" debuglevel="source,lines"
+ includeantruntime="false">
<src path="${src}" />
<classpath refid="jogl-demos.classpath" />
</javac>
@@ -237,6 +240,7 @@
<pathelement location="${newt.ogl.jar}" />
</path>
<javac destdir="${classes}" includes="demos/GLInfo*,demos/es1/**,demos/es2/**" source="1.4" target="1.4" debug="true" debuglevel="source,lines"
+ includeantruntime="false">
bootclasspath="${gluegen.root}/make/lib/cdc_fp.jar">
<src path="${src}" />
<classpath refid="jogl-demos.classpath" />
diff --git a/setenv-jogl.sh b/setenv-jogl.sh
index 145505c..76ab00a 100644
--- a/setenv-jogl.sh
+++ b/setenv-jogl.sh
@@ -69,6 +69,12 @@ else
JUNIT_JAR=$GLUEGEN_DIR/junit-4.5.jar
fi
+if [ -z "$ANT_PATH" ] ; then
+ ANT_JARS=
+else
+ ANT_JARS=$ANT_PATH/lib/ant.jar:$ANT_PATH/lib/ant-junit.jar
+fi
+
DEMOS_BUILDDIR=$THISDIR/$JOGL_BUILDDIR_BASE
echo JOGL AUTOBUILD: $AUTOBUILD
@@ -88,7 +94,7 @@ CP_SEP=:
SWT_CLASSPATH=$HOME/.java/swt.jar
LIB=$THISDIR/lib
-CLASSPATH=.:$DEMOS_BUILDDIR/jogl-demos.jar:$DEMOS_BUILDDIR/jogl-demos-util.jar:$DEMOS_BUILDDIR/jogl-demos-data.jar:$GLUEGEN_JAR:$JOGL_CLASSPATH:$SWT_CLASSPATH:$JUNIT_JAR
+CLASSPATH=.:$DEMOS_BUILDDIR/jogl-demos.jar:$DEMOS_BUILDDIR/jogl-demos-util.jar:$DEMOS_BUILDDIR/jogl-demos-data.jar:$GLUEGEN_JAR:$JOGL_CLASSPATH:$SWT_CLASSPATH:$JUNIT_JAR:$ANT_JARS
for i in $LIB/*jar ; do
CLASSPATH=$CLASSPATH:$i
done
diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java
index de4f54a..9f810d4 100755
--- a/src/demos/es1/RedSquare.java
+++ b/src/demos/es1/RedSquare.java
@@ -147,7 +147,7 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
} else {
do {
display();
- } while (!quit && window.getDuration() < 20000) ;
+ } while (!quit && window.getDuration() < 11000) ;
shutdown();
}
}
diff --git a/src/demos/hdr/HDR.java b/src/demos/hdr/HDR.java
index aca38e9..900d7f3 100755
--- a/src/demos/hdr/HDR.java
+++ b/src/demos/hdr/HDR.java
@@ -314,7 +314,7 @@ public class HDR extends Demo {
caps.setAlphaBits(floatAlphaBits);
caps.setDepthBits(floatDepthBits);
int[] tmp = new int[1];
- if (!GLDrawableFactory.getFactory(GLProfile.getDefault()).canCreateGLPbuffer()) {
+ if (!GLDrawableFactory.getFactory(GLProfile.getDefault()).canCreateGLPbuffer(null)) {
unavailableExtension("Can not create pbuffer");
}
if (pbuffer != null) {
diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java
index 6760161..0873d63 100644
--- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java
+++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java
@@ -272,7 +272,7 @@ public class HWShadowmapsSimple extends Demo {
GLCapabilities caps = new GLCapabilities(gl.getGLProfile());
caps.setDoubleBuffered(false);
- if (!GLDrawableFactory.getFactory(gl.getGLProfile()).canCreateGLPbuffer()) {
+ if (!GLDrawableFactory.getFactory(gl.getGLProfile()).canCreateGLPbuffer(null)) {
unavailableExtension("Can not create pbuffer");
}
if (pbuffer != null) {
diff --git a/src/demos/misc/TiledRendering.java b/src/demos/misc/TiledRendering.java
index 44035fd..08fd70e 100755
--- a/src/demos/misc/TiledRendering.java
+++ b/src/demos/misc/TiledRendering.java
@@ -41,7 +41,7 @@ public class TiledRendering {
GLCapabilities caps = new GLCapabilities(null);
caps.setDoubleBuffered(false);
- if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer()) {
+ if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer(null)) {
System.out.println("Demo requires pbuffer support");
System.exit(1);
}
diff --git a/src/demos/proceduralTexturePhysics/Water.java b/src/demos/proceduralTexturePhysics/Water.java
index f718604..593c2f0 100644
--- a/src/demos/proceduralTexturePhysics/Water.java
+++ b/src/demos/proceduralTexturePhysics/Water.java
@@ -214,7 +214,7 @@ public class Water {
// create the pbuffer. Will use this as an offscreen rendering buffer.
// it allows rendering a texture larger than our window.
caps.setDoubleBuffered(false);
- if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer()) {
+ if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer(null)) {
throw new GLException("Pbuffers not supported with this graphics card");
}
pbuffer = GLDrawableFactory.getFactory(caps.getGLProfile()).createGLPbuffer(caps,
diff --git a/src/demos/readbuffer/Main.java b/src/demos/readbuffer/Main.java
index c6ecefa..67c1b59 100755
--- a/src/demos/readbuffer/Main.java
+++ b/src/demos/readbuffer/Main.java
@@ -22,6 +22,7 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen
public void windowGainedFocus(WindowEvent e) { }
public void windowLostFocus(WindowEvent e) { }
public void windowDestroyNotify(WindowEvent e) {
+ System.err.println("********** quit **************");
quit = true;
}
@@ -58,7 +59,12 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen
capsOffscreen.setOnscreen(false);
capsOffscreen.setPBuffer(pbuffer);
capsOffscreen.setDoubleBuffered(false);
- GLWindow windowOffscreen = GLWindow.create(capsOffscreen);
+
+ Display nDisplay = NewtFactory.createDisplay(null); // local display
+ Screen nScreen = NewtFactory.createScreen(nDisplay, 0); // screen 0
+ Window nWindow = NewtFactory.createWindow(nScreen, capsOffscreen, false /* undecorated */);
+
+ GLWindow windowOffscreen = GLWindow.create(nWindow);
windowOffscreen.enablePerfLog(true);
windowOffscreen.setSize(w, h);
windowOffscreen.setVisible(true);
@@ -85,14 +91,16 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen
if ( TEST_SURFACE2FILE < typeTest ) {
System.out.println("readbuffer.Main.run() Using a target onscreen window with read drawable attachment");
// Setup init onscreen window ..
- Window nWindow = null;
if(0!=(typeNewt&USE_AWT)) {
Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null); // local display
Screen nScreen = NewtFactory.createScreen(NativeWindowFactory.TYPE_AWT, nDisplay, 0); // screen 0
- nWindow = NewtFactory.createWindow(NativeWindowFactory.TYPE_AWT, nScreen, caps);
+ Window nWindow = NewtFactory.createWindow(NativeWindowFactory.TYPE_AWT, nScreen, caps);
window = GLWindow.create(nWindow);
} else {
- window = GLWindow.create(caps);
+ Display nDisplay = NewtFactory.createDisplay(null); // local display
+ Screen nScreen = NewtFactory.createScreen(nDisplay, 0); // screen 0
+ Window nWindow = NewtFactory.createWindow(nScreen, caps, false /* undecorated */);
+ window = GLWindow.create(nWindow);
}
window.addWindowListener(this);
@@ -124,15 +132,29 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen
System.out.println(windowOffscreen);
System.out.println("+++++++++++++++++++++++++++");
- while ( !quit && windowOffscreen.getDuration() < 31000) {
+ while ( !quit ) {
// System.out.println("...............................");
windowOffscreen.display();
+ if ( TEST_READBUFFER2SCREEN == typeTest ) {
+ if ( windowOffscreen.getDuration() >= 10000) {
+ break;
+ }
+ } else {
+ if ( windowOffscreen.getTotalFrames() >= 10) {
+ break;
+ }
+ }
}
// Shut things down cooperatively
- window.destroy();
windowOffscreen.destroy();
- window.getFactory().shutdown();
+ if(null!=window) {
+ window.destroy();
+ }
+ try {
+ Thread.sleep(2000);
+ } catch (Exception e) {}
+ windowOffscreen.getFactory().shutdown();
System.out.println("readbuffer.Main shut down cleanly.");
} catch (GLException e) {
e.printStackTrace();
diff --git a/src/demos/texture/TextureConvert.java b/src/demos/texture/TextureConvert.java
index 03c7357..7cf6993 100755
--- a/src/demos/texture/TextureConvert.java
+++ b/src/demos/texture/TextureConvert.java
@@ -75,7 +75,7 @@ public class TextureConvert {
caps.setDoubleBuffered(false);
// Make a pbuffer to get an offscreen context
- if (!GLDrawableFactory.getFactory(glp).canCreateGLPbuffer()) {
+ if (!GLDrawableFactory.getFactory(glp).canCreateGLPbuffer(null)) {
System.out.println("Pbuffer support not available (required to run this demo)");
System.exit(1);
}