summaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/gluegen
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-01-13 07:29:23 +0000
committerKenneth Russel <[email protected]>2006-01-13 07:29:23 +0000
commit16e23f079b1e5fdc15b64bf1593cbda8e8dcffc0 (patch)
tree8cf430f395f2a2691d152c9a61ca212d7a6c1f55 /src/classes/com/sun/gluegen
parent688ffdc8cc190c51c3e7355a4893e3e475efa29f (diff)
Renamed com.sun.opengl.utils to com.sun.opengl.util. Moved
TextureIO-related classes to com.sun.opengl.util.texture and TextureProvider, TextureWriter and format-specific readers to com.sun.opengl.util.texture.spi. Renamed BufferUtils to BufferUtil. Added ImageUtil and FileUtil. Cleaned up javadoc. Updated demos. Cleaned up some imports. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@538 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/gluegen')
-rw-r--r--src/classes/com/sun/gluegen/runtime/BufferFactory.java33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/classes/com/sun/gluegen/runtime/BufferFactory.java b/src/classes/com/sun/gluegen/runtime/BufferFactory.java
index dd8856a43..ce46d145f 100644
--- a/src/classes/com/sun/gluegen/runtime/BufferFactory.java
+++ b/src/classes/com/sun/gluegen/runtime/BufferFactory.java
@@ -40,15 +40,14 @@
package com.sun.gluegen.runtime;
import java.nio.*;
-import com.sun.opengl.utils.BufferUtils;
public class BufferFactory {
-
- public static int SIZEOF_FLOAT = BufferUtils.SIZEOF_FLOAT;
- public static int SIZEOF_DOUBLE = BufferUtils.SIZEOF_DOUBLE;
- public static int SIZEOF_INT = BufferUtils.SIZEOF_INT;
- public static int SIZEOF_SHORT = BufferUtils.SIZEOF_SHORT;
- public static int SIZEOF_LONG = BufferUtils.SIZEOF_LONG;
+ public static final int SIZEOF_BYTE = 1;
+ public static final int SIZEOF_SHORT = 2;
+ public static final int SIZEOF_INT = 4;
+ public static final int SIZEOF_FLOAT = 4;
+ public static final int SIZEOF_LONG = 8;
+ public static final int SIZEOF_DOUBLE = 8;
public static ByteBuffer newDirectByteBuffer(int size) {
ByteBuffer buf = ByteBuffer.allocateDirect(size);
@@ -93,15 +92,15 @@ public class BufferFactory {
if(buf instanceof ByteBuffer) {
return (buf.position());
} else if (buf instanceof FloatBuffer) {
- return (buf.position() * BufferUtils.SIZEOF_FLOAT);
+ return (buf.position() * SIZEOF_FLOAT);
} else if (buf instanceof IntBuffer) {
- return (buf.position() * BufferUtils.SIZEOF_INT);
+ return (buf.position() * SIZEOF_INT);
} else if (buf instanceof ShortBuffer) {
- return (buf.position() * BufferUtils.SIZEOF_SHORT);
+ return (buf.position() * SIZEOF_SHORT);
} else if (buf instanceof DoubleBuffer) {
- return (buf.position() * BufferUtils.SIZEOF_DOUBLE);
+ return (buf.position() * SIZEOF_DOUBLE);
} else if (buf instanceof LongBuffer) {
- return (buf.position() * BufferUtils.SIZEOF_LONG);
+ return (buf.position() * SIZEOF_LONG);
}
throw new RuntimeException("Disallowed array backing store type in buffer "
@@ -148,15 +147,15 @@ public class BufferFactory {
if(buf instanceof ByteBuffer) {
return (((ByteBuffer)buf).arrayOffset() + pos);
} else if(buf instanceof FloatBuffer) {
- return (BufferUtils.SIZEOF_FLOAT*(((FloatBuffer)buf).arrayOffset() + pos));
+ return (SIZEOF_FLOAT*(((FloatBuffer)buf).arrayOffset() + pos));
} else if(buf instanceof IntBuffer) {
- return (BufferUtils.SIZEOF_INT*(((IntBuffer)buf).arrayOffset() + pos));
+ return (SIZEOF_INT*(((IntBuffer)buf).arrayOffset() + pos));
} else if(buf instanceof ShortBuffer) {
- return (BufferUtils.SIZEOF_SHORT*(((ShortBuffer)buf).arrayOffset() + pos));
+ return (SIZEOF_SHORT*(((ShortBuffer)buf).arrayOffset() + pos));
} else if(buf instanceof DoubleBuffer) {
- return (BufferUtils.SIZEOF_DOUBLE*(((DoubleBuffer)buf).arrayOffset() + pos));
+ return (SIZEOF_DOUBLE*(((DoubleBuffer)buf).arrayOffset() + pos));
} else if(buf instanceof LongBuffer) {
- return (BufferUtils.SIZEOF_LONG*(((LongBuffer)buf).arrayOffset() + pos));
+ return (SIZEOF_LONG*(((LongBuffer)buf).arrayOffset() + pos));
}
throw new RuntimeException("Unknown buffer type " + buf.getClass().getName());