ofDocsdocumentation gl ofBufferObject

ofBufferObject


allocate( )

void allocate()

creates a buffer without allocating any memory yet glGenBuffers, allocates a GL buffer


allocate( ... )

void allocate(GLsizeiptr bytes, const void *data, GLenum usage)

allocate( ... )

void allocate(GLsizeiptr bytes, GLenum usage)

creates a buffer and allocates the required number of bytes glGenBuffers + glNamedBufferData: https://www.opengl.org/sdk/docs/man4/html/glBufferData.xhtml before GL 4.5 emulates glNamedBufferData by binding to last known target for this buffer uploading data to that target and unbinding again


bind( ... )

void bind(GLenum target)

glBindBuffer: https://www.opengl.org/sdk/docs/man4/html/glBindBuffer.xhtml


bindBase( ... )

void bindBase(GLenum target, GLuint index)

glBindBufferBase: https://www.opengl.org/sdk/docs/man4/html/glBindBufferBase.xhtml


bindRange( ... )

void bindRange(GLenum target, GLuint index, GLintptr offset, GLsizeiptr size)

glBindBufferRange: https://www.opengl.org/sdk/docs/man4/html/glBindBufferRange.xhtml


copyTo( ... )

void copyTo(ofBufferObject &dstBuffer)

copyTo( ... )

void copyTo(ofBufferObject &dstBuffer, int readOffset, int writeOffset, size_t size)

getId( )

GLuint getId()

returns the id of the buffer if it's allocated or 0 otherwise


invalidate( )

void invalidate()

isAllocated( )

bool isAllocated()

true if allocate was called before


map( ... )

void * map(GLenum access)

glMapNamedBuffer: https://www.opengl.org/sdk/docs/man4/html/glMapBuffer.xhtml before GL 4.5 emulates glMapNamedBuffer by binding to last known target for this buffer and mapping that target


map( ... )

T * map(GLenum access)

mapRange( ... )

void * mapRange(GLintptr offset, GLsizeiptr length, GLenum access)

glMapNamedBufferRange: https://www.opengl.org/sdk/docs/man4/html/glMapBufferRange.xhtml before GL 4.5 emulates glMapNamedBufferRange by binding to last known target for this buffer and mapping that target


mapRange( ... )

T * mapRange(GLintptr offset, GLsizeiptr length, GLenum access)

ofBufferObject( )

ofBufferObject()

setData( ... )

void setData(GLsizeiptr bytes, const void *data, GLenum usage)

glNamedBufferData: https://www.opengl.org/sdk/docs/man4/html/glBufferData.xhtml before GL 4.5 emulates glNamedBufferData by binding to last known target for this buffer uploading data to that target and unbinding again


size( )

GLsizeiptr size()

unbind( ... )

void unbind(GLenum target)

binds the passed target to buffer 0


unbindBase( ... )

void unbindBase(GLenum target, GLuint index)

binds the given target and index to buffer 0


unbindRange( ... )

void unbindRange(GLenum target, GLuint index)

binds the given target and index to 0


unmap( )

void unmap()

glUnmapNamedBuffer: https://www.opengl.org/sdk/docs/man4/html/glUnmapBuffer.xhtml before GL 4.5 emulates glUnmapNamedBuffer by unmapping and unbinding the last known target for this buffer


unmapRange( )

void unmapRange()

same as unmap, just to make the api more clear


updateData( ... )

void updateData(GLsizeiptr bytes, const void *data)

updateData( ... )

void updateData(GLintptr offset, GLsizeiptr bytes, const void *data)

glNamedBufferSubData: https://www.opengl.org/sdk/docs/man4/html/glBufferSubData.xhtml before GL 4.5 emulates glNamedBufferSubData by binding to last known target for this buffer uploading data to that target and unbinding again