psychopy.tools.gltools.drawVAO

psychopy.tools.gltools.drawVAO(vao, mode=4, start=0, count=None, instanceCount=None, flush=False)[source]

Draw a vertex array object. Uses glDrawArrays or glDrawElements if instanceCount is None, or else glDrawArraysInstanced or glDrawElementsInstanced is used.

Parameters:
  • vao (VertexArrayObject) – Vertex Array Object (VAO) to draw.

  • mode (int, optional) – Drawing mode to use (e.g. GL_TRIANGLES, GL_QUADS, GL_POINTS, etc.)

  • start (int, optional) – Starting index for array elements. Default is 0 which is the beginning of the array.

  • count (int, optional) – Number of indices to draw from start. Must not exceed vao.count - start.

  • instanceCount (int or None) – Number of instances to draw. If >0 and not None, instanced drawing will be used.

  • flush (bool, optional) – Flush queued drawing commands before returning.

Examples

Creating a VAO and drawing it:

# draw the VAO, renders the mesh
drawVAO(vaoDesc, GL.GL_TRIANGLES)

Back to top