summaryrefslogtreecommitdiffstats
path: root/obj.h
diff options
context:
space:
mode:
Diffstat (limited to 'obj.h')
-rw-r--r--obj.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/obj.h b/obj.h
new file mode 100644
index 0000000..962d325
--- /dev/null
+++ b/obj.h
@@ -0,0 +1,36 @@
+#ifndef OBJ_H
+#define OBJ_H
+
+typedef struct
+{
+ float x, y, z;
+} ObjVertex;
+typedef ObjVertex ObjNormal;
+
+typedef struct
+{
+ float u, v;
+} ObjTexCoord;
+
+typedef struct
+{
+ int Vertex[3];
+ int Normal[3];
+ int TexCoord[3];
+} ObjTriangle;
+
+typedef struct
+{
+ int nVertex, nNormal, nTexCoord, nTriangle;
+
+ ObjVertex *VertexArray;
+ ObjNormal *NormalArray;
+ ObjTexCoord *TexCoordArray;
+ ObjTriangle *TriangleArray;
+} ObjModel;
+
+ObjModel *ObjLoadModel(char *, size_t);
+size_t ObjLoadFile(char *, char **);
+
+#endif
+