1 | #ifndef __interleave_h_ |
---|
2 | #define __interleave_h_ |
---|
3 | |
---|
4 | #include "GL/glut.h" |
---|
5 | |
---|
6 | #include "color.h" |
---|
7 | #include "mesh.h" |
---|
8 | #include "change.h" |
---|
9 | |
---|
10 | namespace VMI |
---|
11 | { |
---|
12 | |
---|
13 | typedef struct _VertexIL { |
---|
14 | float tx, ty; // texture coordinates |
---|
15 | GLubyte r, g, b, a; // color |
---|
16 | float x, y, z; // position coordinates |
---|
17 | } VertexIL; |
---|
18 | |
---|
19 | typedef struct _Vertex_{ |
---|
20 | float x, y, z; // position |
---|
21 | } Vertex_; |
---|
22 | |
---|
23 | extern GLuint vertex_buf, color_buf; |
---|
24 | |
---|
25 | extern Vertex_ *buf_vertices; |
---|
26 | extern Color *buf_colors; |
---|
27 | |
---|
28 | extern Vertex_ *pbuf_vertices; |
---|
29 | extern Color *pbuf_colors; |
---|
30 | |
---|
31 | extern void saveVertexBuffer(Change *c, VertexIL *dest); |
---|
32 | extern void loadVertexBuffer(VertexIL *src, Change *c); |
---|
33 | |
---|
34 | extern VertexIL *setupInterleave(Mesh *mesh, Color *colors); |
---|
35 | extern void setupVertexArray(Mesh *mesh, Color *colors); |
---|
36 | extern void updateVertexArray(Mesh *mesh, Change *c); |
---|
37 | extern void setupVertexBufferObjects(Mesh *mesh, Color *colors); |
---|
38 | extern void updateVertexBufferObjects(Mesh *mesh, Change *c); |
---|
39 | extern void printInterleave(VertexIL *interleave, int num); |
---|
40 | extern void updateAllColorInterleave(VertexIL *interleave, int num, Color *colors); |
---|
41 | extern void updateColorInterleave(VertexIL *interleave, int num, Color *colors, int begin, int end); |
---|
42 | extern void fillColorInterleave(VertexIL *interleave, int num, int begin, int end, GLubyte color); |
---|
43 | |
---|
44 | } |
---|
45 | |
---|
46 | #endif |
---|