|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lwjgl.BufferUtils
public final class BufferUtils
Some often-used Buffer code for creating native buffers of the appropriate size.
Constructor Summary | |
---|---|
BufferUtils()
|
Method Summary | |
---|---|
static java.nio.ByteBuffer |
createByteBuffer(int size)
Construct a direct native-ordered bytebuffer with the specified size. |
static java.nio.CharBuffer |
createCharBuffer(int size)
Construct a direct native-order charbuffer with the specified number of elements. |
static java.nio.DoubleBuffer |
createDoubleBuffer(int size)
Construct a direct native-order doublebuffer with the specified number of elements. |
static java.nio.FloatBuffer |
createFloatBuffer(int size)
Construct a direct native-order floatbuffer with the specified number of elements. |
static java.nio.IntBuffer |
createIntBuffer(int size)
Construct a direct native-order intbuffer with the specified number of elements. |
static java.nio.LongBuffer |
createLongBuffer(int size)
Construct a direct native-order longbuffer with the specified number of elements. |
static PointerBuffer |
createPointerBuffer(int size)
Construct a PointerBuffer with the specified number of elements. |
static java.nio.ShortBuffer |
createShortBuffer(int size)
Construct a direct native-order shortbuffer with the specified number of elements. |
static int |
getElementSizeExponent(java.nio.Buffer buf)
|
static int |
getOffset(java.nio.Buffer buffer)
A helper function which is used to get the byte offset in an arbitrary buffer based on its position |
static void |
zeroBuffer(java.nio.ByteBuffer b)
Fill buffer with zeros from position to remaining |
static void |
zeroBuffer(java.nio.CharBuffer b)
Fill buffer with zeros from position to remaining |
static void |
zeroBuffer(java.nio.DoubleBuffer b)
Fill buffer with zeros from position to remaining |
static void |
zeroBuffer(java.nio.FloatBuffer b)
Fill buffer with zeros from position to remaining |
static void |
zeroBuffer(java.nio.IntBuffer b)
Fill buffer with zeros from position to remaining |
static void |
zeroBuffer(java.nio.LongBuffer b)
Fill buffer with zeros from position to remaining |
static void |
zeroBuffer(java.nio.ShortBuffer b)
Fill buffer with zeros from position to remaining |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BufferUtils()
Method Detail |
---|
public static java.nio.ByteBuffer createByteBuffer(int size)
size
- The size, in bytes
public static java.nio.ShortBuffer createShortBuffer(int size)
size
- The size, in shorts
public static java.nio.CharBuffer createCharBuffer(int size)
size
- The size, in chars
public static java.nio.IntBuffer createIntBuffer(int size)
size
- The size, in ints
public static java.nio.LongBuffer createLongBuffer(int size)
size
- The size, in longs
public static java.nio.FloatBuffer createFloatBuffer(int size)
size
- The size, in floats
public static java.nio.DoubleBuffer createDoubleBuffer(int size)
size
- The size, in floats
public static PointerBuffer createPointerBuffer(int size)
size
- The size, in memory addresses
public static int getElementSizeExponent(java.nio.Buffer buf)
public static int getOffset(java.nio.Buffer buffer)
public static void zeroBuffer(java.nio.ByteBuffer b)
public static void zeroBuffer(java.nio.ShortBuffer b)
public static void zeroBuffer(java.nio.CharBuffer b)
public static void zeroBuffer(java.nio.IntBuffer b)
public static void zeroBuffer(java.nio.FloatBuffer b)
public static void zeroBuffer(java.nio.LongBuffer b)
public static void zeroBuffer(java.nio.DoubleBuffer b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |