Class ARBMultiBind
- java.lang.Object
-
- org.lwjgl.opengl.ARBMultiBind
-
public class ARBMultiBind extends java.lang.ObjectNative 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
NULLis 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 inOpenGL 4.4.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidglBindBuffersBase(int target, int first, int[] buffers)Array version of:BindBuffersBasestatic voidglBindBuffersBase(int target, int first, java.nio.IntBuffer buffers)Bindscountexisting buffer objects to bindings numberedfirstthroughfirst+count-1in the array of buffer binding points corresponding totarget.static voidglBindBuffersRange(int target, int first, int[] buffers, org.lwjgl.PointerBuffer offsets, org.lwjgl.PointerBuffer sizes)Array version of:BindBuffersRangestatic voidglBindBuffersRange(int target, int first, java.nio.IntBuffer buffers, org.lwjgl.PointerBuffer offsets, org.lwjgl.PointerBuffer sizes)Bindscountexisting buffer objects to bindings numberedfirstthroughfirst+count-1in the array of buffer binding points corresponding totarget.static voidglBindImageTextures(int first, int[] textures)Array version of:BindImageTexturesstatic voidglBindImageTextures(int first, java.nio.IntBuffer textures)Bindscountexisting texture objects to image units numberedfirstthroughfirst+count-1.static voidglBindSamplers(int first, int[] samplers)Array version of:BindSamplersstatic voidglBindSamplers(int first, java.nio.IntBuffer samplers)Bindscountexisting sampler objects to texture image units numberedfirstthroughfirst+count-1.static voidglBindTextures(int first, int[] textures)Array version of:BindTexturesstatic voidglBindTextures(int first, java.nio.IntBuffer textures)Bindscountexisting texture objects to texture image units numberedfirstthroughfirst+count-1.static voidglBindVertexBuffers(int first, int[] buffers, org.lwjgl.PointerBuffer offsets, int[] strides)Array version of:BindVertexBuffersstatic voidglBindVertexBuffers(int first, java.nio.IntBuffer buffers, org.lwjgl.PointerBuffer offsets, java.nio.IntBuffer strides)Bindscountexisting buffer objects to vertex buffer binding points numberedfirstthroughfirst+count-1.
-
-
-
Method Detail
-
glBindBuffersBase
public static void glBindBuffersBase(int target, int first, java.nio.IntBuffer buffers)Bindscountexisting buffer objects to bindings numberedfirstthroughfirst+count-1in the array of buffer binding points corresponding totarget. Ifbuffersis notNULL, it specifies an array ofcountvalues, 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
targetis unmodified, and that buffers will not be created if they do not exist.- Parameters:
target- the buffer object target. One of:first- the first bindingbuffers- an array of zeros or names of existing buffers objects
-
glBindBuffersRange
public static void glBindBuffersRange(int target, int first, java.nio.IntBuffer buffers, org.lwjgl.PointerBuffer offsets, org.lwjgl.PointerBuffer sizes)Bindscountexisting buffer objects to bindings numberedfirstthroughfirst+count-1in the array of buffer binding points corresponding totarget.offsetsandsizesspecify arrays ofcountvalues indicating the range of each buffer to bind. IfbuffersisNULL, all bindings fromfirstthroughfirst+count-1are reset to their unbound (zero) state. In this case, the offsets and sizes associated with the binding points are set to default values, ignoringoffsetsandsizes. 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
targetis unmodified, and that buffers will not be created if they do not exist.The values specified in
buffers,offsets, andsizeswill 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- the buffer object target. One of:first- the first bindingbuffers- an array of names of existing buffers objectsoffsets- an array of offsetssizes- an array of sizes
-
glBindTextures
public static void glBindTextures(int first, java.nio.IntBuffer textures)Bindscountexisting texture objects to texture image units numberedfirstthroughfirst+count-1. Iftexturesis notNULL, it specifies an array ofcountvalues, each of which must be zero or the name of an existing texture object. When an entry intexturesis 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 intexturesis zero, each of the targets enumerated at the beginning of this section is reset to its default texture for the corresponding texture image unit. IftexturesisNULL, each target of each affected texture image unit fromfirstthroughfirst+count-1is reset to its default texture.BindTexturesis 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
textureswill 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- the first texture objectstextures- an array of zeros or names of existing texture objects
-
glBindSamplers
public static void glBindSamplers(int first, java.nio.IntBuffer samplers)Bindscountexisting sampler objects to texture image units numberedfirstthroughfirst+count-1. Ifsamplersis notNULL, it specifies an array ofcountvalues, each of which must be zero or the name of an existing sampler object. IfsamplersisNULL, each affected texture image unit fromfirstthroughfirst+count-1will be reset to have no bound sampler object.BindSamplersis 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
samplerswill 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- the first sampler objectsamplers- an array of zeros or names of existing sampler objects
-
glBindImageTextures
public static void glBindImageTextures(int first, java.nio.IntBuffer textures)Bindscountexisting texture objects to image units numberedfirstthroughfirst+count-1. Iftexturesis notNULL, it specifies an array ofcountvalues, each of which must be zero or the name of an existing texture object. IftexturesisNULL, each affected image unit fromfirstthroughfirst+count-1will 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, andaccessparameters are set to zero,TRUE, zero, andREAD_WRITE, respectively. The image unitformatparameter is taken from the internal format of the texture image at level zero of the texture object identified bytextures. For cube map textures, the internal format of theTEXTURE_CUBE_MAP_POSITIVE_Ximage 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, andformatwill be reset to their default values of zero,FALSE, 0, andR8, respectively.BindImageTexturesis 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
lookupInternalFormatreturns the internal format of the specified texture object.The values specified in
textureswill 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- the first image unittextures- an array of zeros or names of existing texture objects
-
glBindVertexBuffers
public static void glBindVertexBuffers(int first, java.nio.IntBuffer buffers, org.lwjgl.PointerBuffer offsets, java.nio.IntBuffer strides)Bindscountexisting buffer objects to vertex buffer binding points numberedfirstthroughfirst+count-1. Ifbuffersis notNULL, it specifies an array ofcountvalues, each of which must be zero or the name of an existing buffer object.offsetsandstridesspecify arrays ofcountvalues indicating the offset of the first element and stride between elements in each buffer, respectively. IfbuffersisNULL, each affected vertex buffer binding point fromfirstthroughfirst+count-1will 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, ignoringoffsetsandstrides.BindVertexBuffersis 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, andstrideswill 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- the first vertex buffer binding pointbuffers- an array of zeros or names of existing buffers objectsoffsets- an array of offsesstrides- an array of stride values
-
glBindBuffersBase
public static void glBindBuffersBase(int target, int first, int[] buffers)Array version of:BindBuffersBase
-
glBindBuffersRange
public static void glBindBuffersRange(int target, int first, int[] buffers, org.lwjgl.PointerBuffer offsets, org.lwjgl.PointerBuffer sizes)Array version of:BindBuffersRange
-
glBindTextures
public static void glBindTextures(int first, int[] textures)Array version of:BindTextures
-
glBindSamplers
public static void glBindSamplers(int first, int[] samplers)Array version of:BindSamplers
-
glBindImageTextures
public static void glBindImageTextures(int first, int[] textures)Array version of:BindImageTextures
-
glBindVertexBuffers
public static void glBindVertexBuffers(int first, int[] buffers, org.lwjgl.PointerBuffer offsets, int[] strides)Array version of:BindVertexBuffers
-
-