aboutsummaryrefslogtreecommitdiff
path: root/src/vecmath.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vecmath.h')
-rw-r--r--src/vecmath.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/vecmath.h b/src/vecmath.h
new file mode 100644
index 0000000..3b6f5b6
--- /dev/null
+++ b/src/vecmath.h
@@ -0,0 +1,33 @@
+#ifndef VECMATH_H_
+#define VECMATH_H_
+
+#include <stdint.h>
+
+typedef struct {
+ int x;
+ int y;
+} Vec2i;
+
+typedef struct {
+ float x;
+ float y;
+ float z;
+} Vec3f;
+
+typedef struct {
+ float r;
+ float g;
+ float b;
+} Color;
+
+
+Vec3f vec3f_sub(Vec3f lhs, Vec3f rhs);
+Vec3f vec3f_add(Vec3f lhs, Vec3f rhs);
+float vec3f_dot(Vec3f lhs, Vec3f rhs);
+Vec3f vec3f_neg(Vec3f v);
+Vec3f vec3f_normalize(Vec3f vec);
+Vec3f vec3f_mul(float a, Vec3f v);
+void vec3f_show(const char *name, Vec3f v);
+Color icolor(int32_t rgb);
+
+#endif