From 28388dd9be0df17bc2a1f538d0e039c4c82443ac Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Sun, 28 Mar 2010 20:43:20 +0200 Subject: fixed jogl-demos since we moved some packages in jogl. --- src/demos/es2/RedSquare.java | 4 ++-- src/demos/es2/openmax/Cube.java | 4 ++-- src/demos/es2/openmax/MovieCube.java | 6 +++--- src/demos/es2/openmax/MovieSimple.java | 6 +++--- src/demos/es2/perftst/PerfTextLoad.java | 4 ++-- src/demos/es2/perftst/PerfUniLoad.java | 4 ++-- src/demos/es2/perftst/PerfVBOLoad.java | 4 ++-- src/demos/es2/perftst/Perftst.java | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/demos/es2') diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java index 958f118..0e7a27c 100755 --- a/src/demos/es2/RedSquare.java +++ b/src/demos/es2/RedSquare.java @@ -8,8 +8,8 @@ import javax.media.nativewindow.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.opengl.*; +import com.jogamp.javafx.newt.*; +import com.jogamp.javafx.newt.opengl.*; public class RedSquare extends Thread implements WindowListener, KeyListener, MouseListener, GLEventListener { diff --git a/src/demos/es2/openmax/Cube.java b/src/demos/es2/openmax/Cube.java index 620ce88..2337d16 100644 --- a/src/demos/es2/openmax/Cube.java +++ b/src/demos/es2/openmax/Cube.java @@ -39,8 +39,8 @@ import javax.media.nativewindow.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.fixedfunc.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.opengl.*; +import com.jogamp.javafx.newt.*; +import com.jogamp.javafx.newt.opengl.*; public class Cube implements GLEventListener { boolean quit = false; diff --git a/src/demos/es2/openmax/MovieCube.java b/src/demos/es2/openmax/MovieCube.java index 197b2c9..c8ac4cc 100755 --- a/src/demos/es2/openmax/MovieCube.java +++ b/src/demos/es2/openmax/MovieCube.java @@ -38,13 +38,13 @@ package demos.es2.openmax; import javax.media.opengl.*; import com.jogamp.opengl.util.glsl.fixedfunc.*; -import com.sun.openmax.*; +import com.jogamp.openmax.*; import java.nio.*; import java.net.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.opengl.*; +import com.jogamp.javafx.newt.*; +import com.jogamp.javafx.newt.opengl.*; public class MovieCube implements MouseListener, GLEventListener, OMXEventListener { GLWindow window; diff --git a/src/demos/es2/openmax/MovieSimple.java b/src/demos/es2/openmax/MovieSimple.java index 3bd4156..13d09fe 100755 --- a/src/demos/es2/openmax/MovieSimple.java +++ b/src/demos/es2/openmax/MovieSimple.java @@ -39,13 +39,13 @@ import javax.media.opengl.*; import com.jogamp.opengl.util.glsl.*; import com.jogamp.opengl.util.*; -import com.sun.openmax.*; +import com.jogamp.openmax.*; import java.nio.*; import java.net.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.opengl.*; +import com.jogamp.javafx.newt.*; +import com.jogamp.javafx.newt.opengl.*; public class MovieSimple implements MouseListener, GLEventListener, OMXEventListener { private GLWindow window; diff --git a/src/demos/es2/perftst/PerfTextLoad.java b/src/demos/es2/perftst/PerfTextLoad.java index d58354b..a08f4d9 100755 --- a/src/demos/es2/perftst/PerfTextLoad.java +++ b/src/demos/es2/perftst/PerfTextLoad.java @@ -7,8 +7,8 @@ import javax.media.opengl.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.texture.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.opengl.*; +import com.jogamp.javafx.newt.*; +import com.jogamp.javafx.newt.opengl.*; public class PerfTextLoad extends PerfModule { static final int MAX_TEXTURE_ENGINES = 8; diff --git a/src/demos/es2/perftst/PerfUniLoad.java b/src/demos/es2/perftst/PerfUniLoad.java index a38baa3..b2af9cb 100755 --- a/src/demos/es2/perftst/PerfUniLoad.java +++ b/src/demos/es2/perftst/PerfUniLoad.java @@ -4,8 +4,8 @@ import java.nio.*; import javax.media.opengl.*; import com.jogamp.opengl.util.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.opengl.*; +import com.jogamp.javafx.newt.*; +import com.jogamp.javafx.newt.opengl.*; public class PerfUniLoad extends PerfModule { static final int MAX_ARRAYS = 12; diff --git a/src/demos/es2/perftst/PerfVBOLoad.java b/src/demos/es2/perftst/PerfVBOLoad.java index ee9b251..5563ea8 100755 --- a/src/demos/es2/perftst/PerfVBOLoad.java +++ b/src/demos/es2/perftst/PerfVBOLoad.java @@ -4,8 +4,8 @@ import java.nio.*; import javax.media.opengl.*; import com.jogamp.opengl.util.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.opengl.*; +import com.jogamp.javafx.newt.*; +import com.jogamp.javafx.newt.opengl.*; public class PerfVBOLoad extends PerfModule { diff --git a/src/demos/es2/perftst/Perftst.java b/src/demos/es2/perftst/Perftst.java index 4d1f7e0..b0b8cdc 100755 --- a/src/demos/es2/perftst/Perftst.java +++ b/src/demos/es2/perftst/Perftst.java @@ -7,8 +7,8 @@ import javax.media.nativewindow.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.opengl.*; +import com.jogamp.javafx.newt.*; +import com.jogamp.javafx.newt.opengl.*; public class Perftst implements MouseListener, GLEventListener { -- cgit v1.2.3 From 19528b880625ee830ab03cb2724311a874240fe8 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Mon, 29 Mar 2010 04:48:33 +0200 Subject: changes due to package rename in jogl. --- cvm-dbg-newt.sh | 2 +- cvm-run-newt.sh | 2 +- java-dbg-newt.sh | 2 +- java-run-newt.sh | 2 +- setenv-jogl.sh | 2 +- src/demos/GLInfo.java | 6 ++---- src/demos/GLNewtRun.java | 5 ++--- src/demos/applets/JOGLNewtApplet1Run.java | 3 +-- src/demos/applets/JOGLNewtAppletBase.java | 5 ++--- src/demos/es1/Info.java | 6 ++---- src/demos/es1/RedSquare.java | 4 ++-- src/demos/es1/angeles/Main.java | 5 ++--- src/demos/es1/cube/Cube.java | 4 ++-- src/demos/es1/cube/CubeImmModeSink.java | 4 ++-- src/demos/es1/cubefbo/Main.java | 5 ++--- src/demos/es2/RedSquare.java | 4 ++-- src/demos/es2/openmax/Cube.java | 4 ++-- src/demos/es2/openmax/MovieCube.java | 5 ++--- src/demos/es2/openmax/MovieSimple.java | 4 ++-- src/demos/es2/perftst/PerfTextLoad.java | 4 ++-- src/demos/es2/perftst/PerfUniLoad.java | 2 -- src/demos/es2/perftst/PerfVBOLoad.java | 2 -- src/demos/es2/perftst/Perftst.java | 5 ++--- src/demos/newt/NEWTTest1.java | 2 +- src/demos/newt/TaskManagerTest1.java | 2 +- src/demos/newt/TaskManagerTest2.java | 2 +- src/demos/newt/util/TaskToolWM.java | 3 +-- src/demos/readbuffer/Main.java | 5 ++--- src/jbullet/src/javabullet/demos/opengl/DemoApplication.java | 2 +- src/jbullet/src/javabullet/demos/opengl/JOGL.java | 2 +- 30 files changed, 44 insertions(+), 61 deletions(-) (limited to 'src/demos/es2') diff --git a/cvm-dbg-newt.sh b/cvm-dbg-newt.sh index f6f2c31..6345002 100755 --- a/cvm-dbg-newt.sh +++ b/cvm-dbg-newt.sh @@ -22,5 +22,5 @@ fi # D_ARGS="-Dgluegen.debug.ProcAddressHelper=true -Dgluegen.debug.NativeLibrary=true -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" D_ARGS="-Dgluegen.debug.NativeLibrary=true -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" -$CVM $X_FLAGS -Djava.awt.headless=true $D_ARGS -Dsun.boot.library.path=../jogl/$BUILD_SUBDIR/lib -Xbootclasspath/a:../gluegen/$BUILD_SUBDIR/gluegen-rt-cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/nativewindow/nativewindow.all.cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/jogl/jogl.all.cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/newt/newt.all.cdc.jar -Xbootclasspath/a:$BUILD_SUBDIR/jogl-demos.jar com.jogamp.javafx.newt.util.MainThread $* 2>&1 | tee cvm-dbg-newt.log +$CVM $X_FLAGS -Djava.awt.headless=true $D_ARGS -Dsun.boot.library.path=../jogl/$BUILD_SUBDIR/lib -Xbootclasspath/a:../gluegen/$BUILD_SUBDIR/gluegen-rt-cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/nativewindow/nativewindow.all.cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/jogl/jogl.all.cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/newt/newt.all.cdc.jar -Xbootclasspath/a:$BUILD_SUBDIR/jogl-demos.jar com.jogamp.newt.util.MainThread $* 2>&1 | tee cvm-dbg-newt.log diff --git a/cvm-run-newt.sh b/cvm-run-newt.sh index da26de1..5461573 100755 --- a/cvm-run-newt.sh +++ b/cvm-run-newt.sh @@ -19,4 +19,4 @@ if [ "$1" = "-cpu" ] ; then shift fi -$CVM $X_FLAGS -Djava.awt.headless=true -Dsun.boot.library.path=../jogl/$BUILD_SUBDIR/lib -Xbootclasspath/a:../gluegen/$BUILD_SUBDIR/gluegen-rt-cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/nativewindow/nativewindow.all.cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/jogl/jogl.all.cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/newt/newt.all.cdc.jar -Xbootclasspath/a:$BUILD_SUBDIR/jogl-demos.jar com.jogamp.javafx.newt.util.MainThread $* 2>&1 | tee cvm-run-newt.log +$CVM $X_FLAGS -Djava.awt.headless=true -Dsun.boot.library.path=../jogl/$BUILD_SUBDIR/lib -Xbootclasspath/a:../gluegen/$BUILD_SUBDIR/gluegen-rt-cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/nativewindow/nativewindow.all.cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/jogl/jogl.all.cdc.jar -Xbootclasspath/a:../jogl/$BUILD_SUBDIR/newt/newt.all.cdc.jar -Xbootclasspath/a:$BUILD_SUBDIR/jogl-demos.jar com.jogamp.newt.util.MainThread $* 2>&1 | tee cvm-run-newt.log diff --git a/java-dbg-newt.sh b/java-dbg-newt.sh index 7421d7d..c24987e 100755 --- a/java-dbg-newt.sh +++ b/java-dbg-newt.sh @@ -20,5 +20,5 @@ else X_ARGS="-XstartOnFirstThread" fi - java $X_ARGS -Djava.awt.headless=true $D_ARGS com.jogamp.javafx.newt.util.MainThread $* 2>&1 | tee java-dbg-newt.log + java $X_ARGS -Djava.awt.headless=true $D_ARGS com.jogamp.newt.util.MainThread $* 2>&1 | tee java-dbg-newt.log fi diff --git a/java-run-newt.sh b/java-run-newt.sh index 0739d85..14069af 100755 --- a/java-run-newt.sh +++ b/java-run-newt.sh @@ -18,5 +18,5 @@ else X_ARGS="-XstartOnFirstThread" fi - java $X_ARGS -Djava.awt.headless=true com.jogamp.javafx.newt.util.MainThread $* 2>&1 | tee java-run-newt.log + java $X_ARGS -Djava.awt.headless=true com.jogamp.newt.util.MainThread $* 2>&1 | tee java-run-newt.log fi diff --git a/setenv-jogl.sh b/setenv-jogl.sh index 8c7e8d4..27a76cf 100644 --- a/setenv-jogl.sh +++ b/setenv-jogl.sh @@ -93,7 +93,7 @@ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GLUEGEN_OS:$JOGL_LIB_DIR echo CLASSPATH: $CLASSPATH echo echo MacOSX REMEMBER to add the JVM arguments "-XstartOnFirstThread -Djava.awt.headless=true" for running demos without AWT, e.g. NEWT -echo MacOSX REMEMBER to add the JVM arguments "-XstartOnFirstThread -Djava.awt.headless=true com.jogamp.javafx.newt.util.MainThread" for running demos with NEWT +echo MacOSX REMEMBER to add the JVM arguments "-XstartOnFirstThread -Djava.awt.headless=true com.jogamp.newt.util.MainThread" for running demos with NEWT PATH=$J2RE_HOME/bin:$JAVA_HOME/bin:$PATH export PATH diff --git a/src/demos/GLInfo.java b/src/demos/GLInfo.java index e4c0892..c873a54 100755 --- a/src/demos/GLInfo.java +++ b/src/demos/GLInfo.java @@ -1,12 +1,10 @@ package demos; -import java.nio.*; import javax.media.opengl.*; -import javax.media.opengl.glu.*; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class GLInfo extends Thread implements GLEventListener { diff --git a/src/demos/GLNewtRun.java b/src/demos/GLNewtRun.java index d8d2f73..b774983 100755 --- a/src/demos/GLNewtRun.java +++ b/src/demos/GLNewtRun.java @@ -1,13 +1,12 @@ package demos; -import java.util.*; import java.lang.reflect.*; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class GLNewtRun implements WindowListener, KeyListener, MouseListener { diff --git a/src/demos/applets/JOGLNewtApplet1Run.java b/src/demos/applets/JOGLNewtApplet1Run.java index c53f5d4..9496155 100755 --- a/src/demos/applets/JOGLNewtApplet1Run.java +++ b/src/demos/applets/JOGLNewtApplet1Run.java @@ -8,8 +8,7 @@ import java.awt.event.KeyListener; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; /** Shows how to deploy an applet using JOGL. This demo must be referenced from a web page via an <applet> tag. */ diff --git a/src/demos/applets/JOGLNewtAppletBase.java b/src/demos/applets/JOGLNewtAppletBase.java index 6cd9ec9..961ccfd 100755 --- a/src/demos/applets/JOGLNewtAppletBase.java +++ b/src/demos/applets/JOGLNewtAppletBase.java @@ -1,10 +1,9 @@ package demos.applets; -import java.util.*; import java.lang.reflect.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.GLWindow; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.GLWindow; import javax.media.opengl.*; import com.jogamp.opengl.util.*; diff --git a/src/demos/es1/Info.java b/src/demos/es1/Info.java index a1023a1..9322862 100755 --- a/src/demos/es1/Info.java +++ b/src/demos/es1/Info.java @@ -1,12 +1,10 @@ package demos.es1; -import java.nio.*; import javax.media.opengl.*; -import javax.media.opengl.glu.*; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class Info implements GLEventListener { diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java index d712147..d391442 100755 --- a/src/demos/es1/RedSquare.java +++ b/src/demos/es1/RedSquare.java @@ -9,8 +9,8 @@ import javax.media.nativewindow.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.fixedfunc.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class RedSquare extends Thread implements WindowListener, KeyListener, MouseListener, GLEventListener { diff --git a/src/demos/es1/angeles/Main.java b/src/demos/es1/angeles/Main.java index 01c78ba..35da6e1 100755 --- a/src/demos/es1/angeles/Main.java +++ b/src/demos/es1/angeles/Main.java @@ -1,10 +1,9 @@ package demos.es1.angeles; -import java.nio.*; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class Main implements WindowListener, MouseListener { diff --git a/src/demos/es1/cube/Cube.java b/src/demos/es1/cube/Cube.java index 7aadecb..198bba8 100644 --- a/src/demos/es1/cube/Cube.java +++ b/src/demos/es1/cube/Cube.java @@ -39,8 +39,8 @@ import javax.media.nativewindow.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.fixedfunc.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class Cube implements GLEventListener { public boolean glDebug = false ; diff --git a/src/demos/es1/cube/CubeImmModeSink.java b/src/demos/es1/cube/CubeImmModeSink.java index 79c1fd6..fccbb5a 100644 --- a/src/demos/es1/cube/CubeImmModeSink.java +++ b/src/demos/es1/cube/CubeImmModeSink.java @@ -38,8 +38,8 @@ import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.fixedfunc.*; import java.nio.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class CubeImmModeSink implements GLEventListener { boolean quit = false; diff --git a/src/demos/es1/cubefbo/Main.java b/src/demos/es1/cubefbo/Main.java index e95be25..4b23513 100755 --- a/src/demos/es1/cubefbo/Main.java +++ b/src/demos/es1/cubefbo/Main.java @@ -1,10 +1,9 @@ package demos.es1.cubefbo; -import java.nio.*; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class Main implements WindowListener, MouseListener { diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java index 0e7a27c..59dec30 100755 --- a/src/demos/es2/RedSquare.java +++ b/src/demos/es2/RedSquare.java @@ -8,8 +8,8 @@ import javax.media.nativewindow.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class RedSquare extends Thread implements WindowListener, KeyListener, MouseListener, GLEventListener { diff --git a/src/demos/es2/openmax/Cube.java b/src/demos/es2/openmax/Cube.java index 2337d16..49c8a31 100644 --- a/src/demos/es2/openmax/Cube.java +++ b/src/demos/es2/openmax/Cube.java @@ -39,8 +39,8 @@ import javax.media.nativewindow.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.fixedfunc.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class Cube implements GLEventListener { boolean quit = false; diff --git a/src/demos/es2/openmax/MovieCube.java b/src/demos/es2/openmax/MovieCube.java index c8ac4cc..f59bea2 100755 --- a/src/demos/es2/openmax/MovieCube.java +++ b/src/demos/es2/openmax/MovieCube.java @@ -40,11 +40,10 @@ import com.jogamp.opengl.util.glsl.fixedfunc.*; import com.jogamp.openmax.*; -import java.nio.*; import java.net.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class MovieCube implements MouseListener, GLEventListener, OMXEventListener { GLWindow window; diff --git a/src/demos/es2/openmax/MovieSimple.java b/src/demos/es2/openmax/MovieSimple.java index 13d09fe..b702699 100755 --- a/src/demos/es2/openmax/MovieSimple.java +++ b/src/demos/es2/openmax/MovieSimple.java @@ -44,8 +44,8 @@ import com.jogamp.openmax.*; import java.nio.*; import java.net.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class MovieSimple implements MouseListener, GLEventListener, OMXEventListener { private GLWindow window; diff --git a/src/demos/es2/perftst/PerfTextLoad.java b/src/demos/es2/perftst/PerfTextLoad.java index a08f4d9..30f0ad7 100755 --- a/src/demos/es2/perftst/PerfTextLoad.java +++ b/src/demos/es2/perftst/PerfTextLoad.java @@ -7,8 +7,8 @@ import javax.media.opengl.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.texture.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class PerfTextLoad extends PerfModule { static final int MAX_TEXTURE_ENGINES = 8; diff --git a/src/demos/es2/perftst/PerfUniLoad.java b/src/demos/es2/perftst/PerfUniLoad.java index b2af9cb..7cf32a2 100755 --- a/src/demos/es2/perftst/PerfUniLoad.java +++ b/src/demos/es2/perftst/PerfUniLoad.java @@ -4,8 +4,6 @@ import java.nio.*; import javax.media.opengl.*; import com.jogamp.opengl.util.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; public class PerfUniLoad extends PerfModule { static final int MAX_ARRAYS = 12; diff --git a/src/demos/es2/perftst/PerfVBOLoad.java b/src/demos/es2/perftst/PerfVBOLoad.java index 5563ea8..d0b4a1d 100755 --- a/src/demos/es2/perftst/PerfVBOLoad.java +++ b/src/demos/es2/perftst/PerfVBOLoad.java @@ -4,8 +4,6 @@ import java.nio.*; import javax.media.opengl.*; import com.jogamp.opengl.util.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; public class PerfVBOLoad extends PerfModule { diff --git a/src/demos/es2/perftst/Perftst.java b/src/demos/es2/perftst/Perftst.java index b0b8cdc..5b090cd 100755 --- a/src/demos/es2/perftst/Perftst.java +++ b/src/demos/es2/perftst/Perftst.java @@ -1,14 +1,13 @@ package demos.es2.perftst; -import java.nio.*; import javax.media.opengl.*; import javax.media.nativewindow.*; import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class Perftst implements MouseListener, GLEventListener { diff --git a/src/demos/newt/NEWTTest1.java b/src/demos/newt/NEWTTest1.java index 37ed038..59f6051 100644 --- a/src/demos/newt/NEWTTest1.java +++ b/src/demos/newt/NEWTTest1.java @@ -1,7 +1,7 @@ package demos.newt; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; +import com.jogamp.newt.*; public class NEWTTest1 implements WindowListener, KeyListener, MouseListener { diff --git a/src/demos/newt/TaskManagerTest1.java b/src/demos/newt/TaskManagerTest1.java index 3dd7ffd..5743537 100644 --- a/src/demos/newt/TaskManagerTest1.java +++ b/src/demos/newt/TaskManagerTest1.java @@ -1,7 +1,7 @@ package demos.newt; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; +import com.jogamp.newt.*; import demos.newt.util.TaskManager; public class TaskManagerTest1 implements WindowListener, KeyListener, MouseListener diff --git a/src/demos/newt/TaskManagerTest2.java b/src/demos/newt/TaskManagerTest2.java index 160651c..62a9cee 100644 --- a/src/demos/newt/TaskManagerTest2.java +++ b/src/demos/newt/TaskManagerTest2.java @@ -1,7 +1,7 @@ package demos.newt; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; +import com.jogamp.newt.*; import demos.newt.util.TaskToolWM; public class TaskManagerTest2 implements WindowListener, KeyListener, MouseListener diff --git a/src/demos/newt/util/TaskToolWM.java b/src/demos/newt/util/TaskToolWM.java index 2f312f6..6ecdaff 100644 --- a/src/demos/newt/util/TaskToolWM.java +++ b/src/demos/newt/util/TaskToolWM.java @@ -38,8 +38,7 @@ package demos.newt.util; import java.util.*; -import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; +import com.jogamp.newt.*; public class TaskToolWM { final static boolean externalStimuli; diff --git a/src/demos/readbuffer/Main.java b/src/demos/readbuffer/Main.java index 0757230..c6ecefa 100755 --- a/src/demos/readbuffer/Main.java +++ b/src/demos/readbuffer/Main.java @@ -1,11 +1,10 @@ package demos.readbuffer; import java.lang.reflect.*; -import java.nio.*; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.jogamp.javafx.newt.*; -import com.jogamp.javafx.newt.opengl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; public class Main implements WindowListener, MouseListener, SurfaceUpdatedListener { diff --git a/src/jbullet/src/javabullet/demos/opengl/DemoApplication.java b/src/jbullet/src/javabullet/demos/opengl/DemoApplication.java index 8ce5777..ec58929 100644 --- a/src/jbullet/src/javabullet/demos/opengl/DemoApplication.java +++ b/src/jbullet/src/javabullet/demos/opengl/DemoApplication.java @@ -48,7 +48,7 @@ import javax.media.opengl.*; import javax.media.opengl.glu.*; import java.nio.*; -import com.jogamp.javafx.newt.*; +import com.jogamp.newt.*; /** * diff --git a/src/jbullet/src/javabullet/demos/opengl/JOGL.java b/src/jbullet/src/javabullet/demos/opengl/JOGL.java index 723cf16..aeececb 100644 --- a/src/jbullet/src/javabullet/demos/opengl/JOGL.java +++ b/src/jbullet/src/javabullet/demos/opengl/JOGL.java @@ -23,7 +23,7 @@ package javabullet.demos.opengl; -import com.jogamp.javafx.newt.*; +import com.jogamp.newt.*; import javax.media.nativewindow.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; -- cgit v1.2.3 From 0b708395a18eb6a2ae5372ff414bc75830ce19b6 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Mon, 29 Mar 2010 15:38:31 +0200 Subject: modifications due to refactorings in gluegen and jogl. --- make/build.xml | 3 + .../runtime_ogl_vertex_fragment.java | 8 +- src/demos/cubefbo/CubeObject.java | 15 +- src/demos/es1/RedSquare.java | 5 +- src/demos/es1/angeles/AngelesES1.java | 29 +-- src/demos/es1/angeles/AngelesGL.java | 32 +-- src/demos/es1/angeles/AngelesGLil.java | 24 +- src/demos/es1/cube/Cube.java | 20 +- src/demos/es1/cube/CubeImmModeSink.java | 9 +- src/demos/es2/openmax/Cube.java | 20 +- src/demos/es2/perftst/PerfUniLoad.java | 5 +- src/demos/misc/Picking.java | 4 +- src/demos/proceduralTexturePhysics/Water.java | 3 - src/demos/readbuffer/ReadBuffer2Screen.java | 4 - src/demos/readbuffer/ReadBufferBase.java | 5 - src/demos/readbuffer/ReadBufferUtil.java | 4 +- src/demos/readbuffer/Surface2File.java | 3 - src/demos/util/ObjReader.java | 6 +- .../vertexBufferObject/VertexBufferObject.java | 11 +- src/demos/vertexProgRefract/VertexProgRefract.java | 1 - src/demos/vertexProgWarp/VertexProgWarp.java | 2 +- src/jbullet/src/javabullet/demos/opengl/GLSRT.java | 2 +- src/redbook/nbproject/build-impl.xml | 246 ++++++++++++++------- src/redbook/nbproject/genfiles.properties | 4 +- src/redbook/src/glredbook10/bezcurve.java | 6 +- src/redbook/src/glredbook10/bezmesh.java | 6 +- src/redbook/src/glredbook10/bezsurf.java | 6 +- src/redbook/src/glredbook10/checker.java | 2 +- src/redbook/src/glredbook10/checker2.java | 2 +- src/redbook/src/glredbook10/chess.java | 2 +- src/redbook/src/glredbook10/feedback.java | 2 +- src/redbook/src/glredbook10/font.java | 4 +- src/redbook/src/glredbook10/mipmap.java | 19 +- src/redbook/src/glredbook10/pickdepth.java | 2 +- src/redbook/src/glredbook10/pickline.java | 2 +- src/redbook/src/glredbook10/picksquare.java | 2 +- src/redbook/src/glredbook10/select.java | 2 +- src/redbook/src/glredbook10/stroke.java | 2 +- src/redbook/src/glredbook10/texgen.java | 5 +- src/redbook/src/glredbook10/texturesurf.java | 36 ++- src/redbook/src/glredbook11/image.java | 4 +- src/redbook/src/glredbook11/texbind.java | 6 +- src/redbook/src/glredbook11/texgen.java | 8 +- src/redbook/src/glredbook11/texsub.java | 6 +- src/redbook/src/glredbook11/varray.java | 10 +- src/redbook/src/glredbook11/wrap.java | 4 +- src/redbook/src/glredbook12x/colormatrix.java | 4 +- src/redbook/src/glredbook12x/colortable.java | 6 +- src/redbook/src/glredbook12x/convolution.java | 14 +- src/redbook/src/glredbook12x/histogram.java | 6 +- src/redbook/src/glredbook12x/minmax.java | 6 +- src/redbook/src/glredbook12x/multitex.java | 6 +- src/redbook/src/glredbook12x/texture3d.java | 4 +- src/redbook/src/glredbook1314/combiner.java | 6 +- src/redbook/src/glredbook1314/cubemap.java | 12 +- src/redbook/src/glredbook1314/mvarray.java | 8 +- src/redbook/src/glredbook1314/shadowmap.java | 6 +- 57 files changed, 365 insertions(+), 316 deletions(-) (limited to 'src/demos/es2') diff --git a/make/build.xml b/make/build.xml index c41b605..6ff868d 100644 --- a/make/build.xml +++ b/make/build.xml @@ -73,6 +73,7 @@ + @@ -158,6 +159,7 @@ + @@ -230,6 +232,7 @@ + diff --git a/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java b/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java index f33168f..b550324 100644 --- a/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java +++ b/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java @@ -333,9 +333,9 @@ public class runtime_ogl_vertex_fragment implements GLEventListener if (P == null) { int u, v; - P = BufferUtil.newFloatBuffer(3*nVerts); - N = BufferUtil.newFloatBuffer(3*nVerts); - uv = BufferUtil.newFloatBuffer(2*nVerts); + P = GLBuffers.newDirectFloatBuffer(3*nVerts); + N = GLBuffers.newDirectFloatBuffer(3*nVerts); + uv = GLBuffers.newDirectFloatBuffer(2*nVerts); // Fill in the position, normal, and texture coordinate arrays. // Just loop over all of the vertices, compute their parametreic @@ -358,7 +358,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener } // Now fill in the vertex index arrays - indices = BufferUtil.newIntBuffer(3*nTris); + indices = GLBuffers.newDirectIntBuffer(3*nTris); int ip = 0; for (v = 0; v < nv-1; ++v) { for (u = 0; u < nu-1; ++u) { diff --git a/src/demos/cubefbo/CubeObject.java b/src/demos/cubefbo/CubeObject.java index bf3f8bc..dd3da91 100755 --- a/src/demos/cubefbo/CubeObject.java +++ b/src/demos/cubefbo/CubeObject.java @@ -33,34 +33,35 @@ package demos.cubefbo; +import com.jogamp.gluegen.runtime.Buffers; import java.nio.ByteBuffer; import java.nio.ShortBuffer; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; -import com.jogamp.opengl.util.BufferUtil; class CubeObject { - public CubeObject (boolean useTexCoords) { + + CubeObject (boolean useTexCoords) { // Initialize data Buffers - this.cubeVertices = BufferUtil.newShortBuffer(s_cubeVertices.length); + this.cubeVertices = Buffers.newDirectShortBuffer(s_cubeVertices.length); cubeVertices.put(s_cubeVertices); cubeVertices.rewind(); - this.cubeColors = BufferUtil.newByteBuffer(s_cubeColors.length); + this.cubeColors = Buffers.newDirectByteBuffer(s_cubeColors.length); cubeColors.put(s_cubeColors); cubeColors.rewind(); - this.cubeNormals = BufferUtil.newByteBuffer(s_cubeNormals.length); + this.cubeNormals = Buffers.newDirectByteBuffer(s_cubeNormals.length); cubeNormals.put(s_cubeNormals); cubeNormals.rewind(); - this.cubeIndices = BufferUtil.newByteBuffer(s_cubeIndices.length); + this.cubeIndices = Buffers.newDirectByteBuffer(s_cubeIndices.length); cubeIndices.put(s_cubeIndices); cubeIndices.rewind(); if (useTexCoords) { - this.cubeTexCoords = BufferUtil.newShortBuffer(s_cubeTexCoords.length); + this.cubeTexCoords = Buffers.newDirectShortBuffer(s_cubeTexCoords.length); cubeTexCoords.put(s_cubeTexCoords); cubeTexCoords.rewind(); } diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java index d391442..4741258 100755 --- a/src/demos/es1/RedSquare.java +++ b/src/demos/es1/RedSquare.java @@ -1,5 +1,6 @@ package demos.es1; +import com.jogamp.gluegen.runtime.Buffers; import java.nio.*; import java.util.*; import javax.media.opengl.*; @@ -241,8 +242,8 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo System.err.println(Thread.currentThread()+" GLU: " + glu); // Allocate vertex arrays - colors = BufferUtil.newFloatBuffer(16); - vertices = BufferUtil.newFloatBuffer(12); + colors = Buffers.newDirectFloatBuffer(16); + vertices = Buffers.newDirectFloatBuffer(12); // Fill them up colors.put( 0, 1); colors.put( 1, 0); colors.put( 2, 0); colors.put( 3, 1); colors.put( 4, 0); colors.put( 5, 0); colors.put( 6, 1); colors.put( 7, 1); diff --git a/src/demos/es1/angeles/AngelesES1.java b/src/demos/es1/angeles/AngelesES1.java index edba727..6c868c4 100755 --- a/src/demos/es1/angeles/AngelesES1.java +++ b/src/demos/es1/angeles/AngelesES1.java @@ -24,6 +24,7 @@ package demos.es1.angeles; +import com.jogamp.gluegen.runtime.Buffers; import javax.media.opengl.*; import javax.media.opengl.glu.*; import com.jogamp.opengl.util.*; @@ -37,7 +38,7 @@ public class AngelesES1 implements GLEventListener { public AngelesES1(boolean enableBlending) { blendingEnabled = enableBlending; - quadVertices = BufferUtil.newIntBuffer(12); + quadVertices = Buffers.newDirectIntBuffer(12); quadVertices.put(new int[]{ -0x10000, -0x10000, 0x10000, -0x10000, @@ -48,13 +49,13 @@ public class AngelesES1 implements GLEventListener { }); quadVertices.flip(); - light0Position=BufferUtil.newIntBuffer(4); - light0Diffuse=BufferUtil.newIntBuffer(4); - light1Position=BufferUtil.newIntBuffer(4); - light1Diffuse=BufferUtil.newIntBuffer(4); - light2Position=BufferUtil.newIntBuffer(4); - light2Diffuse=BufferUtil.newIntBuffer(4); - materialSpecular=BufferUtil.newIntBuffer(4); + light0Position=Buffers.newDirectIntBuffer(4); + light0Diffuse=Buffers.newDirectIntBuffer(4); + light1Position=Buffers.newDirectIntBuffer(4); + light1Diffuse=Buffers.newDirectIntBuffer(4); + light2Position=Buffers.newDirectIntBuffer(4); + light2Diffuse=Buffers.newDirectIntBuffer(4); + materialSpecular=Buffers.newDirectIntBuffer(4); light0Position.put(new int[] { -0x40000, 0x10000, 0x10000, 0 }); light0Diffuse.put(new int[] { 0x10000, 0x6666, 0, 0x10000 }); @@ -245,11 +246,11 @@ public class GLObject { boolean useNormalArray) { this.count = vertices; this.vertexComponents = vertexComponents; - this.vertexArray = BufferUtil.newIntBuffer( vertices * vertexComponents ); - this.colorArray = BufferUtil.newByteBuffer (vertices * 4 ); + this.vertexArray = Buffers.newDirectIntBuffer( vertices * vertexComponents ); + this.colorArray = Buffers.newDirectByteBuffer (vertices * 4 ); if (useNormalArray) { - this.normalArray = BufferUtil.newIntBuffer (vertices * 3 ); + this.normalArray = Buffers.newDirectIntBuffer (vertices * 3 ); } else { this.normalArray = null; } @@ -262,18 +263,18 @@ public class GLObject { gl.glGenBuffers(3, vbo, 0); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo[0]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, vertexArray.capacity() * BufferUtil.SIZEOF_INT, vertexArray, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, vertexArray.capacity() * Buffers.SIZEOF_INT, vertexArray, GL.GL_STATIC_DRAW); gl.glVertexPointer(vertexComponents, gl.GL_FIXED, 0, 0); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo[1]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, colorArray.capacity() * BufferUtil.SIZEOF_BYTE, colorArray, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, colorArray.capacity() * Buffers.SIZEOF_BYTE, colorArray, GL.GL_STATIC_DRAW); gl.glColorPointer(4, gl.GL_UNSIGNED_BYTE, 0, 0); if (null!=normalArray) { gl.glEnableClientState(gl.GL_NORMAL_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo[2]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, normalArray.capacity() * BufferUtil.SIZEOF_INT, normalArray, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, normalArray.capacity() * Buffers.SIZEOF_INT, normalArray, GL.GL_STATIC_DRAW); gl.glNormalPointer(gl.GL_FIXED, 0, 0); } else { gl.glDisableClientState(gl.GL_NORMAL_ARRAY); diff --git a/src/demos/es1/angeles/AngelesGL.java b/src/demos/es1/angeles/AngelesGL.java index afcc356..bc367d7 100755 --- a/src/demos/es1/angeles/AngelesGL.java +++ b/src/demos/es1/angeles/AngelesGL.java @@ -38,7 +38,7 @@ public class AngelesGL implements GLEventListener { public AngelesGL(boolean enableBlending) { blendingEnabled = enableBlending; - quadVertices = BufferUtil.newFloatBuffer(12); + quadVertices = GLBuffers.newDirectFloatBuffer(12); quadVertices.put(new float[]{ -1.0f, -1.0f, 1.0f, -1.0f, @@ -49,13 +49,13 @@ public class AngelesGL implements GLEventListener { }); quadVertices.flip(); - light0Position=BufferUtil.newFloatBuffer(4); - light0Diffuse=BufferUtil.newFloatBuffer(4); - light1Position=BufferUtil.newFloatBuffer(4); - light1Diffuse=BufferUtil.newFloatBuffer(4); - light2Position=BufferUtil.newFloatBuffer(4); - light2Diffuse=BufferUtil.newFloatBuffer(4); - materialSpecular=BufferUtil.newFloatBuffer(4); + light0Position=GLBuffers.newDirectFloatBuffer(4); + light0Diffuse=GLBuffers.newDirectFloatBuffer(4); + light1Position=GLBuffers.newDirectFloatBuffer(4); + light1Diffuse=GLBuffers.newDirectFloatBuffer(4); + light2Position=GLBuffers.newDirectFloatBuffer(4); + light2Diffuse=GLBuffers.newDirectFloatBuffer(4); + materialSpecular=GLBuffers.newDirectFloatBuffer(4); light0Position.put(new float[] { FixedPoint.toFloat(-0x40000), 1.0f, 1.0f, 0.0f }); light0Diffuse.put(new float[] { 1.0f, FixedPoint.toFloat(0x6666), 0.0f, 1.0f }); @@ -271,24 +271,24 @@ public class GLSpatial { vComps= vertexComponents; nComps = useNormalArray ? 3 : 0; - int bSize = BufferUtil.sizeOfGLType(GL.GL_FLOAT) * count * ( vComps + cComps + nComps) ; - pBuffer = BufferUtil.newByteBuffer(bSize); + int bSize = GLBuffers.sizeOfGLType(GL.GL_FLOAT) * count * ( vComps + cComps + nComps) ; + pBuffer = GLBuffers.newDirectByteBuffer(bSize); int pos = 0; - int size= BufferUtil.sizeOfGLType(GL.GL_FLOAT) * count * vComps ; - vertexArray = (FloatBuffer) BufferUtil.sliceGLBuffer(pBuffer, pos, size, GL.GL_FLOAT); + int size= GLBuffers.sizeOfGLType(GL.GL_FLOAT) * count * vComps ; + vertexArray = (FloatBuffer) GLBuffers.sliceGLBuffer(pBuffer, pos, size, GL.GL_FLOAT); int vOffset = 0; pos+=size; - size=BufferUtil.sizeOfGLType(GL.GL_FLOAT) * count * cComps ; - colorArray = (FloatBuffer) BufferUtil.sliceGLBuffer(pBuffer, pos, size, GL.GL_FLOAT); + size=GLBuffers.sizeOfGLType(GL.GL_FLOAT) * count * cComps ; + colorArray = (FloatBuffer) GLBuffers.sliceGLBuffer(pBuffer, pos, size, GL.GL_FLOAT); int cOffset=pos; pos+=size; int nOffset=0; if(useNormalArray) { - size=BufferUtil.sizeOfGLType(GL.GL_FLOAT) * count * nComps ; - normalArray = (FloatBuffer) BufferUtil.sliceGLBuffer(pBuffer, pos, size, GL.GL_FLOAT); + size=GLBuffers.sizeOfGLType(GL.GL_FLOAT) * count * nComps ; + normalArray = (FloatBuffer) GLBuffers.sliceGLBuffer(pBuffer, pos, size, GL.GL_FLOAT); nOffset=pos; pos+=size; } diff --git a/src/demos/es1/angeles/AngelesGLil.java b/src/demos/es1/angeles/AngelesGLil.java index bbfb86a..92be109 100755 --- a/src/demos/es1/angeles/AngelesGLil.java +++ b/src/demos/es1/angeles/AngelesGLil.java @@ -34,7 +34,7 @@ public class AngelesGLil implements GLEventListener { public AngelesGLil(boolean enableBlending) { blendingEnabled = enableBlending; - quadVertices = BufferUtil.newFloatBuffer(12); + quadVertices = GLBuffers.newDirectFloatBuffer(12); quadVertices.put(new float[]{ -1.0f, -1.0f, 1.0f, -1.0f, @@ -45,13 +45,13 @@ public class AngelesGLil implements GLEventListener { }); quadVertices.flip(); - light0Position=BufferUtil.newFloatBuffer(4); - light0Diffuse=BufferUtil.newFloatBuffer(4); - light1Position=BufferUtil.newFloatBuffer(4); - light1Diffuse=BufferUtil.newFloatBuffer(4); - light2Position=BufferUtil.newFloatBuffer(4); - light2Diffuse=BufferUtil.newFloatBuffer(4); - materialSpecular=BufferUtil.newFloatBuffer(4); + light0Position=GLBuffers.newDirectFloatBuffer(4); + light0Diffuse=GLBuffers.newDirectFloatBuffer(4); + light1Position=GLBuffers.newDirectFloatBuffer(4); + light1Diffuse=GLBuffers.newDirectFloatBuffer(4); + light2Position=GLBuffers.newDirectFloatBuffer(4); + light2Diffuse=GLBuffers.newDirectFloatBuffer(4); + materialSpecular=GLBuffers.newDirectFloatBuffer(4); light0Position.put(new float[] { FixedPoint.toFloat(-0x40000), 1.0f, 1.0f, 0.0f }); light0Diffuse.put(new float[] { 1.0f, FixedPoint.toFloat(0x6666), 0.0f, 1.0f }); @@ -277,15 +277,15 @@ public class GLSpatial { vComps= vertexComponents; nComps = useNormalArray ? 3 : 0; - int bStride = BufferUtil.sizeOfGLType(GL.GL_FLOAT) * ( vComps + cComps + nComps ); + int bStride = GLBuffers.sizeOfGLType(GL.GL_FLOAT) * ( vComps + cComps + nComps ); int bSize = count * bStride; - pBuffer = BufferUtil.newByteBuffer(bSize); + pBuffer = GLBuffers.newDirectByteBuffer(bSize); interlArray = pBuffer.asFloatBuffer(); int vOffset = 0; - int cOffset = BufferUtil.sizeOfGLType(GL.GL_FLOAT) * (vComps); - int nOffset = BufferUtil.sizeOfGLType(GL.GL_FLOAT) * (vComps + cComps); + int cOffset = GLBuffers.sizeOfGLType(GL.GL_FLOAT) * (vComps); + int nOffset = GLBuffers.sizeOfGLType(GL.GL_FLOAT) * (vComps + cComps); int[] tmp = new int[1]; gl.glGenBuffers(1, tmp, 0); diff --git a/src/demos/es1/cube/Cube.java b/src/demos/es1/cube/Cube.java index 198bba8..d2a3277 100644 --- a/src/demos/es1/cube/Cube.java +++ b/src/demos/es1/cube/Cube.java @@ -31,12 +31,12 @@ */ package demos.es1.cube; +import com.jogamp.gluegen.runtime.Buffers; import java.nio.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; import javax.media.nativewindow.*; -import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.fixedfunc.*; import com.jogamp.newt.*; @@ -55,24 +55,24 @@ public class Cube implements GLEventListener { this.innerCube = innerCube; // Initialize data Buffers - this.cubeVertices = BufferUtil.newShortBuffer(s_cubeVertices.length); + this.cubeVertices = Buffers.newDirectShortBuffer(s_cubeVertices.length); cubeVertices.put(s_cubeVertices); cubeVertices.flip(); - this.cubeColors = BufferUtil.newFloatBuffer(s_cubeColors.length); + this.cubeColors = Buffers.newDirectFloatBuffer(s_cubeColors.length); cubeColors.put(s_cubeColors); cubeColors.flip(); - this.cubeNormals = BufferUtil.newByteBuffer(s_cubeNormals.length); + this.cubeNormals = Buffers.newDirectByteBuffer(s_cubeNormals.length); cubeNormals.put(s_cubeNormals); cubeNormals.flip(); - this.cubeIndices = BufferUtil.newByteBuffer(s_cubeIndices.length); + this.cubeIndices = Buffers.newDirectByteBuffer(s_cubeIndices.length); cubeIndices.put(s_cubeIndices); cubeIndices.flip(); if (useTexCoords) { - this.cubeTexCoords = BufferUtil.newShortBuffer(s_cubeTexCoords.length); + this.cubeTexCoords = Buffers.newDirectShortBuffer(s_cubeTexCoords.length); cubeTexCoords.put(s_cubeTexCoords); cubeTexCoords.flip(); } @@ -153,23 +153,23 @@ public class Cube implements GLEventListener { gl.glEnableClientState(gl.GL_VERTEX_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[0]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeVertices.limit() * BufferUtil.SIZEOF_SHORT, cubeVertices, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeVertices.limit() * Buffers.SIZEOF_SHORT, cubeVertices, GL.GL_STATIC_DRAW); gl.glVertexPointer(3, gl.GL_SHORT, 0, 0); gl.glEnableClientState(gl.GL_NORMAL_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[1]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeNormals.limit() * BufferUtil.SIZEOF_BYTE, cubeNormals, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeNormals.limit() * Buffers.SIZEOF_BYTE, cubeNormals, GL.GL_STATIC_DRAW); gl.glNormalPointer(gl.GL_BYTE, 0, 0); gl.glEnableClientState(gl.GL_COLOR_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[2]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeColors.limit() * BufferUtil.SIZEOF_FLOAT, cubeColors, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeColors.limit() * Buffers.SIZEOF_FLOAT, cubeColors, GL.GL_STATIC_DRAW); gl.glColorPointer(4, gl.GL_FLOAT, 0, 0); if (cubeTexCoords != null) { gl.glEnableClientState(gl.GL_TEXTURE_COORD_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[3]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeTexCoords.limit() * BufferUtil.SIZEOF_SHORT, cubeTexCoords, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeTexCoords.limit() * Buffers.SIZEOF_SHORT, cubeTexCoords, GL.GL_STATIC_DRAW); gl.glTexCoordPointer(2, gl.GL_SHORT, 0, 0); /* issues an GL_INVALID_ENUM gl.glTexEnvi(gl.GL_TEXTURE_ENV, gl.GL_TEXTURE_ENV_MODE, gl.GL_INCR); diff --git a/src/demos/es1/cube/CubeImmModeSink.java b/src/demos/es1/cube/CubeImmModeSink.java index fccbb5a..e91a595 100644 --- a/src/demos/es1/cube/CubeImmModeSink.java +++ b/src/demos/es1/cube/CubeImmModeSink.java @@ -31,6 +31,7 @@ */ package demos.es1.cube; +import com.jogamp.gluegen.runtime.Buffers; import javax.media.opengl.*; import javax.media.opengl.glu.*; import javax.media.nativewindow.*; @@ -54,7 +55,7 @@ public class CubeImmModeSink implements GLEventListener { ImmModeSink vboCubeF = null; public void drawCube(GL2ES1 gl, float extent) { if(cubeIndices==null) { - cubeIndices = BufferUtil.newByteBuffer(s_cubeIndices); + cubeIndices = Buffers.newDirectByteBuffer(s_cubeIndices); } if(vboCubeF==null) { @@ -66,9 +67,9 @@ public class CubeImmModeSink implements GLEventListener { vbo.glBegin(GL.GL_TRIANGLES); - vbo.glVertexv(BufferUtil.newShortBuffer(s_cubeVertices)); - vbo.glColorv(BufferUtil.newFloatBuffer(s_cubeColors)); - vbo.glNormalv(BufferUtil.newByteBuffer(s_cubeNormals)); + vbo.glVertexv(Buffers.newDirectShortBuffer(s_cubeVertices)); + vbo.glColorv(Buffers.newDirectFloatBuffer(s_cubeColors)); + vbo.glNormalv(Buffers.newDirectByteBuffer(s_cubeNormals)); if(VBO_CACHE) { vbo.glEnd(gl, false); diff --git a/src/demos/es2/openmax/Cube.java b/src/demos/es2/openmax/Cube.java index 49c8a31..aa4b8dd 100644 --- a/src/demos/es2/openmax/Cube.java +++ b/src/demos/es2/openmax/Cube.java @@ -31,12 +31,12 @@ */ package demos.es2.openmax; +import com.jogamp.gluegen.runtime.Buffers; import java.nio.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; import javax.media.nativewindow.*; -import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.fixedfunc.*; import com.jogamp.newt.*; @@ -53,19 +53,19 @@ public class Cube implements GLEventListener { this.innerCube = innerCube; // Initialize data Buffers - this.cubeVertices = BufferUtil.newShortBuffer(s_cubeVertices.length); + this.cubeVertices = Buffers.newDirectShortBuffer(s_cubeVertices.length); cubeVertices.put(s_cubeVertices); cubeVertices.flip(); - this.cubeColors = BufferUtil.newFloatBuffer(s_cubeColors.length); + this.cubeColors = Buffers.newDirectFloatBuffer(s_cubeColors.length); cubeColors.put(s_cubeColors); cubeColors.flip(); - this.cubeNormals = BufferUtil.newByteBuffer(s_cubeNormals.length); + this.cubeNormals = Buffers.newDirectByteBuffer(s_cubeNormals.length); cubeNormals.put(s_cubeNormals); cubeNormals.flip(); - this.cubeIndices = BufferUtil.newByteBuffer(s_cubeIndices.length); + this.cubeIndices = Buffers.newDirectByteBuffer(s_cubeIndices.length); cubeIndices.put(s_cubeIndices); cubeIndices.flip(); @@ -86,7 +86,7 @@ public class Cube implements GLEventListener { } } - this.cubeTexCoords = BufferUtil.newFloatBuffer(s_cubeTexCoords.length); + this.cubeTexCoords = Buffers.newDirectFloatBuffer(s_cubeTexCoords.length); cubeTexCoords.put(s_cubeTexCoords); cubeTexCoords.flip(); } @@ -151,26 +151,26 @@ public class Cube implements GLEventListener { gl.glEnableClientState(gl.GL_VERTEX_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[0]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeVertices.limit() * BufferUtil.SIZEOF_SHORT, cubeVertices, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeVertices.limit() * Buffers.SIZEOF_SHORT, cubeVertices, GL.GL_STATIC_DRAW); gl.glVertexPointer(3, gl.GL_SHORT, 0, 0); gl.glEnableClientState(gl.GL_NORMAL_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[1]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeNormals.limit() * BufferUtil.SIZEOF_BYTE, cubeNormals, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeNormals.limit() * Buffers.SIZEOF_BYTE, cubeNormals, GL.GL_STATIC_DRAW); gl.glNormalPointer(gl.GL_BYTE, 0, 0); gl.glEnableClientState(gl.GL_COLOR_ARRAY); if (cubeColors != null) { gl.glEnableClientState(gl.GL_COLOR_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[2]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeColors.limit() * BufferUtil.SIZEOF_FLOAT, cubeColors, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeColors.limit() * Buffers.SIZEOF_FLOAT, cubeColors, GL.GL_STATIC_DRAW); gl.glColorPointer(4, gl.GL_FLOAT, 0, 0); } if (cubeTexCoords != null) { gl.glEnableClientState(gl.GL_TEXTURE_COORD_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[3]); - gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeTexCoords.limit() * BufferUtil.SIZEOF_SHORT, cubeTexCoords, GL.GL_STATIC_DRAW); + gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeTexCoords.limit() * Buffers.SIZEOF_SHORT, cubeTexCoords, GL.GL_STATIC_DRAW); gl.glTexCoordPointer(2, gl.GL_SHORT, 0, 0); gl.glTexEnvi(gl.GL_TEXTURE_ENV, gl.GL_TEXTURE_ENV_MODE, gl.GL_INCR); } else { diff --git a/src/demos/es2/perftst/PerfUniLoad.java b/src/demos/es2/perftst/PerfUniLoad.java index 7cf32a2..170bf1a 100755 --- a/src/demos/es2/perftst/PerfUniLoad.java +++ b/src/demos/es2/perftst/PerfUniLoad.java @@ -1,5 +1,6 @@ package demos.es2.perftst; +import com.jogamp.gluegen.runtime.Buffers; import java.nio.*; import javax.media.opengl.*; import com.jogamp.opengl.util.*; @@ -65,7 +66,7 @@ public class PerfUniLoad extends PerfModule { float x=0f, y=0f, z=0f, w=0f; for(int i=0; ireadPixelSizeLast) { - readPixelBuffer = BufferUtil.newGLBuffer(gl.GL_UNSIGNED_BYTE, readPixelSize); + readPixelBuffer = GLBuffers.newDirectGLBuffer(GL.GL_UNSIGNED_BYTE, readPixelSize); readPixelSizeLast = readPixelSize ; try { readTextureData = new TextureData( diff --git a/src/demos/readbuffer/Surface2File.java b/src/demos/readbuffer/Surface2File.java index ec41039..74fa637 100755 --- a/src/demos/readbuffer/Surface2File.java +++ b/src/demos/readbuffer/Surface2File.java @@ -33,12 +33,9 @@ package demos.readbuffer; -import java.nio.*; import javax.media.opengl.*; -import com.jogamp.opengl.util.texture.TextureData; import com.jogamp.opengl.util.texture.TextureIO; -import com.jogamp.opengl.util.BufferUtil; import java.io.File; import java.io.IOException; diff --git a/src/demos/util/ObjReader.java b/src/demos/util/ObjReader.java index b78baf0..718e96e 100644 --- a/src/demos/util/ObjReader.java +++ b/src/demos/util/ObjReader.java @@ -39,6 +39,7 @@ package demos.util; +import com.jogamp.gluegen.runtime.Buffers; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; @@ -52,7 +53,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; -import com.jogamp.opengl.util.BufferUtil; @@ -321,10 +321,10 @@ public class ObjReader { newVertices.trim(); newVertexNormals.trim(); newIndices.trim(); - vertices = BufferUtil.newFloatBuffer(newVertices.size()); + vertices = Buffers.newDirectFloatBuffer(newVertices.size()); vertices.put(newVertices.getData()); vertices.rewind(); - normals = BufferUtil.newFloatBuffer(newVertexNormals.size()); + normals = Buffers.newDirectFloatBuffer(newVertexNormals.size()); normals.put(newVertexNormals.getData()); normals.rewind(); faceIndices = newIndices; diff --git a/src/demos/vertexBufferObject/VertexBufferObject.java b/src/demos/vertexBufferObject/VertexBufferObject.java index 9c8bb26..5252867 100644 --- a/src/demos/vertexBufferObject/VertexBufferObject.java +++ b/src/demos/vertexBufferObject/VertexBufferObject.java @@ -33,6 +33,7 @@ package demos.vertexBufferObject; +import com.jogamp.gluegen.runtime.Buffers; import demos.common.Demo; import demos.common.DemoListener; import java.awt.BorderLayout; @@ -48,7 +49,6 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; import javax.media.opengl.GL; import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLProfile; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; import javax.media.opengl.GLAutoDrawable; @@ -57,7 +57,6 @@ import javax.media.opengl.awt.AWTGLAutoDrawable; import javax.media.opengl.awt.GLCanvas; import javax.media.opengl.glu.GLU; import com.jogamp.opengl.util.Animator; -import com.jogamp.opengl.util.BufferUtil; import javax.swing.JOptionPane; @@ -374,8 +373,8 @@ public class VertexBufferObject extends Demo { buffers[i].vertices = sliceBuffer(bigArray, startIndex, sliceSize); buffers[i].normals = sliceBuffer(buffers[i].vertices, 3, buffers[i].vertices.limit() - 3); - buffers[i].vertexOffset = startIndex * BufferUtil.SIZEOF_FLOAT; - buffers[i].normalOffset = (startIndex + 3) * BufferUtil.SIZEOF_FLOAT; + buffers[i].vertexOffset = startIndex * Buffers.SIZEOF_FLOAT; + buffers[i].normalOffset = (startIndex + 3) * Buffers.SIZEOF_FLOAT; } } @@ -653,7 +652,7 @@ public class VertexBufferObject extends Demo { for (int i = 0; i < len; i++) { ++numDrawElementsCalls; gl.glDrawElements(primitive, 2 * STRIP_SIZE, GL2.GL_UNSIGNED_INT, - i * 2 * STRIP_SIZE * BufferUtil.SIZEOF_INT); + i * 2 * STRIP_SIZE * Buffers.SIZEOF_INT); if(getFlag('f')) { gl.glFlush(); } @@ -760,7 +759,7 @@ public class VertexBufferObject extends Demo { elementBufferObject = tmp[0]; gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, elementBufferObject); gl.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER, - linearElements.remaining() * BufferUtil.SIZEOF_INT, + linearElements.remaining() * Buffers.SIZEOF_INT, linearElements, GL.GL_STATIC_DRAW); gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0); diff --git a/src/demos/vertexProgRefract/VertexProgRefract.java b/src/demos/vertexProgRefract/VertexProgRefract.java index 54c0d5e..65b914c 100644 --- a/src/demos/vertexProgRefract/VertexProgRefract.java +++ b/src/demos/vertexProgRefract/VertexProgRefract.java @@ -58,7 +58,6 @@ import javax.media.opengl.*; import javax.media.opengl.awt.*; import javax.media.opengl.glu.GLU; import com.jogamp.opengl.util.Animator; -import com.jogamp.opengl.util.BufferUtil; import javax.swing.JOptionPane; diff --git a/src/demos/vertexProgWarp/VertexProgWarp.java b/src/demos/vertexProgWarp/VertexProgWarp.java index 6f917ed..e13656f 100644 --- a/src/demos/vertexProgWarp/VertexProgWarp.java +++ b/src/demos/vertexProgWarp/VertexProgWarp.java @@ -60,7 +60,7 @@ import javax.media.opengl.awt.GLCanvas; import javax.media.opengl.glu.GLU; import javax.media.opengl.glu.GLUquadric; import com.jogamp.opengl.util.Animator; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import javax.swing.JOptionPane; diff --git a/src/jbullet/src/javabullet/demos/opengl/GLSRT.java b/src/jbullet/src/javabullet/demos/opengl/GLSRT.java index cdd4aef..a147202 100644 --- a/src/jbullet/src/javabullet/demos/opengl/GLSRT.java +++ b/src/jbullet/src/javabullet/demos/opengl/GLSRT.java @@ -141,7 +141,7 @@ public class GLSRT { 16, 19, 17, 18, 16, 17, /* right */ 23, 20, 21, 20, 22, 21 /* left */ }; - private ByteBuffer cubeIndices=BufferUtil.newByteBuffer(s_cubeIndices); + private ByteBuffer cubeIndices=GLBuffers.newDirectByteBuffer(s_cubeIndices); //////////////////////////////////////////////////////////////////////////// diff --git a/src/redbook/nbproject/build-impl.xml b/src/redbook/nbproject/build-impl.xml index 71d5842..ecbb2fe 100644 --- a/src/redbook/nbproject/build-impl.xml +++ b/src/redbook/nbproject/build-impl.xml @@ -81,6 +81,7 @@ is divided into following sections: + @@ -109,23 +110,40 @@ is divided into following sections: - + - - + + - - - - - + + + + - - + + + + + + + + - - + + + + + + + + + + + + + + @@ -182,6 +200,8 @@ is divided into following sections: + + @@ -208,11 +228,53 @@ is divided into following sections: - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -237,6 +299,8 @@ is divided into following sections: + + @@ -384,14 +448,65 @@ is divided into following sections: + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -473,13 +594,13 @@ is divided into following sections: - + - + - + @@ -494,78 +615,35 @@ is divided into following sections: java -cp "${run.classpath.with.dist.jar}" ${main.class} - - - - - - - - - - - - - - - - - + + + + + + - - - + + + To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" - + - + @@ -669,7 +747,7 @@ is divided into following sections: - + @@ -686,7 +764,7 @@ is divided into following sections: Must select some files in the IDE or set javac.includes - + diff --git a/src/redbook/nbproject/genfiles.properties b/src/redbook/nbproject/genfiles.properties index 7e724ad..11539ee 100644 --- a/src/redbook/nbproject/genfiles.properties +++ b/src/redbook/nbproject/genfiles.properties @@ -1,5 +1,5 @@ # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=f7c0fcba -nbproject/build-impl.xml.script.CRC32=d690f492 -nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.32.1.45 +nbproject/build-impl.xml.script.CRC32=a7700f85 +nbproject/build-impl.xml.stylesheet.CRC32=c75ce636@1.36.0.45 diff --git a/src/redbook/src/glredbook10/bezcurve.java b/src/redbook/src/glredbook10/bezcurve.java index 2399d4f..7e9e67e 100644 --- a/src/redbook/src/glredbook10/bezcurve.java +++ b/src/redbook/src/glredbook10/bezcurve.java @@ -7,7 +7,7 @@ import java.nio.FloatBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import javax.media.opengl.awt.GLJPanel; @@ -23,7 +23,7 @@ public class bezcurve// { -2.0f, 4.0f, 0.0f }, { 2.0f, -4.0f, 0.0f }, { 4.0f, 4.0f, 0.0f } }; private FloatBuffer ctrlpointBuf; - // = BufferUtil.newFloatBuffer(ctrlpoints[0].length * ctrlpoints.length); + // = GLBuffers.newDirectFloatBuffer(ctrlpoints[0].length * ctrlpoints.length); @Override protected GLJPanel createDrawable() { @@ -55,7 +55,7 @@ public class bezcurve// public void init(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); // need to convert 2d array to buffer type - ctrlpointBuf = BufferUtil.newFloatBuffer(ctrlpoints[0].length + ctrlpointBuf = GLBuffers.newDirectFloatBuffer(ctrlpoints[0].length * ctrlpoints.length); for (int i = 0; i < ctrlpoints.length; i++) { ctrlpointBuf.put(ctrlpoints[i]); diff --git a/src/redbook/src/glredbook10/bezmesh.java b/src/redbook/src/glredbook10/bezmesh.java index 1dbc239..1dda4e0 100644 --- a/src/redbook/src/glredbook10/bezmesh.java +++ b/src/redbook/src/glredbook10/bezmesh.java @@ -6,7 +6,7 @@ import javax.swing.*; import java.nio.*; import javax.media.opengl.*; -import com.jogamp.opengl.util.*; +import com.jogamp.gluegen.runtime.Buffers; import javax.media.opengl.awt.GLJPanel; /** @@ -29,9 +29,7 @@ public class bezmesh// { { -1.5f, 1.5f, -2.0f }, { -0.5f, 1.5f, -2.0f }, { 0.5f, 1.5f, 0.0f }, { 1.5f, 1.5f, -1.0f } } }; // need float buffer instead of n-dimensional array above - private FloatBuffer ctrlpointsBuf = BufferUtil - .newFloatBuffer(ctrlpoints.length * ctrlpoints[0].length - * ctrlpoints[0][0].length); + private FloatBuffer ctrlpointsBuf = Buffers.newDirectFloatBuffer(ctrlpoints.length * ctrlpoints[0].length * ctrlpoints[0][0].length); {// SO copy 4x4x3 array above to float buffer for (int i = 0; i < ctrlpoints.length; i++) { // System.out.print(ctrlpoints.length+ " "); diff --git a/src/redbook/src/glredbook10/bezsurf.java b/src/redbook/src/glredbook10/bezsurf.java index 1503fd2..96faa8e 100644 --- a/src/redbook/src/glredbook10/bezsurf.java +++ b/src/redbook/src/glredbook10/bezsurf.java @@ -6,7 +6,7 @@ import javax.swing.*; import java.nio.*; import javax.media.opengl.*; -import com.jogamp.opengl.util.*; +import com.jogamp.gluegen.runtime.Buffers; import javax.media.opengl.awt.GLJPanel; /** @@ -29,9 +29,7 @@ public class bezsurf// { { -1.5f, 1.5f, -2.0f }, { -0.5f, 1.5f, -2.0f }, { 0.5f, 1.5f, 0.0f }, { 1.5f, 1.5f, -1.0f } } }; // need float buffer instead of n-dimensional array above - private FloatBuffer ctrlpointsBuf = BufferUtil - .newFloatBuffer(ctrlpoints.length * ctrlpoints[0].length - * ctrlpoints[0][0].length); + private FloatBuffer ctrlpointsBuf = Buffers.newDirectFloatBuffer(ctrlpoints.length * ctrlpoints[0].length * ctrlpoints[0][0].length); {// SO copy 4x4x3 array above to float buffer for (int i = 0; i < ctrlpoints.length; i++) { // System.out.print(ctrlpoints.length+ " "); diff --git a/src/redbook/src/glredbook10/checker.java b/src/redbook/src/glredbook10/checker.java index c92a6d1..5da7024 100644 --- a/src/redbook/src/glredbook10/checker.java +++ b/src/redbook/src/glredbook10/checker.java @@ -28,7 +28,7 @@ public class checker // // private byte checkImage[][][] = new // byte[checkImageWidth][checkImageHeight][color]; private ByteBuffer checkImageBuf = // - BufferUtil.newByteBuffer(checkImageHeight * checkImageWidth * color); + GLBuffers.newDirectByteBuffer(checkImageHeight * checkImageWidth * color); @Override protected GLJPanel createDrawable() { diff --git a/src/redbook/src/glredbook10/checker2.java b/src/redbook/src/glredbook10/checker2.java index 7c41110..20a3dd5 100644 --- a/src/redbook/src/glredbook10/checker2.java +++ b/src/redbook/src/glredbook10/checker2.java @@ -27,7 +27,7 @@ public class checker2// private static final int color = 3; private byte checkImage[][][] = new byte[checkImageWidth][checkImageHeight][color]; private ByteBuffer checkImageBuf = // - BufferUtil.newByteBuffer(checkImageHeight * checkImageWidth * color); + GLBuffers.newDirectByteBuffer(checkImageHeight * checkImageWidth * color); @Override protected GLJPanel createDrawable() { diff --git a/src/redbook/src/glredbook10/chess.java b/src/redbook/src/glredbook10/chess.java index fcbf4e9..beb9f7a 100644 --- a/src/redbook/src/glredbook10/chess.java +++ b/src/redbook/src/glredbook10/chess.java @@ -26,7 +26,7 @@ public class chess// private static final int color = 3; // private byte checkImage[][][] = new byte[checkImageWidth][checkImageHeight][color]; private ByteBuffer checkImageBuf = // - BufferUtil.newByteBuffer(checkImageHeight * checkImageWidth * color); + GLBuffers.newDirectByteBuffer(checkImageHeight * checkImageWidth * color); @Override protected GLJPanel createDrawable() { diff --git a/src/redbook/src/glredbook10/feedback.java b/src/redbook/src/glredbook10/feedback.java index 9f26aee..b824a55 100644 --- a/src/redbook/src/glredbook10/feedback.java +++ b/src/redbook/src/glredbook10/feedback.java @@ -56,7 +56,7 @@ public class feedback// GL2 gl = drawable.getGL().getGL2(); // float feedBuffer[] = new float[1024]; - FloatBuffer feedBuf = BufferUtil.newFloatBuffer(1024); + FloatBuffer feedBuf = GLBuffers.newDirectFloatBuffer(1024); int size; gl.glMatrixMode(GL2.GL_PROJECTION); diff --git a/src/redbook/src/glredbook10/font.java b/src/redbook/src/glredbook10/font.java index 8019bd4..accc262 100644 --- a/src/redbook/src/glredbook10/font.java +++ b/src/redbook/src/glredbook10/font.java @@ -108,7 +108,7 @@ public class font // } private void printString(GL2 gl, String s) { - ByteBuffer str = BufferUtil.newByteBuffer(s.length()); + ByteBuffer str = GLBuffers.newDirectByteBuffer(s.length()); str.put(s.getBytes()); str.rewind(); // @@ -359,7 +359,7 @@ public class font // { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, (byte) 0x8f, (byte) 0xf1, 0x60, 0x00, 0x00, 0x00 } }; private ByteBuffer rastersBuf = // - BufferUtil.newByteBuffer(rasters.length * rasters[0].length); + GLBuffers.newDirectByteBuffer(rasters.length * rasters[0].length); { for (int i = 0; i < rasters.length; i++) rastersBuf.put((byte[]) rasters[i]);// put each array into byte diff --git a/src/redbook/src/glredbook10/mipmap.java b/src/redbook/src/glredbook10/mipmap.java index b8bfe83..3533acd 100644 --- a/src/redbook/src/glredbook10/mipmap.java +++ b/src/redbook/src/glredbook10/mipmap.java @@ -5,6 +5,7 @@ import javax.swing.*; import java.nio.*; +import com.jogamp.gluegen.runtime.Buffers; import javax.media.opengl.*; import com.jogamp.opengl.util.*; import javax.media.opengl.awt.GLJPanel; @@ -29,18 +30,12 @@ public class mipmap// // private byte mipmapImage4[][][] = new byte[4][4][color]; // private byte mipmapImage2[][][] = new byte[2][2][color]; // private byte mipmapImage1[][][] = new byte[1][1][color]; - private ByteBuffer mipmapImage32Buf = BufferUtil - .newByteBuffer(32 * 32 * color); - private ByteBuffer mipmapImage16Buf = BufferUtil - .newByteBuffer(16 * 16 * color); - private ByteBuffer mipmapImage8Buf = BufferUtil - .newByteBuffer(8 * 8 * color); - private ByteBuffer mipmapImage4Buf = BufferUtil - .newByteBuffer(4 * 4 * color); - private ByteBuffer mipmapImage2Buf = BufferUtil - .newByteBuffer(2 * 2 * color); - private ByteBuffer mipmapImage1Buf = BufferUtil - .newByteBuffer(1 * 1 * color); + private ByteBuffer mipmapImage32Buf = Buffers.newDirectByteBuffer(32 * 32 * color); + private ByteBuffer mipmapImage16Buf = Buffers.newDirectByteBuffer(16 * 16 * color); + private ByteBuffer mipmapImage8Buf = Buffers.newDirectByteBuffer(8 * 8 * color); + private ByteBuffer mipmapImage4Buf = Buffers.newDirectByteBuffer(4 * 4 * color); + private ByteBuffer mipmapImage2Buf = Buffers.newDirectByteBuffer(2 * 2 * color); + private ByteBuffer mipmapImage1Buf = Buffers.newDirectByteBuffer(1 * 1 * color); @Override protected GLJPanel createDrawable() { diff --git a/src/redbook/src/glredbook10/pickdepth.java b/src/redbook/src/glredbook10/pickdepth.java index e7979a2..2426702 100644 --- a/src/redbook/src/glredbook10/pickdepth.java +++ b/src/redbook/src/glredbook10/pickdepth.java @@ -146,7 +146,7 @@ public class pickdepth// */ private void pickRects(GL2 gl) { int[] selectBuf = new int[BUFSIZE]; - IntBuffer selectBuffer = BufferUtil.newIntBuffer(BUFSIZE); + IntBuffer selectBuffer = GLBuffers.newDirectIntBuffer(BUFSIZE); int hits; int viewport[] = new int[4]; // int x, y; diff --git a/src/redbook/src/glredbook10/pickline.java b/src/redbook/src/glredbook10/pickline.java index 8d7eb4b..bb6b5c7 100644 --- a/src/redbook/src/glredbook10/pickline.java +++ b/src/redbook/src/glredbook10/pickline.java @@ -112,7 +112,7 @@ public class pickline// */ private void pickLine(GL2 gl) { int selectBuf[] = new int[BUFSIZE]; - IntBuffer selectBuffer = BufferUtil.newIntBuffer(BUFSIZE); + IntBuffer selectBuffer = GLBuffers.newDirectIntBuffer(BUFSIZE); int hits; int viewport[] = new int[4]; diff --git a/src/redbook/src/glredbook10/picksquare.java b/src/redbook/src/glredbook10/picksquare.java index 0087e79..2d9ff14 100644 --- a/src/redbook/src/glredbook10/picksquare.java +++ b/src/redbook/src/glredbook10/picksquare.java @@ -152,7 +152,7 @@ public class picksquare// // private void pickSquares(GL2 gl, int button, int state, int x, int y) private void pickSquares(GL2 gl) { int selectBuf[] = new int[BUFSIZE]; - IntBuffer selectBuffer = BufferUtil.newIntBuffer(BUFSIZE); + IntBuffer selectBuffer = GLBuffers.newDirectIntBuffer(BUFSIZE); int hits; int viewport[] = new int[4]; diff --git a/src/redbook/src/glredbook10/select.java b/src/redbook/src/glredbook10/select.java index 98609c2..8943228 100644 --- a/src/redbook/src/glredbook10/select.java +++ b/src/redbook/src/glredbook10/select.java @@ -196,7 +196,7 @@ public class select// private void selectObjects(GL2 gl) { int selectBuf[] = new int[BUFSIZE]; - IntBuffer selectBuffer = BufferUtil.newIntBuffer(BUFSIZE); + IntBuffer selectBuffer = GLBuffers.newDirectIntBuffer(BUFSIZE); int hits; gl.glSelectBuffer(BUFSIZE, selectBuffer); diff --git a/src/redbook/src/glredbook10/stroke.java b/src/redbook/src/glredbook10/stroke.java index f8b4791..081ba3d 100644 --- a/src/redbook/src/glredbook10/stroke.java +++ b/src/redbook/src/glredbook10/stroke.java @@ -210,7 +210,7 @@ public class stroke// // private void printStrokedString(char *s) private void printStrokedString(GL2 gl, String s) { int len = s.length(); - ByteBuffer str = BufferUtil.newByteBuffer(len); + ByteBuffer str = GLBuffers.newDirectByteBuffer(len); str.put(s.getBytes()); str.rewind(); gl.glCallLists(len, GL.GL_BYTE, str); diff --git a/src/redbook/src/glredbook10/texgen.java b/src/redbook/src/glredbook10/texgen.java index c94616a..821dae7 100644 --- a/src/redbook/src/glredbook10/texgen.java +++ b/src/redbook/src/glredbook10/texgen.java @@ -5,7 +5,7 @@ import javax.swing.*; import java.nio.*; -import com.jogamp.opengl.util.*; +import com.jogamp.gluegen.runtime.Buffers; import com.jogamp.opengl.util.gl2.GLUT; import javax.media.opengl.*; import javax.media.opengl.awt.GLJPanel; @@ -22,8 +22,7 @@ public class texgen// private static final int stripeImageWidth = 32; private byte stripeImage[] = new byte[3 * stripeImageWidth]; - private ByteBuffer stripeImageBuf = BufferUtil - .newByteBuffer(stripeImage.length); + private ByteBuffer stripeImageBuf = Buffers.newDirectByteBuffer(stripeImage.length); /* glTexGen stuff: */ private float sgenparams[] = { 1.0f, 1.0f, 1.0f, 0.0f }; diff --git a/src/redbook/src/glredbook10/texturesurf.java b/src/redbook/src/glredbook10/texturesurf.java index 34f561d..3c4d947 100644 --- a/src/redbook/src/glredbook10/texturesurf.java +++ b/src/redbook/src/glredbook10/texturesurf.java @@ -6,7 +6,7 @@ import java.awt.event.*; import java.nio.*; -import com.jogamp.opengl.util.*; +import com.jogamp.gluegen.runtime.Buffers; import javax.media.opengl.*; import javax.media.opengl.awt.GLJPanel; @@ -20,6 +20,7 @@ import javax.media.opengl.awt.GLJPanel; public class texturesurf// extends GLSkeleton implements GLEventListener, KeyListener { + // as from C version of file private static final float ctrlpoints[][][] = new float[][][] { { { -1.5f, -1.5f, 4.0f }, { -0.5f, -1.5f, 2.0f }, @@ -30,10 +31,10 @@ public class texturesurf// { 0.5f, 0.5f, 3.0f }, { 1.5f, 0.5f, 4.0f } }, { { -1.5f, 1.5f, -2.0f }, { -0.5f, 1.5f, -2.0f }, { 0.5f, 1.5f, 0.0f }, { 1.5f, 1.5f, -1.0f } } }; + // need float buffer instead of n-dimensional array above - private FloatBuffer ctrlpointsBuf = BufferUtil - .newFloatBuffer(ctrlpoints.length * ctrlpoints[0].length - * ctrlpoints[0][0].length); + private FloatBuffer ctrlpointsBuf = Buffers.newDirectFloatBuffer(ctrlpoints.length * ctrlpoints[0].length * ctrlpoints[0][0].length); + {// SO copy 4x4x3 array above to float buffer for (int i = 0; i < ctrlpoints.length; i++) // System.out.print(ctrlpoints.length+ " "); @@ -51,9 +52,7 @@ public class texturesurf// private float[][][] texpts = new float[][][] { { { 0.0f, 0.0f }, { 0.0f, 1.0f } }, { { 1.0f, 0.0f }, { 1.0f, 1.0f } } }; - private FloatBuffer texptsBuf = BufferUtil - // - .newFloatBuffer(texpts.length * texpts[0].length * texpts[1].length); + private FloatBuffer texptsBuf = Buffers.newDirectFloatBuffer(texpts.length * texpts[0].length * texpts[1].length); { for (int i = 0; i < texpts.length; i++) // System.out.print(ctrlpoints.length+ " "); @@ -72,7 +71,7 @@ public class texturesurf// private static final int imageWidth = 64; private static final int imageHeight = 64; private static byte image[] = new byte[3 * imageWidth * imageHeight]; - private static ByteBuffer imageBuf = BufferUtil.newByteBuffer(image.length); + private static ByteBuffer imageBuf = Buffers.newDirectByteBuffer(image.length); @Override protected GLJPanel createDrawable() { @@ -104,23 +103,17 @@ public class texturesurf// GL2 gl = drawable.getGL().getGL2(); // gl.glMap2f(GL2.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, ctrlpointsBuf); - gl.glMap2f(GL2.GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, - texptsBuf); + gl.glMap2f(GL2.GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, texptsBuf); gl.glEnable(GL2.GL_MAP2_TEXTURE_COORD_2); gl.glEnable(GL2.GL_MAP2_VERTEX_3); gl.glMapGrid2f(20, 0.0f, 1.0f, 20, 0.0f, 1.0f); makeImage(); gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_DECAL); - gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_S, - GL2.GL_REPEAT); - gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_T, - GL2.GL_REPEAT); - gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_MAG_FILTER, - GL.GL_NEAREST); - gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_MIN_FILTER, - GL.GL_NEAREST); - gl.glTexImage2D(GL2.GL_TEXTURE_2D, 0, GL2.GL_RGB, imageWidth, - imageHeight, 0, GL2.GL_RGB, GL.GL_UNSIGNED_BYTE, imageBuf); + gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_S, GL2.GL_REPEAT); + gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_T, GL2.GL_REPEAT); + gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); + gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST); + gl.glTexImage2D(GL2.GL_TEXTURE_2D, 0, GL2.GL_RGB, imageWidth, imageHeight, 0, GL2.GL_RGB, GL.GL_UNSIGNED_BYTE, imageBuf); gl.glEnable(GL2.GL_TEXTURE_2D); gl.glEnable(GL.GL_DEPTH_TEST); gl.glShadeModel(GL2.GL_FLAT); @@ -153,8 +146,7 @@ public class texturesurf// gl.glRotatef(85.0f, 1.0f, 1.0f, 1.0f); } - public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, - boolean deviceChanged) { + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { } private void makeImage() { diff --git a/src/redbook/src/glredbook11/image.java b/src/redbook/src/glredbook11/image.java index eea4d24..7c6d16b 100644 --- a/src/redbook/src/glredbook11/image.java +++ b/src/redbook/src/glredbook11/image.java @@ -22,7 +22,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import glredbook10.GLSkeleton; import javax.media.opengl.awt.GLJPanel; @@ -50,7 +50,7 @@ public class image // private static final int rgb = 3; // private byte checkImage[][][]; private ByteBuffer checkImageBuf = // - BufferUtil.newByteBuffer(checkImageHeight * checkImageWidth * rgb); + GLBuffers.newDirectByteBuffer(checkImageHeight * checkImageWidth * rgb); private static float zoomFactor = 1.0f; private static int height; diff --git a/src/redbook/src/glredbook11/texbind.java b/src/redbook/src/glredbook11/texbind.java index 7991f76..ba29968 100644 --- a/src/redbook/src/glredbook11/texbind.java +++ b/src/redbook/src/glredbook11/texbind.java @@ -9,7 +9,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import javax.media.opengl.awt.GLJPanel; import javax.media.opengl.glu.GLU; @@ -30,9 +30,9 @@ public class texbind // // private byte checkImage[][][]; // private byte otherImage[][][]; private ByteBuffer checkImageBuf = // - BufferUtil.newByteBuffer(checkImageWidth * checkImageHeight * rgba); + GLBuffers.newDirectByteBuffer(checkImageWidth * checkImageHeight * rgba); private ByteBuffer otherImageBuf = // - BufferUtil.newByteBuffer(checkImageWidth * checkImageHeight * rgba); + GLBuffers.newDirectByteBuffer(checkImageWidth * checkImageHeight * rgba); private int[] texName = new int[2]; @Override diff --git a/src/redbook/src/glredbook11/texgen.java b/src/redbook/src/glredbook11/texgen.java index 519d88f..353c843 100644 --- a/src/redbook/src/glredbook11/texgen.java +++ b/src/redbook/src/glredbook11/texgen.java @@ -6,9 +6,10 @@ import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.nio.ByteBuffer; -import javax.media.opengl.*;import javax.swing.JFrame; +import javax.media.opengl.*; +import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.gluegen.runtime.Buffers; import com.jogamp.opengl.util.gl2.GLUT; import javax.media.opengl.awt.GLJPanel; @@ -31,8 +32,7 @@ public class texgen// private GLUT glut; private static final int stripeImageWidth = 32; private byte stripeImage[] = new byte[3 * stripeImageWidth]; - private ByteBuffer stripeImageBuf = BufferUtil - .newByteBuffer(stripeImage.length); + private ByteBuffer stripeImageBuf = Buffers.newDirectByteBuffer(stripeImage.length); /* glTexGen stuff: */ // private float sgenparams[] = { 1.0f, 1.0f, 1.0f, 0.0f }; private int texName[] = new int[1]; diff --git a/src/redbook/src/glredbook11/texsub.java b/src/redbook/src/glredbook11/texsub.java index 32b7d7d..645745d 100644 --- a/src/redbook/src/glredbook11/texsub.java +++ b/src/redbook/src/glredbook11/texsub.java @@ -9,7 +9,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import javax.media.opengl.awt.GLJPanel; import javax.media.opengl.glu.GLU; @@ -35,9 +35,9 @@ public class texsub // private byte checkImage[][][]; // private byte otherImage[][][]; private ByteBuffer checkImageBuf = // - BufferUtil.newByteBuffer(checkImageWidth * checkImageHeight * rgba); + GLBuffers.newDirectByteBuffer(checkImageWidth * checkImageHeight * rgba); private ByteBuffer subImageBuf = // - BufferUtil.newByteBuffer(subImageWidth * subImageHeight * rgba); + GLBuffers.newDirectByteBuffer(subImageWidth * subImageHeight * rgba); private int[] texName = new int[2]; @Override diff --git a/src/redbook/src/glredbook11/varray.java b/src/redbook/src/glredbook11/varray.java index a40b994..d235296 100644 --- a/src/redbook/src/glredbook11/varray.java +++ b/src/redbook/src/glredbook11/varray.java @@ -12,7 +12,7 @@ import java.nio.IntBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import javax.media.opengl.awt.GLJPanel; import javax.media.opengl.glu.GLU; @@ -96,7 +96,7 @@ public class varray// } else if (derefMethod == DRAWELEMENTS) { int indices[] = new int[] { 0, 1, 3, 4 }; if (indicesBuf == null) { - indicesBuf = BufferUtil.newIntBuffer(indices.length); + indicesBuf = GLBuffers.newDirectIntBuffer(indices.length); indicesBuf.put(indices); } indicesBuf.rewind(); @@ -135,11 +135,11 @@ public class varray// 0.5f, 0.5f, 0.5f }; if (verticesBuf == null) {// IntBuffer tmpVerticesBuf - verticesBuf = BufferUtil.newIntBuffer(vertices.length); + verticesBuf = GLBuffers.newDirectIntBuffer(vertices.length); verticesBuf.put(vertices); } if (colorsBuf == null) { - colorsBuf = BufferUtil.newFloatBuffer(colors.length); + colorsBuf = GLBuffers.newDirectFloatBuffer(colors.length); colorsBuf.put(colors); } verticesBuf.rewind(); @@ -160,7 +160,7 @@ public class varray// 0.2f, 1.0f, 1.0f, 300.0f, 200.0f, 0.0f, 0.2f, 0.2f, 1.0f, 200.0f, 100.0f, 0.0f }; if (intertwinedBuf == null) { - intertwinedBuf = BufferUtil.newFloatBuffer(intertwined.length); + intertwinedBuf = GLBuffers.newDirectFloatBuffer(intertwined.length); intertwinedBuf.put(intertwined); } diff --git a/src/redbook/src/glredbook11/wrap.java b/src/redbook/src/glredbook11/wrap.java index 778db3a..47662a4 100644 --- a/src/redbook/src/glredbook11/wrap.java +++ b/src/redbook/src/glredbook11/wrap.java @@ -7,7 +7,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import glredbook10.GLSkeleton; import javax.media.opengl.awt.GLJPanel; @@ -34,7 +34,7 @@ public class wrap// private static final int rgba = 4; // private byte[][][] checkImage; private ByteBuffer checkImageBuf = // - BufferUtil.newByteBuffer(checkImageHeight * checkImageWidth * rgba); + GLBuffers.newDirectByteBuffer(checkImageHeight * checkImageWidth * rgba); private KeyEvent key; @Override diff --git a/src/redbook/src/glredbook12x/colormatrix.java b/src/redbook/src/glredbook12x/colormatrix.java index 7662915..9f4748f 100644 --- a/src/redbook/src/glredbook12x/colormatrix.java +++ b/src/redbook/src/glredbook12x/colormatrix.java @@ -11,7 +11,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*;import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import glredbook10.GLSkeleton; import javax.media.opengl.awt.GLJPanel; @@ -135,7 +135,7 @@ public class colormatrix// System.out.println("Creating buffer, width: " + dim.width + " height: " + dim.height); // byte[] buf = new byte[3 * dim.height * dim.width]; - bytes = BufferUtil.newByteBuffer(3 * dim.width * dim.height); + bytes = GLBuffers.newDirectByteBuffer(3 * dim.width * dim.height); for (int i = 0; i < bytes.capacity(); i++) { bytes.put(dis.readByte()); // int b = dis.readByte();// dis.read(); diff --git a/src/redbook/src/glredbook12x/colortable.java b/src/redbook/src/glredbook12x/colortable.java index 4f5fd5e..0564b26 100644 --- a/src/redbook/src/glredbook12x/colortable.java +++ b/src/redbook/src/glredbook12x/colortable.java @@ -12,7 +12,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*;import javax.swing.JFrame; import javax.swing.SwingUtilities; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import glredbook10.GLSkeleton; import javax.media.opengl.awt.GLJPanel; @@ -74,7 +74,7 @@ public class colortable// } // byte colorTable[][] = new byte[256][3]; - ByteBuffer colorTableBuf = BufferUtil.newByteBuffer(256 * 3); + ByteBuffer colorTableBuf = GLBuffers.newDirectByteBuffer(256 * 3); gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); @@ -157,7 +157,7 @@ public class colortable// System.out.println("Creating buffer, width: " + dim.width + " height: " + dim.height); // byte[] buf = new byte[3 * dim.height * dim.width]; - bytes = BufferUtil.newByteBuffer(3 * dim.width * dim.height); + bytes = GLBuffers.newDirectByteBuffer(3 * dim.width * dim.height); for (int i = 0; i < bytes.capacity(); i++) { bytes.put(dis.readByte()); // int b = dis.readByte();// dis.read(); diff --git a/src/redbook/src/glredbook12x/convolution.java b/src/redbook/src/glredbook12x/convolution.java index 3f4fbdf..9e6d72e 100644 --- a/src/redbook/src/glredbook12x/convolution.java +++ b/src/redbook/src/glredbook12x/convolution.java @@ -14,7 +14,7 @@ import javax.media.opengl.*; import javax.swing.JFrame; import javax.swing.SwingUtilities; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import glredbook10.GLSkeleton; import javax.media.opengl.awt.GLJPanel; @@ -27,6 +27,7 @@ import javax.media.opengl.awt.GLJPanel; public class convolution// extends GLSkeleton implements GLEventListener, KeyListener { + private JFrame frame; private KeyEvent key; // @@ -41,12 +42,9 @@ public class convolution// private float laplacian[][] = { { -0.125f, -0.125f, -0.125f }, { -0.125f, 1.0f, -0.125f }, { -0.125f, -0.125f, -0.125f } }; - private FloatBuffer horizontalBuf = BufferUtil - .newFloatBuffer(horizontal.length * horizontal[0].length); - private FloatBuffer verticalBuf = BufferUtil.newFloatBuffer(vertical.length - * vertical[0].length); - private FloatBuffer laplacianBuf = BufferUtil - .newFloatBuffer(laplacian.length * laplacian[0].length); + private FloatBuffer horizontalBuf = GLBuffers.newDirectFloatBuffer(horizontal.length * horizontal[0].length); + private FloatBuffer verticalBuf = GLBuffers.newDirectFloatBuffer(vertical.length * vertical[0].length); + private FloatBuffer laplacianBuf = GLBuffers.newDirectFloatBuffer(laplacian.length * laplacian[0].length); { for (int i = 0; i < 3; i++) { horizontalBuf.put(horizontal[i]); @@ -190,7 +188,7 @@ public class convolution// System.out.println("Creating buffer, width: " + dim.width + " height: " + dim.height); // byte[] buf = new byte[3 * dim.height * dim.width]; - bytes = BufferUtil.newByteBuffer(3 * dim.width * dim.height); + bytes = GLBuffers.newDirectByteBuffer(3 * dim.width * dim.height); for (int i = 0; i < bytes.capacity(); i++) { bytes.put(dis.readByte()); // int b = dis.readByte();// dis.read(); diff --git a/src/redbook/src/glredbook12x/histogram.java b/src/redbook/src/glredbook12x/histogram.java index dd3bb62..2fabe52 100644 --- a/src/redbook/src/glredbook12x/histogram.java +++ b/src/redbook/src/glredbook12x/histogram.java @@ -14,7 +14,7 @@ import javax.media.opengl.*; import javax.swing.JFrame; import javax.swing.SwingUtilities; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import glredbook10.GLSkeleton; import javax.media.opengl.awt.GLJPanel; @@ -110,7 +110,7 @@ public class histogram // }// key sw // short values[][] = new short[HISTOGRAM_SIZE][3]; - ShortBuffer values = BufferUtil.newShortBuffer(HISTOGRAM_SIZE * 3); + ShortBuffer values = GLBuffers.newDirectShortBuffer(HISTOGRAM_SIZE * 3); gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glRasterPos2i(1, 1); @@ -183,7 +183,7 @@ public class histogram // System.out.println("Creating buffer, width: " + dim.width + " height: " + dim.height); // byte[] buf = new byte[3 * dim.height * dim.width]; - bytes = BufferUtil.newByteBuffer(3 * dim.width * dim.height); + bytes = GLBuffers.newDirectByteBuffer(3 * dim.width * dim.height); for (int i = 0; i < bytes.capacity(); i++) { bytes.put(dis.readByte()); // int b = dis.readByte();// dis.read(); diff --git a/src/redbook/src/glredbook12x/minmax.java b/src/redbook/src/glredbook12x/minmax.java index c7e40b4..6f35328 100644 --- a/src/redbook/src/glredbook12x/minmax.java +++ b/src/redbook/src/glredbook12x/minmax.java @@ -12,7 +12,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*;import javax.swing.JFrame; import javax.swing.SwingUtilities; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import glredbook10.GLSkeleton; import javax.media.opengl.awt.GLJPanel; @@ -90,7 +90,7 @@ public class minmax// gl.glClear(GL.GL_COLOR_BUFFER_BIT); // byte [] values=new byte[6]; - ByteBuffer values = BufferUtil.newByteBuffer(6); + ByteBuffer values = GLBuffers.newDirectByteBuffer(6); gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glRasterPos2i(1, 1); @@ -141,7 +141,7 @@ public class minmax// System.out.println("Creating buffer, width: " + dim.width + " height: " + dim.height); - bytes = BufferUtil.newByteBuffer(3 * dim.width * dim.height); + bytes = GLBuffers.newDirectByteBuffer(3 * dim.width * dim.height); for (int i = 0; i < bytes.capacity(); i++) { bytes.put(dis.readByte()); diff --git a/src/redbook/src/glredbook12x/multitex.java b/src/redbook/src/glredbook12x/multitex.java index 3cda5f7..f243739 100644 --- a/src/redbook/src/glredbook12x/multitex.java +++ b/src/redbook/src/glredbook12x/multitex.java @@ -12,7 +12,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import javax.media.opengl.awt.GLJPanel; import javax.media.opengl.glu.GLU; @@ -27,8 +27,8 @@ public class multitex // private GLU glu; // private byte[][][] texels0 = new byte[32][32][4]; // private byte[][][] texels1 = new byte[16][16][4]; - private ByteBuffer texelsBuf0 = BufferUtil.newByteBuffer(32 * 32 * 4); - private ByteBuffer texelsBuf1 = BufferUtil.newByteBuffer(16 * 16 * 4); + private ByteBuffer texelsBuf0 = GLBuffers.newDirectByteBuffer(32 * 32 * 4); + private ByteBuffer texelsBuf1 = GLBuffers.newDirectByteBuffer(16 * 16 * 4); @Override protected GLJPanel createDrawable() { diff --git a/src/redbook/src/glredbook12x/texture3d.java b/src/redbook/src/glredbook12x/texture3d.java index 7258ec1..240ca0b 100644 --- a/src/redbook/src/glredbook12x/texture3d.java +++ b/src/redbook/src/glredbook12x/texture3d.java @@ -10,7 +10,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import glredbook10.GLSkeleton; import javax.media.opengl.awt.GLJPanel; @@ -32,7 +32,7 @@ public class texture3d // private static final int iDepth = 16; private static final int iRgb = 3; private ByteBuffer image - = BufferUtil.newByteBuffer(iRgb * iWidth * iHeight * iDepth); + = GLBuffers.newDirectByteBuffer(iRgb * iWidth * iHeight * iDepth); private int texName[] = new int[1]; @Override diff --git a/src/redbook/src/glredbook1314/combiner.java b/src/redbook/src/glredbook1314/combiner.java index fbab5de..bf34c23 100644 --- a/src/redbook/src/glredbook1314/combiner.java +++ b/src/redbook/src/glredbook1314/combiner.java @@ -7,7 +7,7 @@ import java.nio.ByteBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import glredbook10.GLSkeleton; import javax.media.opengl.awt.GLJPanel; @@ -40,9 +40,9 @@ public class combiner// // private static byte[][][] image1 = new // byte[imageHeight][imageWidth][imageColor]; private static ByteBuffer imageBuf0 // - = BufferUtil.newByteBuffer(imageWidth * imageHeight * imageColor); + = GLBuffers.newDirectByteBuffer(imageWidth * imageHeight * imageColor); private static ByteBuffer imageBuf1 // - = BufferUtil.newByteBuffer(imageWidth * imageHeight * imageColor); + = GLBuffers.newDirectByteBuffer(imageWidth * imageHeight * imageColor); private static int texName[] = new int[4]; @Override diff --git a/src/redbook/src/glredbook1314/cubemap.java b/src/redbook/src/glredbook1314/cubemap.java index c116cf8..0b0c03a 100644 --- a/src/redbook/src/glredbook1314/cubemap.java +++ b/src/redbook/src/glredbook1314/cubemap.java @@ -36,17 +36,17 @@ public class cubemap// // private static byte image5[][][] = new byte[imageSize][imageSize][4]; // private static byte image6[][][] = new byte[imageSize][imageSize][4]; private static ByteBuffer imageBuf1 // - = BufferUtil.newByteBuffer(imageSize * imageSize * 4); + = GLBuffers.newDirectByteBuffer(imageSize * imageSize * 4); private static ByteBuffer imageBuf2 // - = BufferUtil.newByteBuffer(imageSize * imageSize * 4); + = GLBuffers.newDirectByteBuffer(imageSize * imageSize * 4); private static ByteBuffer imageBuf3 // - = BufferUtil.newByteBuffer(imageSize * imageSize * 4); + = GLBuffers.newDirectByteBuffer(imageSize * imageSize * 4); private static ByteBuffer imageBuf4 // - = BufferUtil.newByteBuffer(imageSize * imageSize * 4); + = GLBuffers.newDirectByteBuffer(imageSize * imageSize * 4); private static ByteBuffer imageBuf5 // - = BufferUtil.newByteBuffer(imageSize * imageSize * 4); + = GLBuffers.newDirectByteBuffer(imageSize * imageSize * 4); private static ByteBuffer imageBuf6 // - = BufferUtil.newByteBuffer(imageSize * imageSize * 4); + = GLBuffers.newDirectByteBuffer(imageSize * imageSize * 4); private static double ztrans = 0.0; diff --git a/src/redbook/src/glredbook1314/mvarray.java b/src/redbook/src/glredbook1314/mvarray.java index 405cfbf..0885d9e 100644 --- a/src/redbook/src/glredbook1314/mvarray.java +++ b/src/redbook/src/glredbook1314/mvarray.java @@ -10,7 +10,7 @@ import java.nio.IntBuffer; import javax.media.opengl.*; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import javax.media.opengl.awt.GLJPanel; import javax.media.opengl.glu.GLU; @@ -40,7 +40,7 @@ public class mvarray // 300, 250 }; private IntBuffer vertexBuf = // - BufferUtil.newIntBuffer(vertices.length); + GLBuffers.newDirectIntBuffer(vertices.length); private byte oneIndices[] = { 0, 1, 2, 3, 4, 5, 6 }; @@ -49,8 +49,8 @@ public class mvarray // private int count[] = { 7, 6 }; private ByteBuffer indices[] = {// - BufferUtil.newByteBuffer(oneIndices.length), - BufferUtil.newByteBuffer(twoIndices.length) }; + GLBuffers.newDirectByteBuffer(oneIndices.length), + GLBuffers.newDirectByteBuffer(twoIndices.length) }; // static GLvoid * indices[2] = {oneIndices, twoIndices}; { diff --git a/src/redbook/src/glredbook1314/shadowmap.java b/src/redbook/src/glredbook1314/shadowmap.java index 57da6e9..f20b9d2 100644 --- a/src/redbook/src/glredbook1314/shadowmap.java +++ b/src/redbook/src/glredbook1314/shadowmap.java @@ -8,7 +8,7 @@ import javax.media.opengl.*; import javax.media.opengl.awt.GLCanvas; import javax.swing.JFrame; -import com.jogamp.opengl.util.BufferUtil; +import com.jogamp.opengl.util.GLBuffers; import com.jogamp.opengl.util.FPSAnimator; @@ -232,7 +232,7 @@ public class shadowmap // if (shadowRender && textureOn) gl.glEnable(GL2.GL_TEXTURE_2D); } - FloatBuffer depthImageBuf = BufferUtil.newFloatBuffer(SHADOW_MAP_WIDTH * SHADOW_MAP_HEIGHT); + FloatBuffer depthImageBuf = GLBuffers.newDirectFloatBuffer(SHADOW_MAP_WIDTH * SHADOW_MAP_HEIGHT); private void generateShadowMap(GL2 gl) { int viewport[] = {0,0,0,0};//new int[4]; @@ -288,7 +288,7 @@ public class shadowmap // // demo.canvas.display();causes overflow! } } - FloatBuffer tmpMatbuf = BufferUtil.newFloatBuffer(16); + FloatBuffer tmpMatbuf = GLBuffers.newDirectFloatBuffer(16); private void generateTextureMatrix(GL2 gl) { // float tmpMatrix[] = new float[16]; -- cgit v1.2.3