... | @@ -16,6 +16,8 @@ canvas.add_data(verts, colors, indices) |
... | @@ -16,6 +16,8 @@ canvas.add_data(verts, colors, indices) |
|
geom = canvas.compile()
|
|
geom = canvas.compile()
|
|
|
|
|
|
# then you can pass all shapes in one go to the batch draw.
|
|
# then you can pass all shapes in one go to the batch draw.
|
|
|
|
# -- importing the appropriate `batch_from_shader` and `gpu` too. (not shown here)
|
|
|
|
shader = gpu.shader.from_builtin('2D_SMOOTH_COLOR')
|
|
batch = batch_for_shader(shader, 'TRIS', {"pos": geom.vectors, "color": geom.vertex_colors}, indices=geom.indices)
|
|
batch = batch_for_shader(shader, 'TRIS', {"pos": geom.vectors, "color": geom.vertex_colors}, indices=geom.indices)
|
|
batch.draw(shader)
|
|
batch.draw(shader)
|
|
```
|
|
```
|
... | | ... | |