Top Description Fields Constructors Methods
com.jogamp.opengl.util

public Class GLBuffers

extends Buffers
Class Inheritance
Imports
java.nio.Buffer, .ByteBuffer, com.jogamp.opengl.GL, .GL2, .GL2ES2, .GL2ES3, .GL2GL3, .GLContext, .GLES2, .GLException, com.jogamp.common.nio.Buffers

Utility routines for dealing with direct buffers.
Author
Kenneth Russel, et.al.

Field Summary

Inherited from com.jogamp.common.nio.Buffers:
SIZEOF_BYTESIZEOF_CHARSIZEOF_DOUBLESIZEOF_FLOATSIZEOF_INTSIZEOF_LONGSIZEOF_SHORT

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final int

Returns:

required size of one pixel in bytes
bytesPerPixel
(final int
must be one of (27)
GL_COLOR_INDEX GL_STENCIL_INDEX
GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
GL_RED GL_RED_INTEGER
GL_GREEN GL_GREEN_INTEGER
GL_BLUE GL_BLUE_INTEGER
GL_ALPHA GL_LUMINANCE (12)

GL_LUMINANCE_ALPHA GL_RG
GL_RG_INTEGER GL_HILO_NV
GL_SIGNED_HILO_NV (5)

GL_YCBCR_422_APPLE

GL_RGB GL_RGB_INTEGER
GL_BGR GL_BGR_INTEGER (4)

GL_RGBA GL_RGBA_INTEGER
GL_BGRA GL_BGRA_INTEGER
GL_ABGR_EXT (5)
format
,
final int
must be one of (32)
GL_BITMAP,
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE
type
)

Returns the number of bytes required for one pixel with the the given OpenGL format and type.

public static final int

Returns:

number of components required for the given OpenGL format
componentCount
(final int
must be one of (27)
GL_COLOR_INDEX GL_STENCIL_INDEX
GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
GL_RED GL_RED_INTEGER
GL_GREEN GL_GREEN_INTEGER
GL_BLUE GL_BLUE_INTEGER
GL_ALPHA GL_LUMINANCE (12)

GL_LUMINANCE_ALPHA GL_RG
GL_RG_INTEGER GL_HILO_NV
GL_SIGNED_HILO_NV (5)

GL_YCBCR_422_APPLE

GL_RGB GL_RGB_INTEGER
GL_BGR GL_BGR_INTEGER (4)

GL_RGBA GL_RGBA_INTEGER
GL_BGRA GL_BGRA_INTEGER
GL_ABGR_EXT (5)
format
)

Returns the number of components required for the given OpenGL format.

public static final float[]
getFloatArray(final double[] source)

public static final int
getNextPowerOf2(int number)

private static final int
glGetInteger(final GL gl, final int pname, final int[] tmp)

public static final boolean

Returns:

false if one of GL primitive floating point types, otherwise true GL_FLOAT,
GL_HALF_FLOAT,
GL_HALF_FLOAT_OES,
GL_DOUBLE
isGLTypeFixedPoint
(final int
GL primitive type
glType
)

public static final boolean

Returns:

false if one of GL primitive unsigned types, otherwise true GL_UNSIGNED_BYTE,
GL_UNSIGNED_SHORT,
GL_UNSIGNED_INT,
GL_HILO16_NV
isSignedGLType
(final int
GL primitive type
glType
)

public static final Buffer

Returns:

null if glType is unhandled, otherwise the new Buffer object
newDirectGLBuffer
(final int
shall be one of (31)
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE
glType
,
final int numElements)

public static final int

Returns:

required minimum size of the buffer in bytes
sizeof
(final GL
the current GL object
gl
,
final int[]
a pass through integer array of size >= 1 used to store temp data (performance)
tmp
,
final int
bytes per pixel, i.e. via bytesPerPixel(int, int).
bytesPerPixel
,
int
in pixels
width
,
int
in pixels
height
,
int
in pixels
depth
,
final boolean
true for read mode GPU -> CPU (pack), otherwise false for write mode CPU -> GPU (unpack)
pack
)

Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pixel storage state and the given parameters.

public static final int

Returns:

required minimum size of the buffer in bytes
sizeof
(final GL
the current GL object
gl
,
final int[]
a pass through integer array of size >= 1 used to store temp data (performance)
tmp
,
final int
must be one of (27)
GL_COLOR_INDEX GL_STENCIL_INDEX
GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
GL_RED GL_RED_INTEGER
GL_GREEN GL_GREEN_INTEGER
GL_BLUE GL_BLUE_INTEGER
GL_ALPHA GL_LUMINANCE (12)

GL_LUMINANCE_ALPHA GL_RG
GL_RG_INTEGER GL_HILO_NV
GL_SIGNED_HILO_NV (5)

GL_YCBCR_422_APPLE

GL_RGB GL_RGB_INTEGER
GL_BGR GL_BGR_INTEGER (4)

GL_RGBA GL_RGBA_INTEGER
GL_BGRA GL_BGRA_INTEGER
GL_ABGR_EXT (5)
format
,
final int
must be one of (32)
GL_BITMAP,
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE
type
,
final int
in pixels
width
,
final int
in pixels
height
,
final int
in pixels
depth
,
final boolean
true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU
pack
)

Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pixel storage state and the given parameters.

public static final int

Returns:

-1 if glType is unhandled, otherwise the actual value > 0
sizeOfGLType
(final int
shall be one of (31)
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL.GL_HALF_FLOAT, GLES2.GL_HALF_FLOAT_OES:

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE
glType
)

public static final Buffer

Returns:

null if glType is unhandled or parent is null or bufLen is 0, otherwise the new Buffer object
sliceGLBuffer
(final ByteBuffer parent, final int bytePos, final int byteLen, final int
shall be one of (31)
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE
glType
)

Inherited from com.jogamp.common.nio.Buffers:
copyByteBuffercopyFloatBuffercopyFloatBufferAsByteBuffercopyIntBuffercopyIntBufferAsByteBuffercopyShortBuffercopyShortBufferAsByteBuffergetArraygetDirectBufferByteOffsetgetDoubleArraygetDoubleBuffergetFloatArraygetFloatBuffergetIndirectBufferByteOffsetisDirectnativeOrdernewDirectByteBuffernewDirectByteBuffernewDirectByteBuffernewDirectByteBuffernewDirectCharBuffernewDirectCharBuffernewDirectCharBuffernewDirectCharBuffernewDirectDoubleBuffernewDirectDoubleBuffernewDirectDoubleBuffernewDirectDoubleBuffernewDirectFloatBuffernewDirectFloatBuffernewDirectFloatBuffernewDirectFloatBuffernewDirectIntBuffernewDirectIntBuffernewDirectIntBuffernewDirectIntBuffernewDirectLongBuffernewDirectLongBuffernewDirectLongBuffernewDirectLongBuffernewDirectShortBuffernewDirectShortBuffernewDirectShortBuffernewDirectShortBufferputputbputdputfputiputNbputNfputNiputNsputsrangeCheckrangeCheckrangeCheckrangeCheckrangeCheckrangeCheckrangeCheckrangeCheckrangeCheckBytesremainingBytesremainingElemsizeOfBufferElemslicesliceslice2Floatslice2FloattoString

Constructor Detail

GLBuffersback to summary
public GLBuffers()

Method Detail

bytesPerPixelback to summary
public static final int bytesPerPixel(final int format, final int type) throws GLException

Returns the number of bytes required for one pixel with the the given OpenGL format and type.

This method is security critical, hence it throws an exception (fail-fast) in case either the format, type or alignment is unhandled. In case we forgot to handle proper values, please contact the maintainer.

See componentCount(int).

Parameters
format:int

must be one of (27)
GL_COLOR_INDEX GL_STENCIL_INDEX
GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
GL_RED GL_RED_INTEGER
GL_GREEN GL_GREEN_INTEGER
GL_BLUE GL_BLUE_INTEGER
GL_ALPHA GL_LUMINANCE (12)

GL_LUMINANCE_ALPHA GL_RG
GL_RG_INTEGER GL_HILO_NV
GL_SIGNED_HILO_NV (5)

GL_YCBCR_422_APPLE

GL_RGB GL_RGB_INTEGER
GL_BGR GL_BGR_INTEGER (4)

GL_RGBA GL_RGBA_INTEGER
GL_BGRA GL_BGRA_INTEGER
GL_ABGR_EXT (5)

type:int

must be one of (32)
GL_BITMAP,
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE

Returns:int

required size of one pixel in bytes

Exceptions
GLException:
if format or type alignment is not handled. Please contact the maintainer if this is our bug.
componentCountback to summary
public static final int componentCount(final int format) throws GLException

Returns the number of components required for the given OpenGL format.

This method is security critical, hence it throws an exception (fail-fast) in case either the format, type or alignment is unhandled. In case we forgot to handle proper values, please contact the maintainer.

Parameters
format:int

must be one of (27)
GL_COLOR_INDEX GL_STENCIL_INDEX
GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
GL_RED GL_RED_INTEGER
GL_GREEN GL_GREEN_INTEGER
GL_BLUE GL_BLUE_INTEGER
GL_ALPHA GL_LUMINANCE (12)

GL_LUMINANCE_ALPHA GL_RG
GL_RG_INTEGER GL_HILO_NV
GL_SIGNED_HILO_NV (5)

GL_YCBCR_422_APPLE

GL_RGB GL_RGB_INTEGER
GL_BGR GL_BGR_INTEGER (4)

GL_RGBA GL_RGBA_INTEGER
GL_BGRA GL_BGRA_INTEGER
GL_ABGR_EXT (5)

Returns:int

number of components required for the given OpenGL format

Exceptions
GLException:
if format is not handled. Please contact the maintainer if this is our bug.
getFloatArrayback to summary
public static final float[] getFloatArray(final double[] source)
getNextPowerOf2back to summary
public static final int getNextPowerOf2(int number)
glGetIntegerback to summary
private static final int glGetInteger(final GL gl, final int pname, final int[] tmp)
isGLTypeFixedPointback to summary
public static final boolean isGLTypeFixedPoint(final int glType)
Parameters
glType:int

GL primitive type

Returns:boolean

false if one of GL primitive floating point types, otherwise true GL_FLOAT,
GL_HALF_FLOAT,
GL_HALF_FLOAT_OES,
GL_DOUBLE

isSignedGLTypeback to summary
public static final boolean isSignedGLType(final int glType)
Parameters
glType:int

GL primitive type

Returns:boolean

false if one of GL primitive unsigned types, otherwise true GL_UNSIGNED_BYTE,
GL_UNSIGNED_SHORT,
GL_UNSIGNED_INT,
GL_HILO16_NV

newDirectGLBufferback to summary
public static final Buffer newDirectGLBuffer(final int glType, final int numElements)
Parameters
glType:int

shall be one of (31)
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE

Returns:Buffer

null if glType is unhandled, otherwise the new Buffer object

sizeofback to summary
public static final int sizeof(final GL gl, final int[] tmp, final int bytesPerPixel, int width, int height, int depth, final boolean pack)

Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pixel storage state and the given parameters.

This method is security critical, hence it throws an exception (fail-fast) in case of an invalid alignment. In case we forgot to handle proper values, please contact the maintainer.

Parameters
gl:GL

the current GL object

tmp:int[]

a pass through integer array of size >= 1 used to store temp data (performance)

bytesPerPixel:int

bytes per pixel, i.e. via bytesPerPixel(int, int).

width:int

in pixels

height:int

in pixels

depth:int

in pixels

pack:boolean

true for read mode GPU -> CPU (pack), otherwise false for write mode CPU -> GPU (unpack)

Returns:int

required minimum size of the buffer in bytes

Exceptions
GLException:
if alignment is invalid. Please contact the maintainer if this is our bug.
sizeofback to summary
public static final int sizeof(final GL gl, final int[] tmp, final int format, final int type, final int width, final int height, final int depth, final boolean pack) throws GLException

Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pixel storage state and the given parameters.

This method is security critical, hence it throws an exception (fail-fast) in case either the format, type or alignment is unhandled. In case we forgot to handle proper values, please contact the maintainer.

See bytesPerPixel(int, int).

Parameters
gl:GL

the current GL object

tmp:int[]

a pass through integer array of size >= 1 used to store temp data (performance)

format:int

must be one of (27)
GL_COLOR_INDEX GL_STENCIL_INDEX
GL_DEPTH_COMPONENT GL_DEPTH_STENCIL
GL_RED GL_RED_INTEGER
GL_GREEN GL_GREEN_INTEGER
GL_BLUE GL_BLUE_INTEGER
GL_ALPHA GL_LUMINANCE (12)

GL_LUMINANCE_ALPHA GL_RG
GL_RG_INTEGER GL_HILO_NV
GL_SIGNED_HILO_NV (5)

GL_YCBCR_422_APPLE

GL_RGB GL_RGB_INTEGER
GL_BGR GL_BGR_INTEGER (4)

GL_RGBA GL_RGBA_INTEGER
GL_BGRA GL_BGRA_INTEGER
GL_ABGR_EXT (5)

type:int

must be one of (32)
GL_BITMAP,
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE

width:int

in pixels

height:int

in pixels

depth:int

in pixels

pack:boolean

true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU

Returns:int

required minimum size of the buffer in bytes

Exceptions
GLException:
if format, type or alignment is not handled. Please contact the maintainer if this is our bug.
sizeOfGLTypeback to summary
public static final int sizeOfGLType(final int glType)
Parameters
glType:int

shall be one of (31)
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL.GL_HALF_FLOAT, GLES2.GL_HALF_FLOAT_OES:

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE

Returns:int

-1 if glType is unhandled, otherwise the actual value > 0

sliceGLBufferback to summary
public static final Buffer sliceGLBuffer(final ByteBuffer parent, final int bytePos, final int byteLen, final int glType)
Parameters
glType:int

shall be one of (31)
GL_BYTE, GL_UNSIGNED_BYTE,
GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,

GL_SHORT, GL_UNSIGNED_SHORT,
GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE,
GL_HALF_FLOAT, GL_HALF_FLOAT_OES

GL_FIXED, GL_INT
GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8,
GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2,
GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8,
GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV
GL_HILO16_NV, GL_SIGNED_HILO16_NV

GL_FLOAT_32_UNSIGNED_INT_24_8_REV

GL_FLOAT, GL_DOUBLE

Returns:Buffer

null if glType is unhandled or parent is null or bufLen is 0, otherwise the new Buffer object