# Module pyglet.graphics.vertexbuffer

Byte abstractions of Vertex Buffer Objects and vertex arrays.

Use create_buffer or create_mappable_buffer to create a Vertex Buffer Object, or a vertex array if VBOs are not supported by the current context.

Buffers can optionally be created "mappable" (incorporating the AbstractMappable mix-in). In this case the buffer provides a `get_region` method which provides the most efficient path for updating partial data within the buffer.

## Classes

| AbstractBuffer Abstract buffer of byte data.
| AbstractMappable
| VertexArray A ctypes implementation of a vertex array.
| VertexBufferObject Lightweight representation of an OpenGL VBO.
| MappableVertexBufferObject A VBO with system-memory backed store.
| AbstractBufferRegion A mapped region of a buffer.
| VertexBufferObjectRegion A mapped region of a VBO.
| VertexArrayRegion A mapped region of a vertex array.
| IndirectArrayRegion A mapped region in which data elements are not necessarily contiguous.

## Functions

AbstractBuffer | create_buffer(size, target=34962, usage=35048, vbo=True) Create a buffer of vertex data.
AbstractBuffer with AbstractMappable | create_mappable_buffer(size, target=34962, usage=35048, vbo=True) Create a mappable buffer of vertex data.

## Function Details

### create_buffer

create_buffer(size, target=34962, usage=35048, vbo=True)
Create a buffer of vertex data.

Parameters:
  size : int
    Size of the buffer, in bytes
  target : int
    OpenGL target buffer
  usage : int
    OpenGL usage constant
  vbo : bool
    True if a VertexBufferObject should be created if the driver supports it; otherwise only a VertexArray is created.
Returns: AbstractBuffer

### create_mappable_buffer

create_mappable_buffer(size, target=34962, usage=35048, vbo=True)
Create a mappable buffer of vertex data.

Parameters:
  size : int
    Size of the buffer, in bytes
  target : int
    OpenGL target buffer
  usage : int
    OpenGL usage constant
  vbo : bool
    True if a VertexBufferObject should be created if the driver supports it; otherwise only a VertexArray is created.
Returns: AbstractBuffer with AbstractMappable