Top Description Fields Constructors Methods
org.lwjgl.opengl

pack-priv final Class APIUtil

extends Object
Class Inheritance
Imports
org.lwjgl.BufferUtils, .LWJGLUtil, .MemoryUtil, java.nio.*

Utility class for OpenGL API calls. Instances of APIUtil are created in ContextCapabilities, so we have an instance per OpenGL context.
Author
spasi

Field Summary

Modifier and TypeField and Description
private char[]
private ByteBuffer
private static final int
private final DoubleBuffer
private final FloatBuffer
private static final int
private static final int
private final IntBuffer
private IntBuffer
private final LongBuffer

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static ByteBuffer
encode(final ByteBuffer
The target buffer
buffer
,
final CharSequence
The source string
string
)

Simple ASCII encoding.

private static char[]
getArray(final ContextCapabilities caps, final int size)

pack-priv static long

Returns:

the String as a ByteBuffer
getBuffer
(final ContextCapabilities caps, final CharSequence string)

Returns a buffer containing the specified string as bytes.

pack-priv static long

Returns:

the String as a ByteBuffer
getBuffer
(final ContextCapabilities caps, final CharSequence string, final int offset)

Returns a buffer containing the specified string as bytes, starting at the specified offset.

pack-priv static long

Returns:

the Strings as a ByteBuffer
getBuffer
(final ContextCapabilities caps, final CharSequence[] strings)

Returns a buffer containing the specified strings as bytes.

pack-priv static ByteBuffer
getBufferByte(final ContextCapabilities caps, final int size)

pack-priv static long
private static ByteBuffer
getBufferByteOffset(final ContextCapabilities caps, final int size)

pack-priv static DoubleBuffer
pack-priv static FloatBuffer
pack-priv static IntBuffer
pack-priv static LongBuffer
pack-priv static long

Returns:

the String as a ByteBuffer
getBufferNT
(final ContextCapabilities caps, final CharSequence string)

Returns a buffer containing the specified string as bytes, including null-termination.

pack-priv static long

Returns:

the Strings as a ByteBuffer
getBufferNT
(final ContextCapabilities caps, final CharSequence[] strings)

Returns a buffer containing the specified strings as bytes, including null-termination.

pack-priv static long
getInt(final ContextCapabilities caps, final int value)

pack-priv static IntBuffer
pack-priv static IntBuffer
getLengths(final ContextCapabilities caps, final int size)

pack-priv static long

Returns:

the String lengths in an IntBuffer
getLengths
(final ContextCapabilities caps, final CharSequence[] strings)

Returns a buffer containing the lengths of the specified strings.

pack-priv static String

Returns:

the buffer as a String.
getString
(final ContextCapabilities caps, final ByteBuffer buffer)

Reads a byte string from the specified buffer.

pack-priv static int
getTotalLength(final CharSequence[] strings)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrayback to summary
private char[] array
bufferback to summary
private ByteBuffer buffer
BUFFERS_SIZEback to summary
private static final int BUFFERS_SIZE
doublesback to summary
private final DoubleBuffer doubles
floatsback to summary
private final FloatBuffer floats
INITIAL_BUFFER_SIZEback to summary
private static final int INITIAL_BUFFER_SIZE
INITIAL_LENGTHS_SIZEback to summary
private static final int INITIAL_LENGTHS_SIZE
intsback to summary
private final IntBuffer ints
lengthsback to summary
private IntBuffer lengths
longsback to summary
private final LongBuffer longs

Constructor Detail

APIUtilback to summary
pack-priv APIUtil()

Method Detail

encodeback to summary
private static ByteBuffer encode(final ByteBuffer buffer, final CharSequence string)

Simple ASCII encoding.

Parameters
buffer:ByteBuffer

The target buffer

string:CharSequence

The source string

getArrayback to summary
private static char[] getArray(final ContextCapabilities caps, final int size)
getBufferback to summary
pack-priv static long getBuffer(final ContextCapabilities caps, final CharSequence string)

Returns a buffer containing the specified string as bytes.

Returns:long

the String as a ByteBuffer

getBufferback to summary
pack-priv static long getBuffer(final ContextCapabilities caps, final CharSequence string, final int offset)

Returns a buffer containing the specified string as bytes, starting at the specified offset.

Returns:long

the String as a ByteBuffer

getBufferback to summary
pack-priv static long getBuffer(final ContextCapabilities caps, final CharSequence[] strings)

Returns a buffer containing the specified strings as bytes.

Returns:long

the Strings as a ByteBuffer

getBufferByteback to summary
pack-priv static ByteBuffer getBufferByte(final ContextCapabilities caps, final int size)
getBufferByte0back to summary
pack-priv static long getBufferByte0(final ContextCapabilities caps)
getBufferByteOffsetback to summary
private static ByteBuffer getBufferByteOffset(final ContextCapabilities caps, final int size)
getBufferDoubleback to summary
pack-priv static DoubleBuffer getBufferDouble(final ContextCapabilities caps)
getBufferFloatback to summary
pack-priv static FloatBuffer getBufferFloat(final ContextCapabilities caps)
getBufferIntback to summary
pack-priv static IntBuffer getBufferInt(final ContextCapabilities caps)
getBufferLongback to summary
pack-priv static LongBuffer getBufferLong(final ContextCapabilities caps)
getBufferNTback to summary
pack-priv static long getBufferNT(final ContextCapabilities caps, final CharSequence string)

Returns a buffer containing the specified string as bytes, including null-termination.

Returns:long

the String as a ByteBuffer

getBufferNTback to summary
pack-priv static long getBufferNT(final ContextCapabilities caps, final CharSequence[] strings)

Returns a buffer containing the specified strings as bytes, including null-termination.

Returns:long

the Strings as a ByteBuffer

getIntback to summary
pack-priv static long getInt(final ContextCapabilities caps, final int value)
getLengthsback to summary
pack-priv static IntBuffer getLengths(final ContextCapabilities caps)
getLengthsback to summary
pack-priv static IntBuffer getLengths(final ContextCapabilities caps, final int size)
getLengthsback to summary
pack-priv static long getLengths(final ContextCapabilities caps, final CharSequence[] strings)

Returns a buffer containing the lengths of the specified strings.

Returns:long

the String lengths in an IntBuffer

getStringback to summary
pack-priv static String getString(final ContextCapabilities caps, final ByteBuffer buffer)

Reads a byte string from the specified buffer.

Returns:String

the buffer as a String.

getTotalLengthback to summary
pack-priv static int getTotalLength(final CharSequence[] strings)