Godzil 3 år sedan
förälder
incheckning
8c1cb640f9
3 ändrade filer med 47 tillägg och 0 borttagningar
  1. 36 0
      source/include/vector.h
  2. 1 0
      source/main.c
  3. 10 0
      source/vector.c

+ 36 - 0
source/include/vector.h

@@ -0,0 +1,36 @@
+/*
+ * 3D Engine 
+ * vector.h: 
+ * Based on pikuma.com 3D software renderer in C
+ * Copyright (c) 2021 986-Studio. All rights reserved.
+ *
+ * Created by Manoël Trapier on 02/03/2021.
+ */
+
+#ifndef THREEDENGINE_SOURCE_INCLUDE_VECTOR_H
+#define THREEDENGINE_SOURCE_INCLUDE_VECTOR_H
+
+/***********************************************************************************************************************
+ * Data types
+ **********************************************************************************************************************/
+
+typedef struct vec2_t
+{
+    double x, y;
+} vec2_t;
+
+typedef struct vec3_t
+{
+    double x, y, z;
+} vec3_t;
+
+typedef struct vec4_t
+{
+    double x, y, z, w;
+} vec4_t;
+
+/***********************************************************************************************************************
+ * Prototypes
+ **********************************************************************************************************************/
+
+#endif /* THREEDENGINE_SOURCE_VECTOR_H */

+ 1 - 0
source/main.c

@@ -16,6 +16,7 @@
 #include <log.h>
 
 #include <display.h>
+#include <vector.h>
 
 void setup()
 {

+ 10 - 0
source/vector.c

@@ -0,0 +1,10 @@
+/*
+ * 3D Engine 
+ * vector.c: 
+ * Based on pikuma.com 3D software renderer in C
+ * Copyright (c) 2021 986-Studio. All rights reserved.
+ *
+ * Created by Manoël Trapier on 02/03/2021.
+ */
+
+#include <vector.h>