glBufferData

creates and initializes a buffer object's data store

Signature

glBufferData( GLenum ( target ) , GLsizeiptr ( size ) , const GLvoid * ( data ) , GLenum ( usage ) )-> void
glBufferData( target , size , data , usage )
Copy given data into the currently bound vertex-buffer-data object

    target -- the symbolic constant indicating which buffer type is intended
    size -- if provided, the count-in-bytes of the array
    data -- data-pointer to be used, may be None to initialize without
        copying over a data-set
    usage -- hint to the driver as to how to set up access to the buffer

    Note: parameter "size" can be omitted, which makes the signature
        glBufferData( target, data, usage )
    instead of:
        glBufferData( target, size, data, usage )
    

Parameters

VariablesDescription
target
Specifies the target buffer object. The symbolic constant must be GL_ARRAY_BUFFER , GL_ATOMIC_COUNTER_BUFFER , GL_COPY_READ_BUFFER , GL_COPY_WRITE_BUFFER , GL_DRAW_INDIRECT_BUFFER , GL_DISPATCH_INDIRECT_BUFFER , GL_ELEMENT_ARRAY_BUFFER , GL_PIXEL_PACK_BUFFER , GL_PIXEL_UNPACK_BUFFER , GL_QUERY_BUFFER , GL_SHADER_STORAGE_BUFFER , GL_TEXTURE_BUFFER , GL_TRANSFORM_FEEDBACK_BUFFER , or GL_UNIFORM_BUFFER .
size
Specifies the size in bytes of the buffer object's new data store.
data
Specifies a pointer to data that will be copied into the data store for initialization, or NULL if no data is to be copied.
usage
Specifies the expected usage pattern of the data store. The symbolic constant must be GL_STREAM_DRAW , GL_STREAM_READ , GL_STREAM_COPY , GL_STATIC_DRAW , GL_STATIC_READ , GL_STATIC_COPY , GL_DYNAMIC_DRAW , GL_DYNAMIC_READ , or GL_DYNAMIC_COPY .

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glBufferData
{LGPL} Pyggel pyggel/data.py Lines: 347, 353, 359, 365
OpenGL Tutorial (Python Translation) t02.playing-with-colors/FragPosition.py Lines: 64
OpenGL Tutorial (Python Translation) t02.playing-with-colors/VertexColors.py Lines: 67
OpenGL Tutorial (Python Translation) t01.hello-triangle/HelloTriangle.py Lines: 78
{GPL3} OpenGL-Programmable 06-perpixel.py Lines: 170, 173
{GPL3} OpenGL-Programmable 09-gles2.py Lines: 153, 207, 210, 261
{GPL3} OpenGL-Programmable 10-gl3.2core.py Lines: 161, 217, 220, 271
{GPL3} OpenGL-Programmable 08-pbo.py Lines: 135, 188, 191, 239
{GPL3} OpenGL-Programmable 05-shader.py Lines: 162, 165
{GPL3} OpenGL-Programmable 07-attrib.py Lines: 177, 180
{GPL3} OpenGL-Programmable 04-vbo.py Lines: 96, 99