diff options
author | jvech <jmvalenciae@unal.edu.co> | 2022-10-30 19:44:00 -0500 |
---|---|---|
committer | jvech <jmvalenciae@unal.edu.co> | 2022-10-30 19:44:00 -0500 |
commit | 30f2fb748307ea32000089cecaff4d0c4e3d5d73 (patch) | |
tree | 5bfdee9a5e276efea7035a1ec2af72dedf3635e4 /src/obj.h | |
parent | cd327bdfe911c1bf10266469dfaa85bd35420aea (diff) |
feat: mtl file reading added
Bugs to Fix:
- Reading from standard input cause segmentation error
- If the subsequent line to the last f component is a blank line mverse
will throw an error
- mtl path finding needs to be improved
- shaders must be improved
Diffstat (limited to 'src/obj.h')
-rw-r--r-- | src/obj.h | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -2,6 +2,7 @@ #define __OBJ__ #define OBJ_LINE_MAX_SIZE 1024 +#define OBJ_MAX_NAME 512 typedef struct { float position[3]; @@ -15,12 +16,24 @@ typedef struct { } Texture; typedef struct { + char name[OBJ_LINE_MAX_SIZE]; + float ka[3], kd[3], ks[3]; + unsigned int illum; + float ns; +} Material; + +typedef struct { Vertex *vertices; - Texture *textures; + Material material; unsigned int *indices; unsigned int indexSize, vertexSize; unsigned int VAO, EBO, VBO; } Mesh; -Mesh * objCreateMesh(const char *filename); +typedef struct { + Mesh *mesh; + unsigned int size; +} Obj; + +Obj objCreate(const char *filename); # endif |