summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-03-29 04:51:49 +0200
committerSven Gothel <[email protected]>2010-03-29 04:51:49 +0200
commit69fe372b874d913e2d1c27f1d103e1fced668ecf (patch)
treecf402337903ba3d02bbab628f2f82a23908a5f11
parent2138fc787c1e497be7f373aa68b3f751c955008f (diff)
parent2d76c16b9384d383d3e6a9d7cb727f2591a39228 (diff)
Resolved conflicts
-rwxr-xr-xdoc/manual/index.html2
-rw-r--r--make/runtest-cvm.bat4
-rw-r--r--make/runtest-cvm.sh8
-rw-r--r--make/runtest.sh8
-rwxr-xr-xnbproject/project.xml16
-rwxr-xr-xsrc/java/com/jogamp/gluegen/runtime/Buffers.java (renamed from src/java/com/jogamp/gluegen/runtime/BufferFactory.java)346
-rw-r--r--src/java/com/jogamp/gluegen/runtime/Int64Buffer.java6
-rwxr-xr-xsrc/java/com/jogamp/gluegen/runtime/Int64BufferME_CDC_FP.java4
-rw-r--r--src/java/com/jogamp/gluegen/runtime/Platform.java2
-rw-r--r--src/java/com/jogamp/gluegen/runtime/PointerBuffer.java6
-rwxr-xr-xsrc/java/com/jogamp/gluegen/runtime/PointerBufferME_CDC_FP.java4
-rw-r--r--src/java/com/jogamp/gluegen/runtime/StructAccessor.java4
-rw-r--r--src/java/com/sun/gluegen/JavaConfiguration.java6
-rw-r--r--src/java/com/sun/gluegen/JavaEmitter.java8
-rw-r--r--src/java/com/sun/gluegen/JavaMethodBindingEmitter.java36
-rwxr-xr-xsrc/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java34
-rwxr-xr-xsrc/java/com/sun/gluegen/opengl/GLConfiguration.java2
-rw-r--r--src/java/com/sun/gluegen/test/TestPointerBufferEndian.java2
-rw-r--r--src/java/com/sun/gluegen/test/TestStructAccessorEndian.java4
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/BaseTest1.java8
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/Test1p1JavaEmitter.java2
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/Test1p2ProcAddressEmitter.java2
-rw-r--r--test/junit/com/sun/gluegen/BasicTest.java4
23 files changed, 434 insertions, 84 deletions
diff --git a/doc/manual/index.html b/doc/manual/index.html
index 8fe51c0..6ac46ac 100755
--- a/doc/manual/index.html
+++ b/doc/manual/index.html
@@ -987,7 +987,7 @@ C APIs have corresponding Java classes emitted.
<dd>Syntax: <code>GlueGenRuntimePackage [package name, like com.jogamp.gluegen.runtime]</code> <br>
(optional) Changes the package in which the generated glue code
-expects to find its run-time helper classes (like BufferFactory, CPU,
+expects to find its run-time helper classes (like Buffers, CPU,
StructAccessor). Defaults to <CODE>com.jogamp.gluegen.runtime</CODE> (no
quotes). This is useful if you want to bundle the runtime classes in
your application without the possibility of interfering with other
diff --git a/make/runtest-cvm.bat b/make/runtest-cvm.bat
index 8178032..c0747d2 100644
--- a/make/runtest-cvm.bat
+++ b/make/runtest-cvm.bat
@@ -3,6 +3,6 @@ set CVM_HOME=c:\cvm
set JAR_DIR=jogl\lib
set LIB_DIR=jogl\lib
-%CVM_HOME%\bin\cvm "-Djava.awt.headless=true" "-Dsun.boot.library.path=%LIB_DIR%" "-Xbootclasspath/a:gluegen\classes-cdc" com.sun.gluegen.test.TestPointerBufferEndian
-%CVM_HOME%\bin\cvm "-Djava.awt.headless=true" "-Dsun.boot.library.path=%LIB_DIR%" "-Xbootclasspath/a:gluegen\classes-cdc" com.sun.gluegen.test.TestStructAccessorEndian
+%CVM_HOME%\bin\cvm "-Djava.awt.headless=true" "-Dsun.boot.library.path=%LIB_DIR%" "-Xbootclasspath/a:gluegen\classes-cdc" com.jogamp.gluegen.test.TestPointerBufferEndian
+%CVM_HOME%\bin\cvm "-Djava.awt.headless=true" "-Dsun.boot.library.path=%LIB_DIR%" "-Xbootclasspath/a:gluegen\classes-cdc" com.jogamp.gluegen.test.TestStructAccessorEndian
diff --git a/make/runtest-cvm.sh b/make/runtest-cvm.sh
index 268cf6e..0b29c07 100644
--- a/make/runtest-cvm.sh
+++ b/make/runtest-cvm.sh
@@ -11,9 +11,9 @@ if [ ! -x "$CVM" -o -z "$builddir" ] ; then
exit 1
fi
-echo com.sun.gluegen.test.TestPointerBufferEndian
-$CVM -Dsun.boot.library.path=$builddir/obj -Xbootclasspath/a:$builddir/classes-cdc com.sun.gluegen.test.TestPointerBufferEndian
+echo com.jogamp.gluegen.test.TestPointerBufferEndian
+$CVM -Dsun.boot.library.path=$builddir/obj -Xbootclasspath/a:$builddir/classes-cdc com.jogamp.gluegen.test.TestPointerBufferEndian
echo
-echo com.sun.gluegen.test.TestStructAccessorEndian
-$CVM -Dsun.boot.library.path=$builddir/obj -Xbootclasspath/a:$builddir/classes-cdc com.sun.gluegen.test.TestStructAccessorEndian
+echo com.jogamp.gluegen.test.TestStructAccessorEndian
+$CVM -Dsun.boot.library.path=$builddir/obj -Xbootclasspath/a:$builddir/classes-cdc com.jogamp.gluegen.test.TestStructAccessorEndian
echo
diff --git a/make/runtest.sh b/make/runtest.sh
index 8001c82..427f4f3 100644
--- a/make/runtest.sh
+++ b/make/runtest.sh
@@ -8,9 +8,9 @@ if [ -z "$builddir" ] ; then
exit 1
fi
-echo com.sun.gluegen.test.TestPointerBufferEndian
-java -Djava.library.path=$builddir/obj -classpath $builddir/classes com.sun.gluegen.test.TestPointerBufferEndian
+echo com.jogamp.gluegen.test.TestPointerBufferEndian
+java -Djava.library.path=$builddir/obj -classpath $builddir/classes com.jogamp.gluegen.test.TestPointerBufferEndian
echo
-echo com.sun.gluegen.test.TestStructAccessorEndian
-java -Djava.library.path=$builddir/obj -classpath $builddir/classes com.sun.gluegen.test.TestStructAccessorEndian
+echo com.jogamp.gluegen.test.TestStructAccessorEndian
+java -Djava.library.path=$builddir/obj -classpath $builddir/classes com.jogamp.gluegen.test.TestStructAccessorEndian
echo
diff --git a/nbproject/project.xml b/nbproject/project.xml
index 84bdc44..054a6bc 100755
--- a/nbproject/project.xml
+++ b/nbproject/project.xml
@@ -47,6 +47,12 @@
<location>build/test/gensrc/java</location>
<encoding>UTF-8</encoding>
</source-folder>
+ <source-folder>
+ <label>src/junit</label>
+ <type>java</type>
+ <location>src/junit</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
</folders>
<ide-actions>
<action name="build">
@@ -172,6 +178,10 @@
<label>build/test/gensrc/java</label>
<location>build/test/gensrc/java</location>
</source-folder>
+ <source-folder style="packages">
+ <label>src/junit</label>
+ <location>src/junit</location>
+ </source-folder>
<source-file>
<location>${ant.script}</location>
</source-file>
@@ -214,6 +224,12 @@
<unit-tests/>
<source-level>1.5</source-level>
</compilation-unit>
+ <compilation-unit>
+ <package-root>src/junit</package-root>
+ <unit-tests/>
+ <classpath mode="compile">build/classes:build/test/build/classes:lib/antlr-3.2.jar:${jdk.home}/lib/tools.jar:${ant.core.lib}:make/lib/junit-4.5.jar</classpath>
+ <source-level>1.5</source-level>
+ </compilation-unit>
</java-data>
<preferences xmlns="http://www.netbeans.org/ns/auxiliary-configuration-preferences/1">
<module name="org-netbeans-modules-editor-indent"/>
diff --git a/src/java/com/jogamp/gluegen/runtime/BufferFactory.java b/src/java/com/jogamp/gluegen/runtime/Buffers.java
index 9b52640..96c9430 100755
--- a/src/java/com/jogamp/gluegen/runtime/BufferFactory.java
+++ b/src/java/com/jogamp/gluegen/runtime/Buffers.java
@@ -45,7 +45,7 @@ import java.nio.*;
* @author Sven Gothel
* @author Michael Bien
*/
-public class BufferFactory {
+public class Buffers {
public static final int SIZEOF_BYTE = 1;
public static final int SIZEOF_SHORT = 2;
@@ -55,15 +55,153 @@ public class BufferFactory {
public static final int SIZEOF_LONG = 8;
public static final int SIZEOF_DOUBLE = 8;
- public static boolean isLittleEndian() {
- return Platform.isLittleEndian();
+ private Buffers() {}
+
+ /**
+ * Allocates a new direct ByteBuffer with the specified number of
+ * elements. The returned buffer will have its byte order set to
+ * the host platform's native byte order.
+ */
+ public static ByteBuffer newDirectByteBuffer(int numElements) {
+ return nativeOrder(ByteBuffer.allocateDirect(numElements));
+ }
+
+ public static ByteBuffer newDirectByteBuffer(byte[] values, int offset, int lenght) {
+ return (ByteBuffer)newDirectByteBuffer(lenght).put(values, offset, lenght).rewind();
+ }
+
+ public static ByteBuffer newDirectByteBuffer(byte[] values, int offset) {
+ return newDirectByteBuffer(values, offset, values.length-offset);
+ }
+
+ public static ByteBuffer newDirectByteBuffer(byte[] values) {
+ return newDirectByteBuffer(values, 0);
}
/**
- * Helper routine to create a direct ByteBuffer with native order
+ * Allocates a new direct DoubleBuffer with the specified number of
+ * elements. The returned buffer will have its byte order set to
+ * the host platform's native byte order.
*/
- public static ByteBuffer newDirectByteBuffer(int size) {
- return nativeOrder(ByteBuffer.allocateDirect(size));
+ public static DoubleBuffer newDirectDoubleBuffer(int numElements) {
+ return newDirectByteBuffer(numElements * SIZEOF_DOUBLE).asDoubleBuffer();
+ }
+
+ public static DoubleBuffer newDirectDoubleBuffer(double[] values, int offset, int lenght) {
+ return (DoubleBuffer)newDirectDoubleBuffer(lenght).put(values, offset, lenght).rewind();
+ }
+
+ public static DoubleBuffer newDirectDoubleBuffer(double[] values, int offset) {
+ return newDirectDoubleBuffer(values, offset, values.length - offset);
+ }
+
+ public static DoubleBuffer newDirectDoubleBuffer(double[] values) {
+ return newDirectDoubleBuffer(values, 0);
+ }
+
+ /**
+ * Allocates a new direct FloatBuffer with the specified number of
+ * elements. The returned buffer will have its byte order set to
+ * the host platform's native byte order.
+ */
+ public static FloatBuffer newDirectFloatBuffer(int numElements) {
+ return newDirectByteBuffer(numElements * SIZEOF_FLOAT).asFloatBuffer();
+ }
+
+ public static FloatBuffer newDirectFloatBuffer(float[] values, int offset, int lenght) {
+ return (FloatBuffer)newDirectFloatBuffer(lenght).put(values, offset, lenght).rewind();
+ }
+
+ public static FloatBuffer newDirectFloatBuffer(float[] values, int offset) {
+ return newDirectFloatBuffer(values, offset, values.length - offset);
+ }
+
+ public static FloatBuffer newDirectFloatBuffer(float[] values) {
+ return newDirectFloatBuffer(values, 0);
+ }
+
+ /**
+ * Allocates a new direct IntBuffer with the specified number of
+ * elements. The returned buffer will have its byte order set to
+ * the host platform's native byte order.
+ */
+ public static IntBuffer newDirectIntBuffer(int numElements) {
+ return newDirectByteBuffer(numElements * SIZEOF_INT).asIntBuffer();
+ }
+
+ public static IntBuffer newDirectIntBuffer(int[] values, int offset, int lenght) {
+ return (IntBuffer)newDirectIntBuffer(lenght).put(values, offset, lenght).rewind();
+ }
+
+ public static IntBuffer newDirectIntBuffer(int[] values, int offset) {
+ return newDirectIntBuffer(values, offset, values.length - offset);
+ }
+
+ public static IntBuffer newDirectIntBuffer(int[] values) {
+ return newDirectIntBuffer(values, 0);
+ }
+
+ /**
+ * Allocates a new direct LongBuffer with the specified number of
+ * elements. The returned buffer will have its byte order set to
+ * the host platform's native byte order.
+ */
+ public static LongBuffer newDirectLongBuffer(int numElements) {
+ return newDirectByteBuffer(numElements * SIZEOF_LONG).asLongBuffer();
+ }
+
+ public static LongBuffer newDirectLongBuffer(long[] values, int offset, int lenght) {
+ return (LongBuffer)newDirectLongBuffer(lenght).put(values, offset, lenght).rewind();
+ }
+
+ public static LongBuffer newDirectLongBuffer(long[] values, int offset) {
+ return newDirectLongBuffer(values, offset, values.length - offset);
+ }
+
+ public static LongBuffer newDirectLongBuffer(long[] values) {
+ return newDirectLongBuffer(values, 0);
+ }
+
+ /**
+ * Allocates a new direct ShortBuffer with the specified number of
+ * elements. The returned buffer will have its byte order set to
+ * the host platform's native byte order.
+ */
+ public static ShortBuffer newDirectShortBuffer(int numElements) {
+ return newDirectByteBuffer(numElements * SIZEOF_SHORT).asShortBuffer();
+ }
+
+ public static ShortBuffer newDirectShortBuffer(short[] values, int offset, int lenght) {
+ return (ShortBuffer)newDirectShortBuffer(lenght).put(values, offset, lenght).rewind();
+ }
+
+ public static ShortBuffer newDirectShortBuffer(short[] values, int offset) {
+ return newDirectShortBuffer(values, offset, values.length - offset);
+ }
+
+ public static ShortBuffer newDirectShortBuffer(short[] values) {
+ return newDirectShortBuffer(values, 0);
+ }
+
+ /**
+ * Allocates a new direct CharBuffer with the specified number of
+ * elements. The returned buffer will have its byte order set to
+ * the host platform's native byte order.
+ */
+ public static CharBuffer newDirectCharBuffer(int numElements) {
+ return newDirectByteBuffer(numElements * SIZEOF_SHORT).asCharBuffer();
+ }
+
+ public static CharBuffer newDirectCharBuffer(char[] values, int offset, int lenght) {
+ return (CharBuffer)newDirectCharBuffer(lenght).put(values, offset, lenght).rewind();
+ }
+
+ public static CharBuffer newDirectCharBuffer(char[] values, int offset) {
+ return newDirectCharBuffer(values, offset, values.length - offset);
+ }
+
+ public static CharBuffer newDirectCharBuffer(char[] values) {
+ return newDirectCharBuffer(values, 0);
}
/**
@@ -228,6 +366,201 @@ public class BufferFactory {
throw new RuntimeException("Unknown buffer type " + buf.getClass().getName());
}
+
+ //----------------------------------------------------------------------
+ // Copy routines (type-to-type)
+ //
+ /**
+ * Copies the <i>remaining</i> elements (as defined by
+ * <code>limit() - position()</code>) in the passed ByteBuffer into
+ * a newly-allocated direct ByteBuffer. The returned buffer will
+ * have its byte order set to the host platform's native byte
+ * order. The position of the newly-allocated buffer will be zero,
+ * and the position of the passed buffer is unchanged (though its
+ * mark is changed).
+ */
+ public static ByteBuffer copyByteBuffer(ByteBuffer orig) {
+ ByteBuffer dest = newDirectByteBuffer(orig.remaining());
+ dest.put(orig);
+ dest.rewind();
+ return dest;
+ }
+
+ /**
+ * Copies the <i>remaining</i> elements (as defined by
+ * <code>limit() - position()</code>) in the passed FloatBuffer
+ * into a newly-allocated direct FloatBuffer. The returned buffer
+ * will have its byte order set to the host platform's native byte
+ * order. The position of the newly-allocated buffer will be zero,
+ * and the position of the passed buffer is unchanged (though its
+ * mark is changed).
+ */
+ public static FloatBuffer copyFloatBuffer(FloatBuffer orig) {
+ return copyFloatBufferAsByteBuffer(orig).asFloatBuffer();
+ }
+
+ /**
+ * Copies the <i>remaining</i> elements (as defined by
+ * <code>limit() - position()</code>) in the passed IntBuffer
+ * into a newly-allocated direct IntBuffer. The returned buffer
+ * will have its byte order set to the host platform's native byte
+ * order. The position of the newly-allocated buffer will be zero,
+ * and the position of the passed buffer is unchanged (though its
+ * mark is changed).
+ */
+ public static IntBuffer copyIntBuffer(IntBuffer orig) {
+ return copyIntBufferAsByteBuffer(orig).asIntBuffer();
+ }
+
+ /**
+ * Copies the <i>remaining</i> elements (as defined by
+ * <code>limit() - position()</code>) in the passed ShortBuffer
+ * into a newly-allocated direct ShortBuffer. The returned buffer
+ * will have its byte order set to the host platform's native byte
+ * order. The position of the newly-allocated buffer will be zero,
+ * and the position of the passed buffer is unchanged (though its
+ * mark is changed).
+ */
+ public static ShortBuffer copyShortBuffer(ShortBuffer orig) {
+ return copyShortBufferAsByteBuffer(orig).asShortBuffer();
+ }
+
+ //----------------------------------------------------------------------
+ // Copy routines (type-to-ByteBuffer)
+ //
+ /**
+ * Copies the <i>remaining</i> elements (as defined by
+ * <code>limit() - position()</code>) in the passed FloatBuffer
+ * into a newly-allocated direct ByteBuffer. The returned buffer
+ * will have its byte order set to the host platform's native byte
+ * order. The position of the newly-allocated buffer will be zero,
+ * and the position of the passed buffer is unchanged (though its
+ * mark is changed).
+ */
+ public static ByteBuffer copyFloatBufferAsByteBuffer(FloatBuffer orig) {
+ ByteBuffer dest = newDirectByteBuffer(orig.remaining() * SIZEOF_FLOAT);
+ dest.asFloatBuffer().put(orig);
+ dest.rewind();
+ return dest;
+ }
+
+ /**
+ * Copies the <i>remaining</i> elements (as defined by
+ * <code>limit() - position()</code>) in the passed IntBuffer into
+ * a newly-allocated direct ByteBuffer. The returned buffer will
+ * have its byte order set to the host platform's native byte
+ * order. The position of the newly-allocated buffer will be zero,
+ * and the position of the passed buffer is unchanged (though its
+ * mark is changed).
+ */
+ public static ByteBuffer copyIntBufferAsByteBuffer(IntBuffer orig) {
+ ByteBuffer dest = newDirectByteBuffer(orig.remaining() * SIZEOF_INT);
+ dest.asIntBuffer().put(orig);
+ dest.rewind();
+ return dest;
+ }
+
+ /**
+ * Copies the <i>remaining</i> elements (as defined by
+ * <code>limit() - position()</code>) in the passed ShortBuffer
+ * into a newly-allocated direct ByteBuffer. The returned buffer
+ * will have its byte order set to the host platform's native byte
+ * order. The position of the newly-allocated buffer will be zero,
+ * and the position of the passed buffer is unchanged (though its
+ * mark is changed).
+ */
+ public static ByteBuffer copyShortBufferAsByteBuffer(ShortBuffer orig) {
+ ByteBuffer dest = newDirectByteBuffer(orig.remaining() * SIZEOF_SHORT);
+ dest.asShortBuffer().put(orig);
+ dest.rewind();
+ return dest;
+ }
+
+ //----------------------------------------------------------------------
+ // Conversion routines
+ //
+ public final static FloatBuffer getFloatBuffer(DoubleBuffer source) {
+ source.rewind();
+ FloatBuffer dest = newDirectFloatBuffer(source.limit());
+ while (source.hasRemaining()) {
+ dest.put((float) source.get());
+ }
+ return dest;
+ }
+
+ //----------------------------------------------------------------------
+ // Convenient put methods with generic target Buffer
+ //
+ public static Buffer put(Buffer dest, Buffer src) {
+ if ((dest instanceof ByteBuffer) && (src instanceof ByteBuffer)) {
+ return ((ByteBuffer) dest).put((ByteBuffer) src);
+ } else if ((dest instanceof ShortBuffer) && (src instanceof ShortBuffer)) {
+ return ((ShortBuffer) dest).put((ShortBuffer) src);
+ } else if ((dest instanceof IntBuffer) && (src instanceof IntBuffer)) {
+ return ((IntBuffer) dest).put((IntBuffer) src);
+ } else if ((dest instanceof FloatBuffer) && (src instanceof FloatBuffer)) {
+ return ((FloatBuffer) dest).put((FloatBuffer) src);
+ } else if (Platform.isJavaSE()) {
+ if ((dest instanceof LongBuffer) && (src instanceof LongBuffer)) {
+ return ((LongBuffer) dest).put((LongBuffer) src);
+ } else if ((dest instanceof DoubleBuffer) && (src instanceof DoubleBuffer)) {
+ return ((DoubleBuffer) dest).put((DoubleBuffer) src);
+ } else if ((dest instanceof CharBuffer) && (src instanceof CharBuffer)) {
+ return ((CharBuffer) dest).put((CharBuffer) src);
+ }
+ }
+ throw new RuntimeException("Incompatible Buffer classes: dest = " + dest.getClass().getName() + ", src = " + src.getClass().getName());
+ }
+
+ public static Buffer putb(Buffer dest, byte v) {
+ if (dest instanceof ByteBuffer) {
+ return ((ByteBuffer) dest).put(v);
+ } else if (dest instanceof ShortBuffer) {
+ return ((ShortBuffer) dest).put((short) v);
+ } else if (dest instanceof IntBuffer) {
+ return ((IntBuffer) dest).put((int) v);
+ } else {
+ throw new RuntimeException("Byte doesn't match Buffer Class: " + dest);
+ }
+ }
+
+ public static Buffer puts(Buffer dest, short v) {
+ if (dest instanceof ShortBuffer) {
+ return ((ShortBuffer) dest).put(v);
+ } else if (dest instanceof IntBuffer) {
+ return ((IntBuffer) dest).put((int) v);
+ } else {
+ throw new RuntimeException("Short doesn't match Buffer Class: " + dest);
+ }
+ }
+
+ public static void puti(Buffer dest, int v) {
+ if (dest instanceof IntBuffer) {
+ ((IntBuffer) dest).put(v);
+ } else {
+ throw new RuntimeException("Integer doesn't match Buffer Class: " + dest);
+ }
+ }
+
+ public static void putf(Buffer dest, float v) {
+ if (dest instanceof FloatBuffer) {
+ ((FloatBuffer) dest).put(v);
+/* TODO FixedPoint required
+ } else if (dest instanceof IntBuffer) {
+ ((IntBuffer) dest).put(FixedPoint.toFixed(v));
+*/
+ } else {
+ throw new RuntimeException("Float doesn't match Buffer Class: " + dest);
+ }
+ }
+ public static void putd(Buffer dest, double v) {
+ if (dest instanceof FloatBuffer) {
+ ((FloatBuffer) dest).put((float) v);
+ } else {
+ throw new RuntimeException("Double doesn't match Buffer Class: " + dest);
+ }
+ }
+
public static void rangeCheck(byte[] array, int offset, int minElementsRemaining) {
if (array == null) {
return;
@@ -344,4 +677,5 @@ public class BufferFactory {
throw new IndexOutOfBoundsException("Required " + minBytesRemaining + " remaining bytes in buffer, only had " + bytesRemaining);
}
}
+
}
diff --git a/src/java/com/jogamp/gluegen/runtime/Int64Buffer.java b/src/java/com/jogamp/gluegen/runtime/Int64Buffer.java
index ad218bc..5f7cc33 100644
--- a/src/java/com/jogamp/gluegen/runtime/Int64Buffer.java
+++ b/src/java/com/jogamp/gluegen/runtime/Int64Buffer.java
@@ -58,9 +58,9 @@ public abstract class Int64Buffer {
public static Int64Buffer allocateDirect(int size) {
if (Platform.isJavaSE()) {
- return new Int64BufferSE(BufferFactory.newDirectByteBuffer(elementSize() * size));
+ return new Int64BufferSE(Buffers.newDirectByteBuffer(elementSize() * size));
} else {
- return new Int64BufferME_CDC_FP(BufferFactory.newDirectByteBuffer(elementSize() * size));
+ return new Int64BufferME_CDC_FP(Buffers.newDirectByteBuffer(elementSize() * size));
}
}
@@ -87,7 +87,7 @@ public abstract class Int64Buffer {
}
public static int elementSize() {
- return BufferFactory.SIZEOF_LONG;
+ return Buffers.SIZEOF_LONG;
}
public int limit() {
diff --git a/src/java/com/jogamp/gluegen/runtime/Int64BufferME_CDC_FP.java b/src/java/com/jogamp/gluegen/runtime/Int64BufferME_CDC_FP.java
index ec43897..cedb737 100755
--- a/src/java/com/jogamp/gluegen/runtime/Int64BufferME_CDC_FP.java
+++ b/src/java/com/jogamp/gluegen/runtime/Int64BufferME_CDC_FP.java
@@ -62,7 +62,7 @@ final class Int64BufferME_CDC_FP extends Int64Buffer {
idx = idx << 1; // 8-byte to 4-byte offset
long lo = 0x00000000FFFFFFFFL & ((long) pb.get(idx));
long hi = 0x00000000FFFFFFFFL & ((long) pb.get(idx + 1));
- if (BufferFactory.isLittleEndian()) {
+ if (Platform.isLittleEndian()) {
return hi << 32 | lo;
}
return lo << 32 | hi;
@@ -76,7 +76,7 @@ final class Int64BufferME_CDC_FP extends Int64Buffer {
idx = idx << 1; // 8-byte to 4-byte offset
int lo = (int) ((v) & 0x00000000FFFFFFFFL);
int hi = (int) ((v >> 32) & 0x00000000FFFFFFFFL);
- if (BufferFactory.isLittleEndian()) {
+ if (Platform.isLittleEndian()) {
pb.put(idx, lo);
pb.put(idx + 1, hi);
} else {
diff --git a/src/java/com/jogamp/gluegen/runtime/Platform.java b/src/java/com/jogamp/gluegen/runtime/Platform.java
index e4090c4..a621279 100644
--- a/src/java/com/jogamp/gluegen/runtime/Platform.java
+++ b/src/java/com/jogamp/gluegen/runtime/Platform.java
@@ -107,7 +107,7 @@ public class Platform {
JAVA_SE = se;
// byte order
- ByteBuffer tst_b = BufferFactory.newDirectByteBuffer(BufferFactory.SIZEOF_INT); // 32bit in native order
+ ByteBuffer tst_b = Buffers.newDirectByteBuffer(Buffers.SIZEOF_INT); // 32bit in native order
IntBuffer tst_i = tst_b.asIntBuffer();
ShortBuffer tst_s = tst_b.asShortBuffer();
tst_i.put(0, 0x0A0B0C0D);
diff --git a/src/java/com/jogamp/gluegen/runtime/PointerBuffer.java b/src/java/com/jogamp/gluegen/runtime/PointerBuffer.java
index 8e30ed8..a89dace 100644
--- a/src/java/com/jogamp/gluegen/runtime/PointerBuffer.java
+++ b/src/java/com/jogamp/gluegen/runtime/PointerBuffer.java
@@ -62,9 +62,9 @@ public abstract class PointerBuffer {
public static PointerBuffer allocateDirect(int size) {
if (Platform.isJavaSE()) {
- return new PointerBufferSE(BufferFactory.newDirectByteBuffer(elementSize() * size));
+ return new PointerBufferSE(Buffers.newDirectByteBuffer(elementSize() * size));
} else {
- return new PointerBufferME_CDC_FP(BufferFactory.newDirectByteBuffer(elementSize() * size));
+ return new PointerBufferME_CDC_FP(Buffers.newDirectByteBuffer(elementSize() * size));
}
}
@@ -91,7 +91,7 @@ public abstract class PointerBuffer {
}
public static int elementSize() {
- return Platform.is32Bit() ? BufferFactory.SIZEOF_INT : BufferFactory.SIZEOF_LONG;
+ return Platform.is32Bit() ? Buffers.SIZEOF_INT : Buffers.SIZEOF_LONG;
}
public int limit() {
diff --git a/src/java/com/jogamp/gluegen/runtime/PointerBufferME_CDC_FP.java b/src/java/com/jogamp/gluegen/runtime/PointerBufferME_CDC_FP.java
index 0ae7af6..1134ee7 100755
--- a/src/java/com/jogamp/gluegen/runtime/PointerBufferME_CDC_FP.java
+++ b/src/java/com/jogamp/gluegen/runtime/PointerBufferME_CDC_FP.java
@@ -65,7 +65,7 @@ final class PointerBufferME_CDC_FP extends PointerBuffer {
idx = idx << 1; // 8-byte to 4-byte offset
long lo = 0x00000000FFFFFFFFL & ((long) pb.get(idx));
long hi = 0x00000000FFFFFFFFL & ((long) pb.get(idx + 1));
- if (BufferFactory.isLittleEndian()) {
+ if (Platform.isLittleEndian()) {
return hi << 32 | lo;
}
return lo << 32 | hi;
@@ -83,7 +83,7 @@ final class PointerBufferME_CDC_FP extends PointerBuffer {
idx = idx << 1; // 8-byte to 4-byte offset
int lo = (int) ((v) & 0x00000000FFFFFFFFL);
int hi = (int) ((v >> 32) & 0x00000000FFFFFFFFL);
- if (BufferFactory.isLittleEndian()) {
+ if (Platform.isLittleEndian()) {
pb.put(idx, lo);
pb.put(idx + 1, hi);
} else {
diff --git a/src/java/com/jogamp/gluegen/runtime/StructAccessor.java b/src/java/com/jogamp/gluegen/runtime/StructAccessor.java
index 80673a3..6f3ad7d 100644
--- a/src/java/com/jogamp/gluegen/runtime/StructAccessor.java
+++ b/src/java/com/jogamp/gluegen/runtime/StructAccessor.java
@@ -251,7 +251,7 @@ public class StructAccessor {
IntBuffer intBuffer = intBuffer();
long lo = 0x00000000FFFFFFFFL & ((long) intBuffer.get(slot));
long hi = 0x00000000FFFFFFFFL & ((long) intBuffer.get(slot + 1));
- if (BufferFactory.isLittleEndian()) {
+ if (Platform.isLittleEndian()) {
return hi << 32 | lo;
}
return lo << 32 | hi;
@@ -262,7 +262,7 @@ public class StructAccessor {
IntBuffer intBuffer = intBuffer();
int lo = (int) ((v) & 0x00000000FFFFFFFFL);
int hi = (int) ((v >> 32) & 0x00000000FFFFFFFFL);
- if (BufferFactory.isLittleEndian()) {
+ if (Platform.isLittleEndian()) {
intBuffer.put(slot, lo);
intBuffer.put(slot + 1, hi);
} else {
diff --git a/src/java/com/sun/gluegen/JavaConfiguration.java b/src/java/com/sun/gluegen/JavaConfiguration.java
index 9f5686b..e0a0eb6 100644
--- a/src/java/com/sun/gluegen/JavaConfiguration.java
+++ b/src/java/com/sun/gluegen/JavaConfiguration.java
@@ -104,7 +104,7 @@ public class JavaConfiguration {
/**
* The package in which the generated glue code expects to find its
- * run-time helper classes (BufferFactory, Platform,
+ * run-time helper classes (Buffers, Platform,
* StructAccessor). Defaults to "com.jogamp.gluegen.runtime".
*/
private String gluegenRuntimePackage = "com.jogamp.gluegen.runtime";
@@ -308,7 +308,7 @@ public class JavaConfiguration {
}
/** Returns the package in which the generated glue code expects to
- find its run-time helper classes (BufferFactory, Platform,
+ find its run-time helper classes (Buffers, Platform,
StructAccessor). Defaults to "com.jogamp.gluegen.runtime". */
public String gluegenRuntimePackage() {
return gluegenRuntimePackage;
@@ -1500,7 +1500,7 @@ public class JavaConfiguration {
restOfLine = restOfLine.trim();
// Construct a JavaPrologue for this
addJavaPrologueOrEpilogue(functionName,
- "BufferFactory.rangeCheck" +
+ "Buffers.rangeCheck" +
(inBytes ? "Bytes" : "") +
"({" + argNum + "}, " + restOfLine + ");",
true);
diff --git a/src/java/com/sun/gluegen/JavaEmitter.java b/src/java/com/sun/gluegen/JavaEmitter.java
index e283fcb..0a92735 100644
--- a/src/java/com/sun/gluegen/JavaEmitter.java
+++ b/src/java/com/sun/gluegen/JavaEmitter.java
@@ -693,10 +693,10 @@ public class JavaEmitter implements GlueEmitter {
// public void fooMethod(Buffer arg) {
// ... bounds checks, etc. ...
//
- // boolean arg_direct = arg != null && BufferFactory.isDirect(arg);
+ // boolean arg_direct = arg != null && Buffers.isDirect(arg);
//
- // fooMethod1(arg_direct?arg:BufferFactory.getArray(arg),
- // arg_direct?BufferFactory.getDirectBufferByteOffset(arg):BufferFactory.getIndirectBufferByteOffset(arg),
+ // fooMethod0(arg_direct?arg:Buffers.getArray(arg),
+ // arg_direct?Buffers.getDirectBufferByteOffset(arg):Buffers.getIndirectBufferByteOffset(arg),
// arg_direct,
// ... );
// }
@@ -923,7 +923,7 @@ public class JavaEmitter implements GlueEmitter {
writer.println();
if (doBaseClass) {
writer.println(" public static " + containingTypeName + " create() {");
- writer.println(" return create(BufferFactory.newDirectByteBuffer(size()));");
+ writer.println(" return create(Buffers.newDirectByteBuffer(size()));");
writer.println(" }");
writer.println();
writer.println(" public static " + containingTypeName + " create(java.nio.ByteBuffer buf) {");
diff --git a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
index b992fcc..b5b5b9c 100644
--- a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
+++ b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
@@ -450,12 +450,12 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
JavaType javaType = binding.getJavaArgumentType(i);
if (javaType.isNIOBuffer()) {
if (directNIOOnly) {
- writer.println(" if (!BufferFactory.isDirect(" + getArgumentName(i) + "))");
+ writer.println(" if (!Buffers.isDirect(" + getArgumentName(i) + "))");
writer.println(" throw new " + getRuntimeExceptionType() + "(\"Argument \\\"" +
getArgumentName(i) + "\\\" was not a direct buffer\");");
} else {
writer.print(" boolean " + isNIOArgName(i) + " = ");
- writer.println(getArgumentName(i) + " != null && BufferFactory.isDirect(" + getArgumentName(i) + ");");
+ writer.println(getArgumentName(i) + " != null && Buffers.isDirect(" + getArgumentName(i) + ");");
}
} else if (javaType.isNIOBufferArray()) {
// All buffers passed down in an array of NIO buffers must be direct
@@ -465,13 +465,13 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
// Check direct buffer properties of all buffers within
writer.println(" if (" + argName + " != null) {");
writer.println(" for (int _ctr = 0; _ctr < " + argName + ".length; _ctr++) {");
- writer.println(" if (!BufferFactory.isDirect(" + argName + "[_ctr])) {");
+ writer.println(" if (!Buffers.isDirect(" + argName + "[_ctr])) {");
writer.println(" throw new " + getRuntimeExceptionType() +
"(\"Element \" + _ctr + \" of argument \\\"" +
getArgumentName(i) + "\\\" was not a direct buffer\");");
writer.println(" }");
// get the Buffer Array offset values and save them into another array to send down to JNI
- writer.print (" " + arrayName + "[_ctr] = BufferFactory.getDirectBufferByteOffset(");
+ writer.print (" " + arrayName + "[_ctr] = Buffers.getDirectBufferByteOffset(");
writer.println(argName + "[_ctr]);");
writer.println(" }");
writer.println(" }");
@@ -594,13 +594,13 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
writer.print( getArgumentName(i)+ " != null ? " + getArgumentName(i) + ".getBuffer() : null");
} else {
writer.print( isNIOArgName(i) + " ? ( " + getArgumentName(i)+ " != null ? " + getArgumentName(i) + ".getBuffer() : null )");
- writer.print( " : BufferFactory.getArray(" + getArgumentName(i) + ")" );
+ writer.print( " : Buffers.getArray(" + getArgumentName(i) + ")" );
}
} else {
if (directNIOOnly) {
writer.print( getArgumentName(i) );
} else {
- writer.print( isNIOArgName(i) + " ? " + getArgumentName(i) + " : BufferFactory.getArray(" + getArgumentName(i) + ")" );
+ writer.print( isNIOArgName(i) + " ? " + getArgumentName(i) + " : Buffers.getArray(" + getArgumentName(i) + ")" );
}
}
} else if (type.isArrayOfCompoundTypeWrappers()) {
@@ -617,26 +617,26 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
if (type.isNIOBuffer()) {
if (directNIOOnly) {
- writer.print( ", BufferFactory.getDirectBufferByteOffset(" + getArgumentName(i) + ")");
+ writer.print( ", Buffers.getDirectBufferByteOffset(" + getArgumentName(i) + ")");
} else {
- writer.print( ", " + isNIOArgName(i) + " ? BufferFactory.getDirectBufferByteOffset(" + getArgumentName(i) + ")");
- writer.print( " : BufferFactory.getIndirectBufferByteOffset(" + getArgumentName(i) + ")");
+ writer.print( ", " + isNIOArgName(i) + " ? Buffers.getDirectBufferByteOffset(" + getArgumentName(i) + ")");
+ writer.print( " : Buffers.getIndirectBufferByteOffset(" + getArgumentName(i) + ")");
}
} else if (type.isNIOBufferArray()) {
writer.print(", " + byteOffsetArrayArgName(i));
} else if (type.isPrimitiveArray()) {
if(type.isFloatArray()) {
- writer.print(", BufferFactory.SIZEOF_FLOAT * ");
+ writer.print(", Buffers.SIZEOF_FLOAT * ");
} else if(type.isDoubleArray()) {
- writer.print(", BufferFactory.SIZEOF_DOUBLE * ");
+ writer.print(", Buffers.SIZEOF_DOUBLE * ");
} else if(type.isByteArray()) {
writer.print(", ");
} else if(type.isLongArray()) {
- writer.print(", BufferFactory.SIZEOF_LONG * ");
+ writer.print(", Buffers.SIZEOF_LONG * ");
} else if(type.isShortArray()) {
- writer.print(", BufferFactory.SIZEOF_SHORT * ");
+ writer.print(", Buffers.SIZEOF_SHORT * ");
} else if(type.isIntArray()) {
- writer.print(", BufferFactory.SIZEOF_INT * ");
+ writer.print(", Buffers.SIZEOF_INT * ");
} else {
throw new RuntimeException("Unsupported type for calculating array offset argument for " +
getArgumentName(i) +
@@ -695,9 +695,9 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
String fmt = getReturnedArrayLengthExpression();
writer.println(" if (_res == null) return null;");
if (fmt == null) {
- writer.print(" return " + returnType.getName() + ".create(BufferFactory.nativeOrder(_res))");
+ writer.print(" return " + returnType.getName() + ".create(Buffers.nativeOrder(_res))");
} else {
- writer.println(" BufferFactory.nativeOrder(_res);");
+ writer.println(" Buffers.nativeOrder(_res);");
String expr = new MessageFormat(fmt).format(argumentNameArray());
PointerType cReturnTypePointer = binding.getCReturnType().asPointer();
CompoundType cReturnType = null;
@@ -716,7 +716,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
writer.println(" _res.position(_count * " + getReturnTypeString(true) + ".size());");
writer.println(" _res.limit ((1 + _count) * " + getReturnTypeString(true) + ".size());");
writer.println(" java.nio.ByteBuffer _tmp = _res.slice();");
- writer.println(" BufferFactory.nativeOrder(_tmp);");
+ writer.println(" Buffers.nativeOrder(_tmp);");
writer.println(" _res.position(0);");
writer.println(" _res.limit(_res.capacity());");
writer.println(" _retarray[_count] = " + getReturnTypeString(true) + ".create(_tmp);");
@@ -726,7 +726,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
writer.println(";");
} else if (returnType.isNIOBuffer()) {
writer.println(" if (_res == null) return null;");
- writer.println(" BufferFactory.nativeOrder(_res);");
+ writer.println(" Buffers.nativeOrder(_res);");
if (!returnType.isNIOByteBuffer()) {
// See whether we have to expand pointers to longs
if (getBinding().getCReturnType().pointerDepth() >= 2) {
diff --git a/src/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java b/src/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java
index 63d95fe..b4dc130 100755
--- a/src/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java
+++ b/src/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java
@@ -146,10 +146,10 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
if (type.isNIOBuffer() && !directNIOOnly) {
// Emit declarations for variables holding primitive arrays as type Object
// We don't know 100% sure we're going to use these at this point in the code, though
- writer.println(" Object " + getNIOBufferArrayName(i) + " = (_direct ? null : BufferFactory.getArray(" +
+ writer.println(" Object " + getNIOBufferArrayName(i) + " = (_direct ? null : Buffers.getArray(" +
getArgumentName(i) + "));");
} else if (type.isString()) {
- writer.println(" long " + binding.getArgumentName(i) + "_c_str = BufferFactoryInternal.newCString(" + binding.getArgumentName(i) + ");");
+ writer.println(" long " + binding.getArgumentName(i) + "_c_str = BuffersInternal.newCString(" + binding.getArgumentName(i) + ");");
}
// FIXME: going to need more of these for Buffer[] and String[], at least
}
@@ -275,9 +275,9 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
if (needsResultAssignment) {
writer.print(" _res = ");
if (returnType.isString()) {
- writer.print("BufferFactoryInternal.newJavaString(");
+ writer.print("BuffersInternal.newJavaString(");
} else if (returnType.isNIOByteBuffer()) {
- writer.print("BufferFactoryInternal.newDirectByteBuffer(");
+ writer.print("BuffersInternal.newDirectByteBuffer(");
}
} else {
writer.print(" ");
@@ -352,7 +352,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
if (binding.hasContainingType()) {
// Emit this pointer
assert(binding.getContainingType().isCompoundTypeWrapper());
- writer.print("BufferFactoryInternal.getDirectBufferAddress(");
+ writer.print("BuffersInternal.getDirectBufferAddress(");
writer.print("getBuffer()");
writer.print(")");
needComma = true;
@@ -377,7 +377,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
}
if (type.isCompoundTypeWrapper()) {
- writer.print("BufferFactoryInternal.getDirectBufferAddress(");
+ writer.print("BuffersInternal.getDirectBufferAddress(");
writer.print("((");
}
@@ -385,7 +385,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
if (!direct) {
writer.print(getNIOBufferArrayName(i));
} else {
- writer.print("BufferFactoryInternal.getDirectBufferAddress(");
+ writer.print("BuffersInternal.getDirectBufferAddress(");
writer.print(getArgumentName(i));
writer.print(")");
}
@@ -402,11 +402,11 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
if (type.isNIOBuffer()) {
if (direct) {
- writer.print("+ BufferFactory.getDirectBufferByteOffset(" + getArgumentName(i) + ")");
+ writer.print("+ Buffers.getDirectBufferByteOffset(" + getArgumentName(i) + ")");
} else {
- writer.print(", BufferFactoryInternal.arrayBaseOffset(" +
+ writer.print(", BuffersInternal.arrayBaseOffset(" +
getNIOBufferArrayName(i) +
- ") + BufferFactory.getIndirectBufferByteOffset(" + getArgumentName(i) + ")");
+ ") + Buffers.getIndirectBufferByteOffset(" + getArgumentName(i) + ")");
}
} else if (type.isNIOBufferArray()) {
writer.print(", " + byteOffsetArrayArgName(i));
@@ -415,19 +415,19 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
// Add Array offset parameter for primitive arrays
if (type.isPrimitiveArray()) {
writer.print(", ");
- writer.print("BufferFactoryInternal.arrayBaseOffset(" + getArgumentName(i) + ") + ");
+ writer.print("BuffersInternal.arrayBaseOffset(" + getArgumentName(i) + ") + ");
if(type.isFloatArray()) {
- writer.print("BufferFactory.SIZEOF_FLOAT * ");
+ writer.print("Buffers.SIZEOF_FLOAT * ");
} else if(type.isDoubleArray()) {
- writer.print("BufferFactory.SIZEOF_DOUBLE * ");
+ writer.print("Buffers.SIZEOF_DOUBLE * ");
} else if(type.isByteArray()) {
writer.print("1 * ");
} else if(type.isLongArray()) {
- writer.print("BufferFactory.SIZEOF_LONG * ");
+ writer.print("Buffers.SIZEOF_LONG * ");
} else if(type.isShortArray()) {
- writer.print("BufferFactory.SIZEOF_SHORT * ");
+ writer.print("Buffers.SIZEOF_SHORT * ");
} else if(type.isIntArray()) {
- writer.print("BufferFactory.SIZEOF_INT * ");
+ writer.print("Buffers.SIZEOF_INT * ");
} else {
throw new RuntimeException("Unsupported type for calculating array offset argument for " +
getArgumentName(i) +
@@ -455,7 +455,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
JavaType type = binding.getJavaArgumentType(i);
if (type.isString()) {
writer.println(";");
- writer.println(" BufferFactoryInternal.freeCString(" + binding.getArgumentName(i) + "_c_str);");
+ writer.println(" BuffersInternal.freeCString(" + binding.getArgumentName(i) + "_c_str);");
}
// FIXME: will need more of these cleanups for things like Buffer[] and String[] (see above)
}
diff --git a/src/java/com/sun/gluegen/opengl/GLConfiguration.java b/src/java/com/sun/gluegen/opengl/GLConfiguration.java
index 19cf85a..6d08a10 100755
--- a/src/java/com/sun/gluegen/opengl/GLConfiguration.java
+++ b/src/java/com/sun/gluegen/opengl/GLConfiguration.java
@@ -173,7 +173,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
if (emitter.isBufferObjectMethodBinding(binding)) {
for (Iterator<String> iter = res.iterator(); iter.hasNext(); ) {
String line = iter.next();
- if (line.indexOf("BufferFactory.rangeCheck") >= 0) {
+ if (line.indexOf("Buffers.rangeCheck") >= 0) {
iter.remove();
}
}
diff --git a/src/java/com/sun/gluegen/test/TestPointerBufferEndian.java b/src/java/com/sun/gluegen/test/TestPointerBufferEndian.java
index 9377de7..96e4e87 100644
--- a/src/java/com/sun/gluegen/test/TestPointerBufferEndian.java
+++ b/src/java/com/sun/gluegen/test/TestPointerBufferEndian.java
@@ -14,7 +14,7 @@ public class TestPointerBufferEndian {
String cpu = System.getProperty("os.arch");
System.out.println("OS: <"+os+"> CPU: <"+cpu+"> Bits: <"+bitsPtr+"/"+bitsProp+">");
System.out.println("CPU is: "+ (Platform.is32Bit()?"32":"64") + " bit");
- System.out.println("Buffer is in: "+ (BufferFactory.isLittleEndian()?"little":"big") + " endian");
+ System.out.println("Buffer is in: "+ (Platform.isLittleEndian()?"little":"big") + " endian");
PointerBuffer ptr = direct ? PointerBuffer.allocateDirect(3) : PointerBuffer.allocate(3);
ptr.put(0, 0x0123456789ABCDEFL);
ptr.put(1, 0x8877665544332211L);
diff --git a/src/java/com/sun/gluegen/test/TestStructAccessorEndian.java b/src/java/com/sun/gluegen/test/TestStructAccessorEndian.java
index 9d288b4..7202056 100644
--- a/src/java/com/sun/gluegen/test/TestStructAccessorEndian.java
+++ b/src/java/com/sun/gluegen/test/TestStructAccessorEndian.java
@@ -13,8 +13,8 @@ public class TestStructAccessorEndian {
String cpu = System.getProperty("os.arch");
System.out.println("OS: <"+os+"> CPU: <"+cpu+"> Bits: <"+bitsPtr+"/"+bitsProp+">");
System.out.println("CPU is: "+ (Platform.is32Bit()?"32":"64") + " bit");
- System.out.println("Buffer is in: "+ (BufferFactory.isLittleEndian()?"little":"big") + " endian");
- ByteBuffer tst = BufferFactory.newDirectByteBuffer(BufferFactory.SIZEOF_LONG * 3);
+ System.out.println("Buffer is in: "+ (Platform.isLittleEndian()?"little":"big") + " endian");
+ ByteBuffer tst = Buffers.newDirectByteBuffer(Buffers.SIZEOF_LONG * 3);
StructAccessor acc = new StructAccessor(tst);
acc.setLongAt(0, 0x0123456789ABCDEFL);
acc.setLongAt(1, 0x8877665544332211L);
diff --git a/src/junit/com/jogamp/gluegen/test/junit/BaseTest1.java b/src/junit/com/jogamp/gluegen/test/junit/BaseTest1.java
index f030459..c53d142 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/BaseTest1.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/BaseTest1.java
@@ -32,7 +32,7 @@
package com.jogamp.gluegen.test.junit;
-import com.jogamp.gluegen.runtime.BufferFactory;
+import com.jogamp.gluegen.runtime.Buffers;
import com.jogamp.gluegen.runtime.PointerBuffer;
import com.jogamp.gluegen.runtime.Int64Buffer;
import java.nio.*;
@@ -144,11 +144,11 @@ public class BaseTest1 {
Int64Buffer lb = Int64Buffer.allocateDirect(1);
lb.put(0, 10);
- ByteBuffer bb2 = BufferFactory.newDirectByteBuffer(BufferFactory.SIZEOF_LONG);
+ ByteBuffer bb2 = Buffers.newDirectByteBuffer(Buffers.SIZEOF_LONG);
Int64Buffer bb2L = Int64Buffer.wrap(bb2);
bb2L.put(0, 100);
- IntBuffer ib1 = BufferFactory.newDirectByteBuffer(BufferFactory.SIZEOF_INT * BindingTest1.ARRAY_SIZE).asIntBuffer();
+ IntBuffer ib1 = Buffers.newDirectByteBuffer(Buffers.SIZEOF_INT * BindingTest1.ARRAY_SIZE).asIntBuffer();
for(i=0; i<BindingTest1.ARRAY_SIZE; i++) {
ib1.put(i, 1000);
}
@@ -237,7 +237,7 @@ public class BaseTest1 {
i = binding.stringArrayRead(new String[] { "1234", "5678", "9a" }, 3);
Assert.assertTrue("Wrong result: "+i, 10==i);
- ByteBuffer bb3 = BufferFactory.newDirectByteBuffer(BufferFactory.SIZEOF_INT * 3);
+ ByteBuffer bb3 = Buffers.newDirectByteBuffer(Buffers.SIZEOF_INT * 3);
IntBuffer ib = bb3.asIntBuffer();
ib.put(0, 1);
ib.put(1, 2);
diff --git a/src/junit/com/jogamp/gluegen/test/junit/Test1p1JavaEmitter.java b/src/junit/com/jogamp/gluegen/test/junit/Test1p1JavaEmitter.java
index 0438a76..54d82f9 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/Test1p1JavaEmitter.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/Test1p1JavaEmitter.java
@@ -34,7 +34,7 @@ package com.jogamp.gluegen.test.junit;
import com.jogamp.gluegen.test.junit.impl.BindingTest1p1Impl;
-import com.jogamp.gluegen.runtime.BufferFactory;
+import com.jogamp.gluegen.runtime.Buffers;
import com.jogamp.gluegen.runtime.PointerBuffer;
import java.nio.*;
import java.io.File;
diff --git a/src/junit/com/jogamp/gluegen/test/junit/Test1p2ProcAddressEmitter.java b/src/junit/com/jogamp/gluegen/test/junit/Test1p2ProcAddressEmitter.java
index 53ea5c8..3bf90e9 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/Test1p2ProcAddressEmitter.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/Test1p2ProcAddressEmitter.java
@@ -34,7 +34,7 @@ package com.jogamp.gluegen.test.junit;
import com.jogamp.gluegen.test.junit.impl.BindingTest1p2Impl;
-import com.jogamp.gluegen.runtime.BufferFactory;
+import com.jogamp.gluegen.runtime.Buffers;
import com.jogamp.gluegen.runtime.PointerBuffer;
import com.jogamp.gluegen.runtime.NativeLibrary;
import com.jogamp.gluegen.runtime.DynamicLookupHelper;
diff --git a/test/junit/com/sun/gluegen/BasicTest.java b/test/junit/com/sun/gluegen/BasicTest.java
index c09fe60..a12cc76 100644
--- a/test/junit/com/sun/gluegen/BasicTest.java
+++ b/test/junit/com/sun/gluegen/BasicTest.java
@@ -1,6 +1,6 @@
package com.sun.gluegen;
-import com.jogamp.gluegen.runtime.BufferFactory;
+import com.jogamp.gluegen.runtime.Buffers;
import com.jogamp.gluegen.runtime.PointerBuffer;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -55,7 +55,7 @@ public class BasicTest {
// TODO fix Exception: ...Caused by: java.lang.UnsatisfiedLinkError: test.BindingTest.arrayTest0(JLjava/lang/Object;I)I
/*
// test values
- ByteBuffer dbb = BufferFactory.newDirectByteBuffer(32);
+ ByteBuffer dbb = Buffers.newDirectByteBuffer(32);
ByteBuffer bb = ByteBuffer.allocate(32).order(ByteOrder.nativeOrder());
PointerBuffer dpb = PointerBuffer.allocateDirect(32);