]> git.lizzy.rs Git - shadowclad.git/blob - src/engine/asset.h
Add copyright and license notices in source code
[shadowclad.git] / src / engine / asset.h
1 /**
2  * Copyright 2019-2020 Iwo 'Outfrost' Bujkiewicz
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8
9 #ifndef ENGINE_ASSET_H_
10 #define ENGINE_ASSET_H_
11
12 #include <stddef.h>
13 #include <GL/gl.h>
14
15 #include "geometry.h"
16
17 typedef struct Solid Solid;
18 typedef struct Mesh Mesh;
19 typedef struct Face Face;
20 typedef struct Material Material;
21
22 struct Solid {
23         size_t numMeshes;
24         Mesh* meshes;
25         size_t numMaterials;
26         Material* materials;
27 };
28
29 struct Mesh {
30         size_t numVertices;
31         Vector* vertices;
32         Vector* normals;
33         Vector* textureCoords;
34         size_t numFaces;
35         Face* faces;
36         size_t materialIndex;
37 };
38
39 struct Face {
40         size_t numIndices;
41         size_t* indices;
42         Vector* normals;
43 };
44
45 struct Material {
46         GLuint textureId;
47 };
48
49 const Solid* importSolid(const char* path);
50
51 #endif // ENGINE_ASSET_H_