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