create_attribute_usage Function

Defined in pyglet.graphics.vertexdomain

create_attribute_usage(format)

Create an attribute and usage pair from a format string. The format string is as documented in pyglet.graphics.vertexattribute, with the addition of an optional usage component:

usage ::= attribute ( '/' ('static' | 'dynamic' | 'stream' | 'none') )?

If the usage is not given it defaults to ‘dynamic’. The usage corresponds to the OpenGL VBO usage hint, and for static also indicates a preference for interleaved arrays. If none is specified a buffer object is not created, and vertex data is stored in system memory.

Some examples:

v3f/stream
3D vertex position using floats, for stream usage
c4b/static
4-byte color attribute, for static usage
Returns:attribute, usage

Previous topic

VertexList Class

Next topic

create_domain Function