VertexArray#
- class moderngl.VertexArray#
Note
Compared to OpenGL,
VertexArray
objects have some additional responsibilities:Binding a
Program
whenVertexArray.render()
orVertexArray.transform()
is called.Subroutines can be assigned. Please see the example below.
Create#
- Context.simple_vertex_array(program: Program, buffer: Buffer, *attributes: Union[List[str], Tuple[str, ...]], index_buffer: Optional[Buffer] = None, index_element_size: int = 4, mode: Optional[int] = None) VertexArray
- Context.vertex_array(*args, **kwargs) VertexArray
Methods#
- VertexArray.render(mode: Optional[int] = None, vertices: int = -1, *, first: int = 0, instances: int = -1) None #
- VertexArray.render_indirect(buffer: Buffer, mode: Optional[int] = None, count: int = -1, *, first: int = 0) None #
- VertexArray.transform(buffer: Union[Buffer, List[Buffer]], mode: Optional[int] = None, vertices: int = -1, *, first: int = 0, instances: int = -1, buffer_offset: int = 0) None #
- VertexArray.bind(attribute: int, cls: str, buffer: Buffer, fmt: str, *, offset: int = 0, stride: int = 0, divisor: int = 0, normalize: bool = False) None #
- VertexArray.release() None #
Attributes#
- VertexArray.mode#
- VertexArray.program#
- VertexArray.index_buffer#
- VertexArray.index_element_size#
- VertexArray.scope#
- VertexArray.vertices#
- VertexArray.instances#
- VertexArray.subroutines#
- VertexArray.glo#
- VertexArray.mglo#
- VertexArray.extra#
- VertexArray.ctx#