pyglet.graphics.vertexdomain

Manage related vertex attributes within a single vertex domain.

A vertex “domain” consists of a set of attribute descriptions that together describe the layout of one or more vertex buffers which are used together to specify the vertices in a primitive. Additionally, the domain manages the buffers used to store the data and will resize them as necessary to accommodate new vertices.

Domains can optionally be indexed, in which case they also manage a buffer containing vertex indices. This buffer is grown separately and has no size relation to the attribute buffers.

Applications can create vertices (and optionally, indices) within a domain with the VertexDomain.create() method. This returns a VertexList representing the list of vertices created. The vertex attribute data within the group can be modified, and the changes will be made to the underlying buffers automatically.

The entire domain can be efficiently drawn in one step with the VertexDomain.draw() method, assuming all the vertices comprise primitives of the same OpenGL primitive mode.

class IndexedVertexDomain

Management of a set of indexed vertex lists.

Construction of an indexed vertex domain is usually done with the create_domain() function.

index_allocator: Allocator
index_buffer: IndexedBufferObject
index_c_type: Type[_SimpleCData]
index_element_size: int
index_gl_type: int
class IndexedVertexList

A list of vertices within an IndexedVertexDomain that are indexed.

Use IndexedVertexDomain.create() to construct this list.

domain: IndexedVertexDomain | InstancedIndexedVertexDomain
index_count: int
index_start: int
indexed: bool = True
property indices: list[int]

Array of index data.

class InstancedIndexedVertexDomain

Management of a set of indexed vertex lists.

Construction of an indexed vertex domain is usually done with the create_domain() function.

class InstancedVertexDomain
instance_allocator: Allocator
property is_empty: bool
class VertexDomain

Management of a set of vertex lists.

Construction of a vertex domain is usually done with the create_domain() function.

allocator: Allocator
attrib_name_buffers: dict[str, AttributeBufferObject]
attribute_meta: dict[str, dict[str, Any]]
attribute_names: dict[str, Attribute]
buffer_attributes: list[tuple[AttributeBufferObject, Attribute]]
property is_empty: bool
vao: VertexArray
class VertexInstance
property domain: InstancedVertexDomain | InstancedIndexedVertexDomain
id: int
start: int
class VertexList

A list of vertices within a VertexDomain.

Use VertexDomain.create() to construct this list.

count: int
domain: VertexDomain | InstancedVertexDomain
indexed: bool = False
initial_attribs: dict
instanced: bool = False
start: int