psychopy.tools.gltools.VertexBufferInfo

class psychopy.tools.gltools.VertexBufferInfo(name=0, target=34962, usage=35044, dataType=5126, size=0, stride=0, shape=(0), userData=None)[source]

Vertex buffer object (VBO) descriptor.

This class only stores information about the VBO it refers to, it does not contain any actual array data associated with the VBO. Calling createVBO() returns instances of this class.

It is recommended to use gltools functions bindVBO(), unbindVBO(), mapBuffer(), etc. when working with these objects.

Parameters
  • name (GLuint or int) – OpenGL handle for the buffer.

  • target (GLenum or int, optional) – Target used when binding the buffer (e.g. GL_VERTEX_ARRAY or GL_ELEMENT_ARRAY_BUFFER). Default is GL_VERTEX_ARRAY)

  • usage (GLenum or int, optional) – Usage type for the array (i.e. GL_STATIC_DRAW).

  • dataType (Glenum, optional) – Data type of array. Default is GL_FLOAT.

  • size (int, optional) – Size of the buffer in bytes.

  • stride (int, optional) – Number of bytes between adjacent attributes. If 0, values are assumed to be tightly packed.

  • shape (tuple or list, optional) – Shape of the array used to create this VBO.

  • userData (dict, optional) – Optional user defined data associated with the VBO. If None, userData will be initialized as an empty dictionary.

__init__(name=0, target=34962, usage=35044, dataType=5126, size=0, stride=0, shape=(0), userData=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([name, target, usage, dataType, …])

Initialize self.

validate()

Check if the data contained in this descriptor matches what is actually present in the OpenGL state.

Attributes

dataType

hasBuffer

Check if the VBO assigned to name is a buffer.

isIndex

True if the buffer referred to by this object is an index array.

name

shape

size

stride

target

usage

userData


Back to top