-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmesh.h
46 lines (36 loc) · 782 Bytes
/
mesh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef MESH_H
#define MESH_H
#include <GL/glew.h>
#include "render.h"
/* if >0, the offset of the attribute in the vertex memory layout */
typedef struct {
int pos;
int color;
int normal;
int texco;
} MeshAttributes;
/* the standard vertex for meshes */
typedef struct {
Position pos;
Normal normal;
Color color;
Texco texco;
} MeshVertex;
typedef struct {
MeshVertex *vertices;
uint32_t numVertices;
Face *faces;
uint32_t numFaces;
GLuint vao; /* vertex attribute object */
GLuint vbo;
GLuint ibo;
GLuint fbo; /* framebuffer object to render to */
GLuint color; /* color texture */
GLuint depth; /* depth texture */
} Mesh;
void init_Mesh();
Mesh *new_Mesh();
void del_Mesh(Mesh *);
void mesh_Load(Mesh *, const char *);
void mesh_Draw(Mesh *);
#endif