summaryrefslogtreecommitdiff
path: root/src/maths/primitives.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/maths/primitives.c')
-rw-r--r--src/maths/primitives.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/maths/primitives.c b/src/maths/primitives.c
index 32e7919..ceae260 100644
--- a/src/maths/primitives.c
+++ b/src/maths/primitives.c
@@ -45,9 +45,11 @@ Geometry Geo_CreatePlane(f32x2 extents) {
push_triangle(indices, 2, 1, 0);
push_triangle(indices, 3, 1, 2);
- Geometry geo = {
- .format = VERTEX_STATIC_3D, .vertices = vertices, .has_indices = true, .indices = indices
- };
+ Geometry geo = { .format = VERTEX_STATIC_3D,
+ .vertices = vertices,
+ .has_indices = true,
+ .index_count = indices->len,
+ .indices = indices };
// .colour = (rgba){ 0, 0, 0, 1 } };
return geo;
@@ -126,6 +128,7 @@ Geometry Geo_CreateCuboid(f32x3 extents) {
.format = VERTEX_STATIC_3D,
.vertices = vertices,
.has_indices = true,
+ .index_count = indices->len,
.indices = indices, // FIXME: make darray methods that return stack allocated struct
};
@@ -233,6 +236,7 @@ Geometry geo_create_uvsphere(f32 radius, u32 north_south_lines, u32 east_west_li
.format = VERTEX_STATIC_3D,
.vertices = vertices,
.has_indices = true,
+ .index_count = indices->len,
.indices = indices,
};
return geo;