Buffers

Buffer objects are OpenGL objects that store an array of unformatted memory allocated by the OpenGL context (aka: the GPU). These can be used to store vertex data, pixel data retrieved from images or the framebuffer, and a variety of other things.

Read more on buffer objects on OpenGL Wiki

Example usage:

dtype = [("position", np.float32, 3),
         ("color",    np.float32, 4)]
V = np.zeros(4,dtype).view(gloo.VertexBuffer)

Content

Buffer

class glumpy.gloo.Buffer(target, usage=GL_DYNAMIC_DRAW)

Bases: glumpy.gloo.gpudata.GPUData, glumpy.gloo.globject.GLObject

Generic GPU buffer.

A generic buffer is an interface used to upload data to a GPU array buffer (gl.GL_ARRAY_BUFFER or gl.GL_ELEMENT_ARRAY_BUFFER).

need_update

Whether object needs to be updated

VertexBuffer

class glumpy.gloo.VertexBuffer(usage=GL_DYNAMIC_DRAW)

Bases: glumpy.gloo.buffer.Buffer

Buffer for vertex attribute data

IndexBuffer

class glumpy.gloo.IndexBuffer(usage=GL_DYNAMIC_DRAW)

Bases: glumpy.gloo.buffer.Buffer

Buffer for index data