PyAPI: Make GPUVertFormat() argument optional

This commit is contained in:
Campbell Barton
2018-10-26 08:06:05 +11:00
parent b445d57ccf
commit 1d8ba9d618
2 changed files with 5 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ def draw_circle_2d(position, color, radius, segments):
seg = 32
mul = (1.0 / (seg - 1)) * (pi * 2)
verts = [(sin(i * mul), cos(i * mul)) for i in range(seg)]
fmt = GPUVertFormat(format=[])
fmt = GPUVertFormat()
pos_id = fmt.attr_add(id="pos", comp_type='F32', len=2, fetch_mode='FLOAT')
vbo = GPUVertBuf(len=len(verts), format=fmt)
vbo.attr_fill(id=pos_id, data=verts)