glRestoreVertexStateCollectionsDMP Function

Syntax

GL_APICALL void GL_APIENTRY glRestoreVertexStateCollectionsDMP(
     GLuint n,
     GLuint offset,
     GLuint * vscolls,
     GLuint flags,
     GLvoid * data
);

Arguments

Name Description
in n Number of vertex state collection objects to restore from array
in offset Offset to the vertex state collection objects to restore
inout vscolls Array storing the vertex state collection objects to restore
in flags Settings for the state to restore
in data Pointer to the region storing the data to restore

Return Values

There is no return value.

Description

Restores the state of vertex state collection objects.

Set n to the size of the vscolls array (the number of vertex state collection objects to restore). Set offset to the offset of the vertex state collection objects to restore. When restoring objects from saved data, set offset to the first object to restore.

Set vscolls to an array storing the vertex state collection objects to restore. Objects are restored in the same order as they were saved to vscolls by glSaveVertexStateCollectionsDMP. You can choose to restore all or only some of the saved objects at once. Use offset to restore a single object from data in which multiple objects are saved (or in similar situations). By setting offset to the index of an object that is saved near the end of the array, you can restore that object first. This eliminates the need to set vscolls to an array that is excessively large.

Set flags to GL_RESTORE_VERTEX_STATE_COLLECTIONS_DMP. New vertex state collection objects are generated and the entire state is restored in these new objects. The new vertex state collection objects with the restored state are generated in elements of the vscolls array that have a value of 0. Elements with nonzero values are not affected.

Set data to a pointer to the region storing the saved data.

The following errors occur in this function.

GL_INVALID_VALUEThe n, vscolls, or data argument is 0; the sum of n and offset exceeds the number of vertex state collection objects saved in data; or flags is not GL_RESTORE_VERTEX_STATE_COLLECTIONS_DMP.
GL_INVALID_OPERATIONThe data argument does not use the vertex state collection format.
GL_OUT_OF_MEMORYFailed to allocate memory that is used internally.

To delete the restored vertex state, you must separately delete each of the bound vertex buffer objects rather than vscoll alone. With the vertex state collections bound by a call to glBindBuffer(GL_VERTEX_STATE_COLLECTION_DMP, vscoll), use glGetIntegerv and glGetVertexAttribiv to get the ID of each bound vertex buffer object and then call glDeleteBuffers on these IDs to delete them.

You can call glGetIntegerv with pname set equal to GL_ARRAY_BUFFER_BINDING and GL_ELEMENT_ARRAY_BUFFER_BINDING to get the ID of each vertex buffer object. You can also call glGetVertexAttribiv with pname set equal to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING to get the IDs of vertex buffer objects bound to a vertex array.

Revision History

2010/06/10
Added a description of how to delete the restored vertex state.
2010/01/07
Initial version.

CONFIDENTIAL