net.java.games.jogl.util
Class BufferUtils

java.lang.Object
  extended by net.java.games.jogl.util.BufferUtils

public class BufferUtils
extends java.lang.Object

Utility routines for dealing with direct buffers.


Field Summary
static int SIZEOF_DOUBLE
           
static int SIZEOF_FLOAT
           
static int SIZEOF_INT
           
 
Constructor Summary
BufferUtils()
           
 
Method Summary
static java.nio.ByteBuffer bufferOffset(int offset)
          Creates an "offset buffer" for use with the ARB_vertex_buffer_object extension.
static java.nio.ByteBuffer copyByteBuffer(java.nio.ByteBuffer orig)
           
static java.nio.DoubleBuffer copyDoubleBuffer(java.nio.DoubleBuffer orig)
           
static java.nio.FloatBuffer copyFloatBuffer(java.nio.FloatBuffer orig)
           
static java.nio.IntBuffer copyIntBuffer(java.nio.IntBuffer orig)
           
static java.nio.ByteBuffer newByteBuffer(int numElements)
           
static java.nio.DoubleBuffer newDoubleBuffer(int numElements)
           
static java.nio.FloatBuffer newFloatBuffer(int numElements)
           
static java.nio.IntBuffer newIntBuffer(int numElements)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZEOF_DOUBLE

public static final int SIZEOF_DOUBLE
See Also:
Constant Field Values

SIZEOF_FLOAT

public static final int SIZEOF_FLOAT
See Also:
Constant Field Values

SIZEOF_INT

public static final int SIZEOF_INT
See Also:
Constant Field Values
Constructor Detail

BufferUtils

public BufferUtils()
Method Detail

newDoubleBuffer

public static java.nio.DoubleBuffer newDoubleBuffer(int numElements)

newFloatBuffer

public static java.nio.FloatBuffer newFloatBuffer(int numElements)

newIntBuffer

public static java.nio.IntBuffer newIntBuffer(int numElements)

newByteBuffer

public static java.nio.ByteBuffer newByteBuffer(int numElements)

copyDoubleBuffer

public static java.nio.DoubleBuffer copyDoubleBuffer(java.nio.DoubleBuffer orig)

copyFloatBuffer

public static java.nio.FloatBuffer copyFloatBuffer(java.nio.FloatBuffer orig)

copyIntBuffer

public static java.nio.IntBuffer copyIntBuffer(java.nio.IntBuffer orig)

copyByteBuffer

public static java.nio.ByteBuffer copyByteBuffer(java.nio.ByteBuffer orig)

bufferOffset

public static java.nio.ByteBuffer bufferOffset(int offset)
Creates an "offset buffer" for use with the ARB_vertex_buffer_object extension. The resulting Buffers are suitable for use with routines such as glVertexPointer when used in conjunction with that extension. They have no capacity and are not suitable for passing to OpenGL routines that do not support buffer offsets, or to non-OpenGL routines.