glGetBufferParameteriv

From OpenGL Reference
Jump to navigation Jump to search

Return parameters of a buffer object.

C Specification[edit]

void glGetBufferParameteriv( GLenum target, GLenum value, GLint * data );
void glGetBufferParameteri64v( GLenum target, GLenum value, GLint64 * data );
void glGetNamedBufferParameteriv( GLuint buffer, GLenum pname, GLint * params );
void glGetNamedBufferParameteri64v( GLuint buffer, GLenum pname, GLint64 * params );


Parameters[edit]

target - Specifies the target to which the buffer object is bound for glGetBufferParameteriv and glGetBufferParameteri64v . Must be one of the buffer binding targets in the following table:
buffer - Specifies the name of the buffer object for glGetNamedBufferParameteriv and glGetNamedBufferParameteri64v .
value - Specifies the name of the buffer object parameter to query.
data - Returns the requested parameter.


Description[edit]

These functions return in data a selected parameter of the specified buffer object.

 pname names a specific buffer object parameter, as follows:


GL_BUFFER_ACCESS  -  params returns the access policy set while mapping the buffer object (the value of the access parameter enum passed to glMapBuffer ). If the buffer was mapped with glMapBufferRange , the access policy is determined by translating the bits in that access parameter to one of the supported enums for glMapBuffer as described in the OpenGL Specification.
GL_BUFFER_ACCESS_FLAGS  -  params returns the access policy set while mapping the buffer object (the value of the access parameter bitfield passed to glMapBufferRange ). If the buffer was mapped with glMapBuffer , the access policy is determined by translating the enums in that access parameter to the corresponding bits for glMapBufferRange as described in the OpenGL Specification. The initial value is zero.
GL_BUFFER_IMMUTABLE_STORAGE  -  params returns a boolean flag indicating whether the buffer object is immutable. The initial value is GL_FALSE .
GL_BUFFER_MAPPED  -  params returns a flag indicating whether the buffer object is currently mapped. The initial value is GL_FALSE .
GL_BUFFER_MAP_LENGTH  -  params returns the length of the mapping into the buffer object established with glMapBuffer* . The i64v versions of these queries should be used for this parameter. The initial value is zero.
GL_BUFFER_MAP_OFFSET  -  params returns the offset of the mapping into the buffer object established with glMapBuffer* . The i64v versions of these queries should be used for this parameter. The initial value is zero.
GL_BUFFER_SIZE  -  params returns the size of the buffer object, measured in bytes. The initial value is 0.
GL_BUFFER_STORAGE_FLAGS  -  GL_MAP_WRITE_BIT | GL_DYNAMIC_STORAGE_BIT | GL_MAP_WRITE_BIT . The initial value is zero.
GL_BUFFER_USAGE  -  params returns the buffer object's usage pattern. The initial value is GL_STATIC_DRAW .


Notes[edit]

If an error is generated, no change is made to the contents of data .

The GL_ATOMIC_COUNTER_BUFFER target is available only if the GL version is 4.2 or greater.

The GL_DISPATCH_INDIRECT_BUFFER and GL_SHADER_STORAGE_BUFFER targets are available only if the GL version is 4.3 or greater.

The GL_QUERY_BUFFER target is available only if the GL version is 4.4 or greater.


Errors[edit]

 GL_INVALID_ENUM is generated by glGetBufferParameter* if target is not one of the accepted buffer targets.

 GL_INVALID_OPERATION is generated by glGetBufferParameter* if zero is bound to target .

 GL_INVALID_OPERATION is generated by glGetNamedBufferParameter* if buffer is not the name of an existing buffer object.

 GL_INVALID_ENUM is generated if pname is not one of the buffer object parameter names described above.


Version Support[edit]

 glGetBufferParameteri64v  3.2+
 glGetBufferParameteriv  2.0+
 glGetNamedBufferParameteri64v  4.5+
 glGetNamedBufferParameteriv  4.5+

See Also[edit]

 glBindBuffer , glBufferData , glGetBufferPointerv , glMapBuffer , glUnmapBuffer 


Copyright[edit]

Copyright© 2005 Addison-Wesley. Copyright© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.