logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

glGetBufferPointerv, glGetNamedBufferPointerv - return the pointer to a mapped buffer object's data store

C Specification

voidglGetBufferPointerv(GLenumtarget,GLenumpname,GLvoid**params);voidglGetNamedBufferPointerv(GLuintbuffer,GLenumpname,void**params);

Description

glGetBufferPointerv and glGetNamedBufferPointerv return the buffer pointer pname, which must be
       GL_BUFFER_MAP_POINTER. The single buffer map pointer is returned in params. A NULL pointer is returned if
       the buffer object's data store is not currently mapped; or if the requesting context did not map the
       buffer object's data store, and the implementation is unable to support mappings on multiple clients.

Errors

GL_INVALID_ENUM is generated if by glGetBufferPointerv if target is not one of the accepted buffer
       targets, or if pname is not GL_BUFFER_MAP_POINTER.

       GL_INVALID_OPERATION is generated by glGetBufferPointerv if zero is bound to target.

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

Name

       glGetBufferPointerv, glGetNamedBufferPointerv - return the pointer to a mapped buffer object's data store

Notes

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

       The initial value for the pointer is NULL.

       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.

Parameters

target
           Specifies the target to which the buffer object is bound for glGetBufferPointerv, which must be one
           of the buffer binding targets in the following table:
           ┌──────────────────────────────┬────────────────────────────────────┐
           │ BufferBindingTargetPurpose                            │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_ARRAY_BUFFER              │ Vertex attributes                  │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_ATOMIC_COUNTER_BUFFER     │ Atomic counter storage             │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_COPY_READ_BUFFER          │ Buffer copy source                 │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_COPY_WRITE_BUFFER         │ Buffer copy destination            │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_DISPATCH_INDIRECT_BUFFER  │ Indirect compute dispatch commands │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_DRAW_INDIRECT_BUFFER      │ Indirect command arguments         │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_ELEMENT_ARRAY_BUFFER      │ Vertex array indices               │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_PIXEL_PACK_BUFFER         │ Pixel read target                  │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_PIXEL_UNPACK_BUFFER       │ Texture data source                │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_QUERY_BUFFER              │ Query result buffer                │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_SHADER_STORAGE_BUFFER     │ Read-write storage for shaders     │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_TEXTURE_BUFFER            │ Texture data buffer                │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_TRANSFORM_FEEDBACK_BUFFER │ Transform feedback buffer          │
           ├──────────────────────────────┼────────────────────────────────────┤
           │ GL_UNIFORM_BUFFER            │ Uniform block storage              │
           └──────────────────────────────┴────────────────────────────────────┘

       buffer
           Specifies the name of the buffer object for glGetNamedBufferPointerv.

       pname
           Specifies the name of the pointer to be returned. Must be GL_BUFFER_MAP_POINTER.

       params
           Returns the pointer value specified by pname.

See Also

glBindBuffer(), glMapBuffer()

Version Support

       ┌──────────────────────────┬───────────────────────────────────────────────────────────────────────┐
       │                          │                OpenGLVersion                                         │
       ├──────────────────────────┼─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
       │ Function2.02.13.03.13.23.34.04.14.24.34.44.5 │
       │ /                        │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Feature                  │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Name                     │     │     │     │     │     │     │     │     │     │     │     │     │
       ├──────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
       │ glGetBufferPointerv      │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │  ✔  │
       ├──────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
       │ glGetNamedBufferPointerv │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  ✔  │
       └──────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘

See Also