net.java.games.jogl.util
Class BufferUtils

java.lang.Object
  extended bynet.java.games.jogl.util.BufferUtils

public class BufferUtils
extends Object

Utility routines for dealing with direct buffers.


Field Summary
static int SIZEOF_FLOAT
           
static int SIZEOF_INT
           
 
Constructor Summary
BufferUtils()
           
 
Method Summary
static ByteBuffer bufferOffset(int offset)
          Creates an "offset buffer" for use with the ARB_vertex_buffer_object extension.
static FloatBuffer copyFloatBuffer(FloatBuffer orig)
           
static ByteBuffer newByteBuffer(int numElements)
           
static FloatBuffer newFloatBuffer(int numElements)
           
static 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_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

newFloatBuffer

public static FloatBuffer newFloatBuffer(int numElements)

newIntBuffer

public static IntBuffer newIntBuffer(int numElements)

newByteBuffer

public static ByteBuffer newByteBuffer(int numElements)

copyFloatBuffer

public static FloatBuffer copyFloatBuffer(FloatBuffer orig)

bufferOffset

public static 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.