Top Description Constructors Methods
org.lwjgl.opengl

public Class ARBMultiBind

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Native bindings to the ARB_multi_bind extension.

This extension provides a new set of commands allowing applications to bind or unbind a set of objects in a single call, instead of requiring a separate call for each bind or unbind operation. Using a single command allows OpenGL implementations to amortize function call, name space lookup, and potential locking overhead over multiple bind or unbind operations. The rendering loops of graphics applications frequently switch between different states, binding different sets of resources, including texture objects, sampler objects, textures for image loads and stores, uniform buffers, and vertex buffers; this extension provides "multi-bind" entry points for all of these object types.

Each command in this extension includes a <first> and <count> parameter, specifying a continguous range of binding points to update, as well as an array of <count> object names specifying the objects to bind. Unlike single bind commands, multi-bind commands can be used only to bind or unbind existing objects. Passing a previously unused object name (generated or not) results in an error and does not create a new object. For binding points with associated data (e.g., ranges of a buffer), separate arrays are used to pass the associated data for each binding point. Passing zero values in the array of object names removes the object bound to the current bounding point. Additionally, if NULL is passed as the array of objects, objects bound to the entire range of binding points are unbound, as though the caller passed an array of zeroes.

Requires OpenGL 3.0. Promoted to core in OpenGL 4.4.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
glBindBuffersBase(int target, int
the first binding
first
,
IntBuffer
an array of zeros or names of existing buffers objects
buffers
)

Binds count existing buffer objects to bindings numbered first through first+count-1 in the array of buffer binding points corresponding to target.

public static void
glBindBuffersBase(int target, int first, int[] buffers)

Array version of: BindBuffersBase

public static void
glBindBuffersRange(int target, int
the first binding
first
,
IntBuffer
an array of names of existing buffers objects
buffers
,
PointerBuffer
an array of offsets
offsets
,
PointerBuffer
an array of sizes
sizes
)

Binds count existing buffer objects to bindings numbered first through first+count-1 in the array of buffer binding points corresponding to target.

public static void
glBindBuffersRange(int target, int first, int[] buffers, PointerBuffer offsets, PointerBuffer sizes)

Array version of: BindBuffersRange

public static void
glBindImageTextures(int
the first image unit
first
,
IntBuffer
an array of zeros or names of existing texture objects
textures
)

Binds count existing texture objects to image units numbered first through first+count-1.

public static void
glBindImageTextures(int first, int[] textures)

Array version of: BindImageTextures

public static void
glBindSamplers(int
the first sampler object
first
,
IntBuffer
an array of zeros or names of existing sampler objects
samplers
)

Binds count existing sampler objects to texture image units numbered first through first+count-1.

public static void
glBindSamplers(int first, int[] samplers)

Array version of: BindSamplers

public static void
glBindTextures(int
the first texture objects
first
,
IntBuffer
an array of zeros or names of existing texture objects
textures
)

Binds count existing texture objects to texture image units numbered first through first+count-1.

public static void
glBindTextures(int first, int[] textures)

Array version of: BindTextures

public static void
glBindVertexBuffers(int
the first vertex buffer binding point
first
,
IntBuffer
an array of zeros or names of existing buffers objects
buffers
,
PointerBuffer
an array of offses
offsets
,
IntBuffer
an array of stride values
strides
)

Binds count existing buffer objects to vertex buffer binding points numbered first through first+count-1.

public static void
glBindVertexBuffers(int first, int[] buffers, PointerBuffer offsets, int[] strides)

Array version of: BindVertexBuffers

public static void
nglBindBuffersBase(int target, int first, int
the number of bindings
count
,
long buffers)

Unsafe version of: BindBuffersBase

public static void
nglBindBuffersRange(int target, int first, int
the number of bindings
count
,
long buffers, long offsets, long sizes)

Unsafe version of: BindBuffersRange

public static void
nglBindImageTextures(int first, int
the number of image units
count
,
long textures)

Unsafe version of: BindImageTextures

public static void
nglBindSamplers(int first, int
the number of sampler objects
count
,
long samplers)

Unsafe version of: BindSamplers

public static void
nglBindTextures(int first, int
the number of texture objects
count
,
long textures)

Unsafe version of: BindTextures

public static void
nglBindVertexBuffers(int first, int
the number of vertex buffer binding points
count
,
long buffers, long offsets, long strides)

Unsafe version of: BindVertexBuffers

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ARBMultiBindback to summary
protected ARBMultiBind()

Method Detail

glBindBuffersBaseback to summary
public static void glBindBuffersBase(int target, int first, IntBuffer buffers)

Binds count existing buffer objects to bindings numbered first through first+count-1 in the array of buffer binding points corresponding to target. If buffers is not NULL, it specifies an array of count values, each of which must be zero or the name of an existing buffer object. It is equivalent to:


for ( i = 0; i < count; i++ ) {
    if ( buffers == NULL ) {
        glBindBufferBase(target, first + i, 0);
    } else {
        glBindBufferBase(target, first + i, buffers[i]);
    }
}

except that the single general buffer binding corresponding to target is unmodified, and that buffers will not be created if they do not exist.

Parameters
target:int

the buffer object target. One of:

ARRAY_BUFFERELEMENT_ARRAY_BUFFERPIXEL_PACK_BUFFERPIXEL_UNPACK_BUFFER
TRANSFORM_FEEDBACK_BUFFERUNIFORM_BUFFERTEXTURE_BUFFERCOPY_READ_BUFFER
COPY_WRITE_BUFFERDRAW_INDIRECT_BUFFERATOMIC_COUNTER_BUFFERDISPATCH_INDIRECT_BUFFER
SHADER_STORAGE_BUFFERPARAMETER_BUFFER_ARB
first:int

the first binding

buffers:IntBuffer

an array of zeros or names of existing buffers objects

glBindBuffersBaseback to summary
public static void glBindBuffersBase(int target, int first, int[] buffers)

Array version of: BindBuffersBase

glBindBuffersRangeback to summary
public static void glBindBuffersRange(int target, int first, IntBuffer buffers, PointerBuffer offsets, PointerBuffer sizes)

Binds count existing buffer objects to bindings numbered first through first+count-1 in the array of buffer binding points corresponding to target. offsets and sizes specify arrays of count values indicating the range of each buffer to bind. If buffers is NULL, all bindings from first through first+count-1 are reset to their unbound (zero) state. In this case, the offsets and sizes associated with the binding points are set to default values, ignoring offsets and sizes. It is equivalent to:


for ( i = 0; i < count; i++ ) {
    if ( buffers == NULL ) {
        glBindBufferRange(target, first + i, 0, 0, 0);
    } else {
        glBindBufferRange(target, first + i, buffers[i], offsets[i], sizes[i]);
    }
}

except that the single general buffer binding corresponding to target is unmodified, and that buffers will not be created if they do not exist.

The values specified in buffers, offsets, and sizes will be checked separately for each binding point. When values for a specific binding point are invalid, the state for that binding point will be unchanged and an error will be generated. However, state for other binding points will still be changed if their corresponding values are valid.

Parameters
target:int

the buffer object target. One of:

ARRAY_BUFFERELEMENT_ARRAY_BUFFERPIXEL_PACK_BUFFERPIXEL_UNPACK_BUFFER
TRANSFORM_FEEDBACK_BUFFERUNIFORM_BUFFERTEXTURE_BUFFERCOPY_READ_BUFFER
COPY_WRITE_BUFFERDRAW_INDIRECT_BUFFERATOMIC_COUNTER_BUFFERDISPATCH_INDIRECT_BUFFER
SHADER_STORAGE_BUFFERPARAMETER_BUFFER_ARB
first:int

the first binding

buffers:IntBuffer

an array of names of existing buffers objects

offsets:PointerBuffer

an array of offsets

sizes:PointerBuffer

an array of sizes

glBindBuffersRangeback to summary
public static void glBindBuffersRange(int target, int first, int[] buffers, PointerBuffer offsets, PointerBuffer sizes)

Array version of: BindBuffersRange

glBindImageTexturesback to summary
public static void glBindImageTextures(int first, IntBuffer textures)

Binds count existing texture objects to image units numbered first through first+count-1. If textures is not NULL, it specifies an array of count values, each of which must be zero or the name of an existing texture object. If textures is NULL, each affected image unit from first through first+count-1 will be reset to have no bound texture object.

When binding a non-zero texture object to an image unit, the image unit level, layered, layer, and access parameters are set to zero, TRUE, zero, and READ_WRITE, respectively. The image unit format parameter is taken from the internal format of the texture image at level zero of the texture object identified by textures. For cube map textures, the internal format of the TEXTURE_CUBE_MAP_POSITIVE_X image of level zero is used. For multisample, multisample array, buffer, and rectangle textures, the internal format of the single texture level is used.

When unbinding a texture object from an image unit, the image unit parameters level, layered, layer, and format will be reset to their default values of zero, FALSE, 0, and R8, respectively.

BindImageTextures is equivalent to:


for ( i = 0; i < count; i++ ) {
    if ( textures == NULL || textures[i] = 0 ) {
        glBindImageTexture(first + i, 0, 0, FALSE, 0, READ_ONLY, R8);
    } else {
        glBindImageTexture(first + i, textures[i], 0, TRUE, 0, READ_WRITE, lookupInternalFormat(textures[i]));
    }
}

where lookupInternalFormat returns the internal format of the specified texture object.

The values specified in textures will be checked separately for each image unit. When a value for a specific image unit is invalid, the state for that image unit will be unchanged and an error will be generated. However, state for other image units will still be changed if their corresponding values are valid.

Parameters
first:int

the first image unit

textures:IntBuffer

an array of zeros or names of existing texture objects

glBindImageTexturesback to summary
public static void glBindImageTextures(int first, int[] textures)

Array version of: BindImageTextures

glBindSamplersback to summary
public static void glBindSamplers(int first, IntBuffer samplers)

Binds count existing sampler objects to texture image units numbered first through first+count-1. If samplers is not NULL, it specifies an array of count values, each of which must be zero or the name of an existing sampler object. If samplers is NULL, each affected texture image unit from first through first+count-1 will be reset to have no bound sampler object.

BindSamplers is equivalent to:


for ( i = 0; i < count; i++ ) {
    if ( samplers == NULL ) {
        glBindSampler(first + i, 0);
    } else {
        glBindSampler(first + i, samplers[i]);
    }
}

The values specified in samplers will be checked separately for each texture image unit. When a value for a specific texture image unit is invalid, the state for that texture image unit will be unchanged and an error will be generated. However, state for other texture image units will still be changed if their corresponding values are valid.

Parameters
first:int

the first sampler object

samplers:IntBuffer

an array of zeros or names of existing sampler objects

glBindSamplersback to summary
public static void glBindSamplers(int first, int[] samplers)

Array version of: BindSamplers

glBindTexturesback to summary
public static void glBindTextures(int first, IntBuffer textures)

Binds count existing texture objects to texture image units numbered first through first+count-1. If textures is not NULL, it specifies an array of count values, each of which must be zero or the name of an existing texture object. When an entry in textures is the name of an existing texture object, that object is bound to corresponding texture unit for the target specified when the texture object was created. When an entry in textures is zero, each of the targets enumerated at the beginning of this section is reset to its default texture for the corresponding texture image unit. If textures is NULL, each target of each affected texture image unit from first through first+count-1 is reset to its default texture.

BindTextures is equivalent to:


for ( i = 0; i < count; i++ ) {
    uint texture;
    if ( textures == NULL ) {
        texture = 0;
    } else {
        texture = textures[i];
    }
    ActiveTexture(TEXTURE0 + first + i);
    if ( texture != 0 ) {
        enum target; // target of texture object textures[i]
        BindTexture(target, textures[i]);
    } else {
        for ( target in all supported targets ) {
            BindTexture(target, 0);
        }
    }
}

except that the active texture selector retains its original value upon completion of the command, and that textures will not be created if they do not exist.

The values specified in textures will be checked separately for each texture image unit. When a value for a specific texture image unit is invalid, the state for that texture image unit will be unchanged and an error will be generated. However, state for other texture image units will still be changed if their corresponding values are valid.

Parameters
first:int

the first texture objects

textures:IntBuffer

an array of zeros or names of existing texture objects

glBindTexturesback to summary
public static void glBindTextures(int first, int[] textures)

Array version of: BindTextures

glBindVertexBuffersback to summary
public static void glBindVertexBuffers(int first, IntBuffer buffers, PointerBuffer offsets, IntBuffer strides)

Binds count existing buffer objects to vertex buffer binding points numbered first through first+count-1. If buffers is not NULL, it specifies an array of count values, each of which must be zero or the name of an existing buffer object. offsets and strides specify arrays of count values indicating the offset of the first element and stride between elements in each buffer, respectively. If buffers is NULL, each affected vertex buffer binding point from first through first+count-1 will be reset to have no bound buffer object. In this case, the offsets and strides associated with the binding points are set to default values, ignoring offsets and strides.

BindVertexBuffers is equivalent to:


for ( i = 0; i < count; i++ ) {
    if ( buffers == NULL ) {
        glBindVertexBuffer(first + i, 0, 0, 16);
    } else {
        glBindVertexBuffer(first + i, buffers[i], offsets[i], strides[i]);
    }
}

except that buffers will not be created if they do not exist.

The values specified in buffers, offsets, and strides will be checked separately for each vertex buffer binding point. When a value for a specific binding point is invalid, the state for that binding point will be unchanged and an error will be generated. However, state for other binding points will still be changed if their corresponding values are valid.

Parameters
first:int

the first vertex buffer binding point

buffers:IntBuffer

an array of zeros or names of existing buffers objects

offsets:PointerBuffer

an array of offses

strides:IntBuffer

an array of stride values

glBindVertexBuffersback to summary
public static void glBindVertexBuffers(int first, int[] buffers, PointerBuffer offsets, int[] strides)

Array version of: BindVertexBuffers

nglBindBuffersBaseback to summary
public static void nglBindBuffersBase(int target, int first, int count, long buffers)

Unsafe version of: BindBuffersBase

Parameters
count:int

the number of bindings

nglBindBuffersRangeback to summary
public static void nglBindBuffersRange(int target, int first, int count, long buffers, long offsets, long sizes)

Unsafe version of: BindBuffersRange

Parameters
count:int

the number of bindings

nglBindImageTexturesback to summary
public static void nglBindImageTextures(int first, int count, long textures)

Unsafe version of: BindImageTextures

Parameters
count:int

the number of image units

nglBindSamplersback to summary
public static void nglBindSamplers(int first, int count, long samplers)

Unsafe version of: BindSamplers

Parameters
count:int

the number of sampler objects

nglBindTexturesback to summary
public static void nglBindTextures(int first, int count, long textures)

Unsafe version of: BindTextures

Parameters
count:int

the number of texture objects

nglBindVertexBuffersback to summary
public static void nglBindVertexBuffers(int first, int count, long buffers, long offsets, long strides)

Unsafe version of: BindVertexBuffers

Parameters
count:int

the number of vertex buffer binding points