summaryrefslogtreecommitdiffstats
path: root/src/demos
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-03-30 02:06:00 +0200
committerSven Gothel <[email protected]>2010-03-30 02:06:00 +0200
commit2e4835c543d32791cf3c79907aecad7c4692f457 (patch)
tree613d0f21c1cb79a400b4b188534ec033343bfc87 /src/demos
parentd3e818ea8b7c3f45ed4cfac7b0e7d3bd24f956e5 (diff)
parent0b708395a18eb6a2ae5372ff414bc75830ce19b6 (diff)
Merge branch 'master' of github.com:mbien/jogl-demos
Diffstat (limited to 'src/demos')
-rwxr-xr-xsrc/demos/GLInfo.java6
-rwxr-xr-xsrc/demos/GLNewtRun.java5
-rwxr-xr-xsrc/demos/applets/JOGLNewtApplet1Run.java3
-rwxr-xr-xsrc/demos/applets/JOGLNewtAppletBase.java5
-rw-r--r--src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java8
-rwxr-xr-xsrc/demos/cubefbo/CubeObject.java15
-rwxr-xr-xsrc/demos/es1/Info.java6
-rwxr-xr-xsrc/demos/es1/RedSquare.java9
-rwxr-xr-xsrc/demos/es1/angeles/AngelesES1.java29
-rwxr-xr-xsrc/demos/es1/angeles/AngelesGL.java32
-rwxr-xr-xsrc/demos/es1/angeles/AngelesGLil.java24
-rwxr-xr-xsrc/demos/es1/angeles/Main.java5
-rw-r--r--src/demos/es1/cube/Cube.java24
-rw-r--r--src/demos/es1/cube/CubeImmModeSink.java13
-rwxr-xr-xsrc/demos/es1/cubefbo/Main.java5
-rwxr-xr-xsrc/demos/es2/RedSquare.java4
-rw-r--r--src/demos/es2/openmax/Cube.java24
-rwxr-xr-xsrc/demos/es2/openmax/MovieCube.java7
-rwxr-xr-xsrc/demos/es2/openmax/MovieSimple.java6
-rwxr-xr-xsrc/demos/es2/perftst/PerfTextLoad.java4
-rwxr-xr-xsrc/demos/es2/perftst/PerfUniLoad.java7
-rwxr-xr-xsrc/demos/es2/perftst/PerfVBOLoad.java2
-rwxr-xr-xsrc/demos/es2/perftst/Perftst.java5
-rwxr-xr-xsrc/demos/misc/Picking.java4
-rw-r--r--src/demos/newt/NEWTTest1.java2
-rw-r--r--src/demos/newt/TaskManagerTest1.java2
-rw-r--r--src/demos/newt/TaskManagerTest2.java2
-rw-r--r--src/demos/newt/util/TaskToolWM.java3
-rw-r--r--src/demos/proceduralTexturePhysics/Water.java3
-rwxr-xr-xsrc/demos/readbuffer/Main.java5
-rwxr-xr-xsrc/demos/readbuffer/ReadBuffer2Screen.java4
-rwxr-xr-xsrc/demos/readbuffer/ReadBufferBase.java5
-rwxr-xr-xsrc/demos/readbuffer/ReadBufferUtil.java4
-rwxr-xr-xsrc/demos/readbuffer/Surface2File.java3
-rw-r--r--src/demos/util/ObjReader.java6
-rw-r--r--src/demos/vertexBufferObject/VertexBufferObject.java11
-rw-r--r--src/demos/vertexProgRefract/VertexProgRefract.java1
-rw-r--r--src/demos/vertexProgWarp/VertexProgWarp.java2
38 files changed, 138 insertions, 167 deletions
diff --git a/src/demos/GLInfo.java b/src/demos/GLInfo.java
index 938e087..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.sun.javafx.newt.*;
-import com.sun.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 fd663b3..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.sun.javafx.newt.*;
-import com.sun.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 e3696ab..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.sun.javafx.newt.*;
-import com.sun.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 &lt;applet&gt; tag. */
diff --git a/src/demos/applets/JOGLNewtAppletBase.java b/src/demos/applets/JOGLNewtAppletBase.java
index 628699d..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.sun.javafx.newt.*;
-import com.sun.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/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/Info.java b/src/demos/es1/Info.java
index 972fd5e..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.sun.javafx.newt.*;
-import com.sun.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 afbae11..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.*;
@@ -9,8 +10,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.newt.*;
+import com.jogamp.newt.opengl.*;
public class RedSquare extends Thread implements WindowListener, KeyListener, MouseListener, GLEventListener {
@@ -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/angeles/Main.java b/src/demos/es1/angeles/Main.java
index 40e24d0..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.sun.javafx.newt.*;
-import com.sun.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 9197b85..d2a3277 100644
--- a/src/demos/es1/cube/Cube.java
+++ b/src/demos/es1/cube/Cube.java
@@ -31,16 +31,16 @@
*/
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.sun.javafx.newt.*;
-import com.sun.javafx.newt.opengl.*;
+import com.jogamp.newt.*;
+import com.jogamp.newt.opengl.*;
public class Cube implements GLEventListener {
public boolean glDebug = false ;
@@ -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 8b6092c..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.*;
@@ -38,8 +39,8 @@ import com.jogamp.opengl.util.*;
import com.jogamp.opengl.util.glsl.fixedfunc.*;
import java.nio.*;
-import com.sun.javafx.newt.*;
-import com.sun.javafx.newt.opengl.*;
+import com.jogamp.newt.*;
+import com.jogamp.newt.opengl.*;
public class CubeImmModeSink implements GLEventListener {
boolean quit = false;
@@ -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/es1/cubefbo/Main.java b/src/demos/es1/cubefbo/Main.java
index 44aa4d2..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.sun.javafx.newt.*;
-import com.sun.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 958f118..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.sun.javafx.newt.*;
-import com.sun.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 620ce88..aa4b8dd 100644
--- a/src/demos/es2/openmax/Cube.java
+++ b/src/demos/es2/openmax/Cube.java
@@ -31,16 +31,16 @@
*/
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.sun.javafx.newt.*;
-import com.sun.javafx.newt.opengl.*;
+import com.jogamp.newt.*;
+import com.jogamp.newt.opengl.*;
public class Cube implements GLEventListener {
boolean quit = false;
@@ -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/openmax/MovieCube.java b/src/demos/es2/openmax/MovieCube.java
index 197b2c9..f59bea2 100755
--- a/src/demos/es2/openmax/MovieCube.java
+++ b/src/demos/es2/openmax/MovieCube.java
@@ -38,13 +38,12 @@ 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.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 3bd4156..b702699 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.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 d58354b..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.sun.javafx.newt.*;
-import com.sun.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 a38baa3..170bf1a 100755
--- a/src/demos/es2/perftst/PerfUniLoad.java
+++ b/src/demos/es2/perftst/PerfUniLoad.java
@@ -1,11 +1,10 @@
package demos.es2.perftst;
+import com.jogamp.gluegen.runtime.Buffers;
import java.nio.*;
import javax.media.opengl.*;
import com.jogamp.opengl.util.*;
-import com.sun.javafx.newt.*;
-import com.sun.javafx.newt.opengl.*;
public class PerfUniLoad extends PerfModule {
static final int MAX_ARRAYS = 12;
@@ -67,7 +66,7 @@ public class PerfUniLoad extends PerfModule {
float x=0f, y=0f, z=0f, w=0f;
for(int i=0; i<numObjs; i++) {
- FloatBuffer fb = BufferUtil.newFloatBuffer(4*numArrayElem);
+ FloatBuffer fb = Buffers.newDirectFloatBuffer(4*numArrayElem);
for(int j=0; j<numArrayElem; j++) {
// Fill them up
@@ -123,7 +122,7 @@ public class PerfUniLoad extends PerfModule {
}
int uniElements = numObjs * numArrayElem ;
- int uniBytes = uniElements * BufferUtil.SIZEOF_FLOAT;
+ int uniBytes = uniElements * Buffers.SIZEOF_FLOAT;
dt = 0;
for(int i=1; i<loops; i++) {
diff --git a/src/demos/es2/perftst/PerfVBOLoad.java b/src/demos/es2/perftst/PerfVBOLoad.java
index ee9b251..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.sun.javafx.newt.*;
-import com.sun.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..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.sun.javafx.newt.*;
-import com.sun.javafx.newt.opengl.*;
+import com.jogamp.newt.*;
+import com.jogamp.newt.opengl.*;
public class Perftst implements MouseListener, GLEventListener {
diff --git a/src/demos/misc/Picking.java b/src/demos/misc/Picking.java
index 27a0fe2..0e1596a 100755
--- a/src/demos/misc/Picking.java
+++ b/src/demos/misc/Picking.java
@@ -10,6 +10,7 @@ package demos.misc;
// Notes: * Based on example 13-3 (p 542) in the "OpenGL Programming Guide"
// * This version should handle overlapping objects correctly.
//---------------------------------------------------------------------------------
+import com.jogamp.gluegen.runtime.Buffers;
import java.awt.*;
import java.awt.event.*;
import java.awt.Canvas.*;
@@ -18,7 +19,6 @@ import javax.media.opengl.*;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.glu.*;
import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.BufferUtil;
public class Picking
{
@@ -96,7 +96,7 @@ public class Picking
int buffsize = 512;
double x = (double) mouse_x, y = (double) mouse_y;
int[] viewPort = new int[4];
- IntBuffer selectBuffer = BufferUtil.newIntBuffer(buffsize);
+ IntBuffer selectBuffer = Buffers.newDirectIntBuffer(buffsize);
int hits = 0;
gl.glGetIntegerv(GL2.GL_VIEWPORT, viewPort, 0);
gl.glSelectBuffer(buffsize, selectBuffer);
diff --git a/src/demos/newt/NEWTTest1.java b/src/demos/newt/NEWTTest1.java
index 0cfc190..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.sun.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 6044cb7..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.sun.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 ab6fd47..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.sun.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 0f1b180..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.sun.javafx.newt.*;
+import com.jogamp.newt.*;
public class TaskToolWM {
final static boolean externalStimuli;
diff --git a/src/demos/proceduralTexturePhysics/Water.java b/src/demos/proceduralTexturePhysics/Water.java
index fdf4224..f718604 100644
--- a/src/demos/proceduralTexturePhysics/Water.java
+++ b/src/demos/proceduralTexturePhysics/Water.java
@@ -41,13 +41,11 @@ import demos.util.Cubemap;
import gleem.linalg.Mat4f;
import gleem.linalg.Rotf;
import java.io.IOException;
-import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GL;
-import javax.media.opengl.GL2ES1;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
@@ -56,7 +54,6 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLPbuffer;
import javax.media.opengl.glu.GLU;
-import com.jogamp.opengl.util.BufferUtil;
diff --git a/src/demos/readbuffer/Main.java b/src/demos/readbuffer/Main.java
index e5d87a9..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.sun.javafx.newt.*;
-import com.sun.javafx.newt.opengl.*;
+import com.jogamp.newt.*;
+import com.jogamp.newt.opengl.*;
public class Main implements WindowListener, MouseListener, SurfaceUpdatedListener {
diff --git a/src/demos/readbuffer/ReadBuffer2Screen.java b/src/demos/readbuffer/ReadBuffer2Screen.java
index 39a4a27..13e6508 100755
--- a/src/demos/readbuffer/ReadBuffer2Screen.java
+++ b/src/demos/readbuffer/ReadBuffer2Screen.java
@@ -38,15 +38,11 @@ import javax.media.opengl.*;
import javax.media.opengl.fixedfunc.*;
import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.util.glsl.fixedfunc.*;
import javax.media.opengl.fixedfunc.GLPointerFunc;
-import com.jogamp.opengl.util.texture.Texture;
-import com.jogamp.opengl.util.texture.TextureData;
import com.jogamp.opengl.util.texture.TextureCoords;
import com.jogamp.opengl.util.GLArrayDataClient;
import com.jogamp.opengl.util.GLArrayDataServer;
-import com.jogamp.opengl.util.BufferUtil;
public class ReadBuffer2Screen extends ReadBufferBase {
PMVMatrix pmvMatrix;
diff --git a/src/demos/readbuffer/ReadBufferBase.java b/src/demos/readbuffer/ReadBufferBase.java
index 53f2ba9..bb2d228 100755
--- a/src/demos/readbuffer/ReadBufferBase.java
+++ b/src/demos/readbuffer/ReadBufferBase.java
@@ -33,13 +33,8 @@
package demos.readbuffer;
-import java.nio.*;
import javax.media.opengl.*;
-import com.jogamp.opengl.util.texture.Texture;
-import com.jogamp.opengl.util.texture.TextureData;
-import com.jogamp.opengl.util.BufferUtil;
-
public class ReadBufferBase implements GLEventListener {
public boolean glDebug = false ;
diff --git a/src/demos/readbuffer/ReadBufferUtil.java b/src/demos/readbuffer/ReadBufferUtil.java
index 5cba034..85680c7 100755
--- a/src/demos/readbuffer/ReadBufferUtil.java
+++ b/src/demos/readbuffer/ReadBufferUtil.java
@@ -33,12 +33,12 @@
package demos.readbuffer;
+import com.jogamp.opengl.util.GLBuffers;
import java.nio.*;
import javax.media.opengl.*;
import com.jogamp.opengl.util.texture.Texture;
import com.jogamp.opengl.util.texture.TextureData;
-import com.jogamp.opengl.util.BufferUtil;
public class ReadBufferUtil {
protected int readPixelSizeLast = 0;
@@ -60,7 +60,7 @@ public class ReadBufferUtil {
int readPixelSize = drawable.getWidth() * drawable.getHeight() * 3 ; // RGB
boolean newData = false;
if(readPixelSize>readPixelSizeLast) {
- 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;