summaryrefslogtreecommitdiff
path: root/src/maths
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-11 00:22:13 +1000
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-11 00:22:13 +1000
commiteedd332680dbdd367197616658903f00252f5a9c (patch)
treeb50b7fe4c014abd8fee65a2cb1567d8df9a38e7e /src/maths
parent3bd21c92678c62e61c10ba730e8c839edc5e967a (diff)
upload data using staging buffer. use vertex buffer data
Diffstat (limited to 'src/maths')
-rw-r--r--src/maths/maths.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/maths/maths.h b/src/maths/maths.h
index 88a5215..217f2e0 100644
--- a/src/maths/maths.h
+++ b/src/maths/maths.h
@@ -21,7 +21,7 @@
// Dimension 3
static inline vec3 vec3_create(f32 x, f32 y, f32 z) { return (vec3){ x, y, z }; }
-#define vec3(x, y, z) (vec3_create(x, y, z))
+#define vec3(x, y, z) ((vec3){ x, y, z })
static inline vec3 vec3_add(vec3 a, vec3 b) { return (vec3){ a.x + b.x, a.y + b.y, a.z + b.z }; }
static inline vec3 vec3_sub(vec3 a, vec3 b) { return (vec3){ a.x - b.x, a.y - b.y, a.z - b.z }; }
static inline vec3 vec3_mult(vec3 a, f32 s) { return (vec3){ a.x * s, a.y * s, a.z * s }; }
@@ -53,6 +53,7 @@ static inline void print_vec3(vec3 v) { printf("{ x: %f, y: %f, z: %f )\n", v.x,
// TODO: Dimension 2
static inline vec2 vec2_create(f32 x, f32 y) { return (vec2){ x, y }; }
+#define vec2(x, y) ((vec2){ x, y })
static inline vec2 vec2_div(vec2 a, f32 s) { return (vec2){ a.x / s, a.y / s }; }
// TODO: Dimension 4
@@ -320,4 +321,4 @@ static inline mat4 transform_to_mat(transform *tf) {
_Static_assert(alignof(vec3) == 4, "vec3 is 4 byte aligned");
_Static_assert(sizeof(vec3) == 12, "vec3 is 12 bytes so has no padding");
-_Static_assert(alignof(vec4) == 4, "vec4 is 4 byte aligned"); \ No newline at end of file
+_Static_assert(alignof(vec4) == 4, "vec4 is 4 byte aligned");