summaryrefslogtreecommitdiff
path: root/src/maths/primitives.c
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-27 17:40:29 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-27 17:40:29 +1000
commitbaa4f15774e2eb179a9b6ad6f3b781e0c3e85af3 (patch)
tree71c7cbc81f86d720e730c0d314b9b295d2f8141d /src/maths/primitives.c
parentaa0fe8457cfff9c47c0c9fa4a1c86a79c7cbf9c5 (diff)
remove the editor folder
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;