]> git.lizzy.rs Git - shadowclad.git/blob - src/engine/asset.h
Calculate face normals from vertices
[shadowclad.git] / src / engine / asset.h
1 #ifndef ASSET_H_
2 #define ASSET_H_
3
4 #include <stddef.h>
5 #include <GL/gl.h>
6
7 #include "geometry.h"
8
9 typedef struct Solid Solid;
10 typedef struct Mesh Mesh;
11 typedef struct Face Face;
12 typedef struct Material Material;
13
14 struct Solid {
15         size_t numMeshes;
16         Mesh* meshes;
17         size_t numMaterials;
18         Material* materials;
19 };
20
21 struct Mesh {
22         size_t numVertices;
23         Vector3D* vertices;
24         Vector3D* normals;
25         Vector3D* textureCoords;
26         size_t numFaces;
27         Face* faces;
28         size_t materialIndex;
29 };
30
31 struct Face {
32         size_t numIndices;
33         size_t* indices;
34         Vector3D* normals;
35 };
36
37 struct Material {
38         GLuint textureId;
39 };
40
41 const Solid* importSolid(const char* path);
42
43 #endif // ASSET_H_