simvx.graphics.draw2d_ops

Ordered op record for Draw2D.

Every Draw2D submission (fill, line, text, textured quad) appends a single Op to Draw2D._ops. Draw2DPass walks that list in order and coalesces adjacent same-(kind, clip, tex_id) ops into one GPU draw, so submission order is the GPU order. This is the canonical 2D ordering contract; there is no other mechanism.

Verts are stored as raw 8-float tuples (x, y, u, v, r, g, b, a) and indices as raw int lists; the pass concatenates per-run and builds the structured numpy buffer once at upload time. Carrying numpy arrays on every op was hot in the bullet-hell HUD workload (1000+ rects/frame).

Reserved fields (material_id, blend_mode) are not used today: they mark where per-call ShaderMaterial and BlendMode extensions land without re-shaping callers.

Module Contents

Classes

Data

API

simvx.graphics.draw2d_ops.__all__

[‘OpKind’, ‘Op’]

class simvx.graphics.draw2d_ops.OpKind[source]

Bases: enum.IntEnum

FILL

0

LINE

1

TEXT

2

TEX

3

__abs__()
__add__()
__and__()
__bool__()
__ceil__()
__delattr__()
__dir__()
__divmod__()
__eq__()
__float__()
__floor__()
__floordiv__()
__format__()
__ge__()
__getattribute__()
__getnewargs__()
__getstate__()
__gt__()
__hash__()
__index__()
__int__()
__invert__()
__le__()
__lshift__()
__lt__()
__mod__()
__mul__()
__ne__()
__neg__()
__new__()
__or__()
__pos__()
__pow__()
__radd__()
__rand__()
__rdivmod__()
__reduce__()
__reduce_ex__()
__repr__()
__rfloordiv__()
__rlshift__()
__rmod__()
__rmul__()
__ror__()
__round__()
__rpow__()
__rrshift__()
__rshift__()
__rsub__()
__rtruediv__()
__rxor__()
__setattr__()
__sizeof__()
__str__()
__sub__()
__subclasshook__()
__truediv__()
__trunc__()
__xor__()
as_integer_ratio()
bit_count()
bit_length()
conjugate()
class denominator
class imag
is_integer()
class numerator
class real
to_bytes()
__deepcopy__(memo)
__copy__()
name()
value()
class simvx.graphics.draw2d_ops.Op[source]

Bases: typing.NamedTuple

kind: simvx.graphics.draw2d_ops.OpKind

None

clip: tuple[int, int, int, int] | None

None

verts: list[tuple]

None

indices: list[int] | None

None

tex_id: int

None