moderngl.VertexArray
Note
Compared to OpenGL, :pyVertexArray
objects have some additional responsibilities:
- Binding a :py
Program
when :pyVertexArray.render
or :pyVertexArray.transform
is called. - Subroutines can be assigned. Please see the example below.
Context.simple_vertex_array(program, buffer, *attributes, index_buffer=None) -> VertexArray
Context.vertex_array(program, content, index_buffer=None, skip_errors=False) -> VertexArray
VertexArray.render(mode=None, vertices=-1, first=0, instances=1)
VertexArray.render_indirect(buffer, mode=None, count=-1, first=0)
VertexArray.transform(buffer, mode=None, vertices=-1, first=0, instances=1)
VertexArray.bind(attribute, cls, buffer, fmt, offset=0, stride=0, divisor=0, normalize=False)
VertexArray.program
VertexArray.index_buffer
VertexArray.vertices
VertexArray.subroutines
VertexArray.glo