aboutsummaryrefslogtreecommitdiff
path: root/src/obj.h
diff options
context:
space:
mode:
authorjvech <jmvalenciae@unal.edu.co>2022-10-03 11:38:07 -0500
committerjvech <jmvalenciae@unal.edu.co>2022-10-03 11:38:07 -0500
commit8fad4fc153d162598e432ca5740c5ec401b46696 (patch)
tree32cdf567cb433397db9594202c7b15358e002eb2 /src/obj.h
parentfc8d7fed3ccdf0998a7b9809aa825f2d14876b29 (diff)
feat: obj file reading and rendering implemented
Diffstat (limited to 'src/obj.h')
-rw-r--r--src/obj.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/obj.h b/src/obj.h
new file mode 100644
index 0000000..864910f
--- /dev/null
+++ b/src/obj.h
@@ -0,0 +1,26 @@
+# ifndef __OBJ__
+#define __OBJ__
+
+#define OBJ_LINE_MAX_SIZE 1024
+
+typedef struct {
+ float position[3];
+ float normal[3];
+ float texCoords[2];
+} Vertex;
+
+typedef struct {
+ unsigned int id;
+ char type[50];
+} Texture;
+
+typedef struct {
+ Vertex *vertices;
+ Texture *textures;
+ unsigned int *indices;
+ unsigned int indexSize, vertexSize;
+ unsigned int VAO, EBO, VBO;
+} Mesh;
+
+Mesh * objCreateMesh(const char *filename);
+# endif
Feel free to download, copy and edit any repo