GLGETBUFFERPOINTERV(3G)
π
GLGETBUFFERPOINTERV β the 3G girlies are back at it
okay so bestie, picture this: you mapped a buffer, the driver handed you a whole pointer, and now you're like "waitβ¦ what was that pointer again??" π That's literally the entire plot of this page. glGetBufferPointerv and glGetNamedBufferPointerv hand you back the pointer to a mapped buffer object's data store. No cap, that's it. π
β¨ C SPECIFICATION β¨
void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params);
void glGetNamedBufferPointerv(GLuint buffer, GLenum pname,
void **params);
πΈ PARAMETERS πΈ
- target β the target the buffer object is bound to for
glGetBufferPointerv. It must be one of the buffer binding targets from this little table of ours (yes I turned the table into a list, the vibes demanded it π ):GL_ARRAY_BUFFERβ vertex attributesGL_ATOMIC_COUNTER_BUFFERβ atomic counter storageGL_COPY_READ_BUFFERβ buffer copy sourceGL_COPY_WRITE_BUFFERβ buffer copy destinationGL_DISPATCH_INDIRECT_BUFFERβ indirect compute dispatch commandsGL_DRAW_INDIRECT_BUFFERβ indirect command argumentsGL_ELEMENT_ARRAY_BUFFERβ vertex array indicesGL_PIXEL_PACK_BUFFERβ pixel read targetGL_PIXEL_UNPACK_BUFFERβ texture data sourceGL_QUERY_BUFFERβ query result bufferGL_SHADER_STORAGE_BUFFERβ read-write storage for shadersGL_TEXTURE_BUFFERβ texture data bufferGL_TRANSFORM_FEEDBACK_BUFFERβ transform feedback bufferGL_UNIFORM_BUFFERβ uniform block storage
- buffer β the name of the buffer object for
glGetNamedBufferPointerv. (the "named" one, she's the DSA sister π¦) - pname β the name of the pointer you want returned. It must be
GL_BUFFER_MAP_POINTER. like, there is no other option, she's the only one at the party π - params β where the pointer value specified by pname comes back to you π«Ά
π DESCRIPTION π
glGetBufferPointerv and glGetNamedBufferPointerv return the buffer pointer pname, which must be GL_BUFFER_MAP_POINTER. The single buffer map pointer comes back in params.
And here's the part where you go "wait, NULL??" β a NULL pointer is returned in two situations, and I need you to actually read them bestie:
- 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.
so yeah, NULL is not always a you-problem, sometimes the driver just said "not today" π
π¦ NOTES π¦
- If an error is generated, no change is made to the contents of params. (she protects your pointer, queen behavior π₯)
- The initial value for the pointer is
NULL. - The
GL_ATOMIC_COUNTER_BUFFERtarget is available only if the GL version is 4.2 or greater. - The
GL_DISPATCH_INDIRECT_BUFFERandGL_SHADER_STORAGE_BUFFERtargets are available only if the GL version is 4.3 or greater. - The
GL_QUERY_BUFFERtarget is available only if the GL version is 4.4 or greater.
π ERRORS π
GL_INVALID_ENUMis generated byglGetBufferPointervif target is not one of the accepted buffer targets, or if pname is notGL_BUFFER_MAP_POINTER.GL_INVALID_OPERATIONis generated byglGetBufferPointervif zero is bound to target. (zero is literally nobody, do not bind her π)GL_INVALID_OPERATIONis generated byglGetNamedBufferPointervif buffer is not the name of an existing buffer object.
π VERSION SUPPORT π
the whole OpenGL version lineup is 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5 β and here's who showed up to which π
glGetBufferPointervββfor every single one: 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5. she's been here since day one and she never left, iconic βglGetNamedBufferPointervβ-for 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, andβonly for 4.5. she's a late bloomer and we love her for it π§
π SEE ALSO π
glBindBuffer()glMapBuffer()
go read those next, iykyk π
π COPYRIGHT π
Copyright Β© 2005 Addison-Wesley. Copyright Β© 2011-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/.
Copyright Β© 2005 Sams Publishing Copyright Β© 2011-2014 Khronos Group
okay that's the whole page, mwah π sign-off time: this one came from [FIXME: source], stamped 08/09/2021, and it lives under the name GLGETBUFFERPOINTERV(3G) β go map something and slay, bestie π
β¨
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms