net.java.games.jogl.util

Class 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

Method Summary

static ByteBuffer
bufferOffset(int offset)
Creates an "offset buffer" for use with the ARB_vertex_buffer_object extension.
static ByteBuffer
copyByteBuffer(ByteBuffer orig)
static DoubleBuffer
copyDoubleBuffer(DoubleBuffer orig)
static FloatBuffer
copyFloatBuffer(FloatBuffer orig)
static IntBuffer
copyIntBuffer(IntBuffer orig)
static ByteBuffer
newByteBuffer(int numElements)
static DoubleBuffer
newDoubleBuffer(int numElements)
static FloatBuffer
newFloatBuffer(int numElements)
static IntBuffer
newIntBuffer(int numElements)

Field Details

SIZEOF_DOUBLE

public static final int SIZEOF_DOUBLE
Field Value:
8

SIZEOF_FLOAT

public static final int SIZEOF_FLOAT
Field Value:
4

SIZEOF_INT

public static final int SIZEOF_INT
Field Value:
4

Method Details

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.

copyByteBuffer

public static ByteBuffer copyByteBuffer(ByteBuffer orig)

copyDoubleBuffer

public static DoubleBuffer copyDoubleBuffer(DoubleBuffer orig)

copyFloatBuffer

public static FloatBuffer copyFloatBuffer(FloatBuffer orig)

copyIntBuffer

public static IntBuffer copyIntBuffer(IntBuffer orig)

newByteBuffer

public static ByteBuffer newByteBuffer(int numElements)

newDoubleBuffer

public static DoubleBuffer newDoubleBuffer(int numElements)

newFloatBuffer

public static FloatBuffer newFloatBuffer(int numElements)

newIntBuffer

public static IntBuffer newIntBuffer(int numElements)