Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.29 KB

vertex_array.rst

File metadata and controls

42 lines (30 loc) · 1.29 KB

VertexArray

moderngl.VertexArray

Note

Compared to OpenGL, :pyVertexArray objects have some additional responsibilities:

  • Binding a :pyProgram when :pyVertexArray.render or :pyVertexArray.transform is called.
  • Subroutines can be assigned. Please see the example below.

Create

Context.simple_vertex_array(program, buffer, *attributes, index_buffer=None) -> VertexArray

Context.vertex_array(program, content, index_buffer=None, skip_errors=False) -> VertexArray

Methods

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)

Attributes

VertexArray.program

VertexArray.index_buffer

VertexArray.vertices

VertexArray.subroutines

VertexArray.glo