1 | #ifndef __buffers_h_ |
---|
2 | #define __buffers_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 VertexIL *saveVertexBuffer(Change *c, Vertex_ *verts, Color *cols); |
---|
24 | extern void loadVertexBuffer(VertexIL *src, Change *c, Vertex_ *verts, Color *cols); |
---|
25 | extern VertexIL *saveVertexBufferGPU(Change *c); |
---|
26 | extern void loadVertexBufferGPU(VertexIL *src, Change *c); |
---|
27 | |
---|
28 | extern VertexIL *setupInterleave(Mesh *mesh, Color *colors); |
---|
29 | extern void setupVertexArray(Mesh *mesh, Color *colors); |
---|
30 | extern void updateVertexArray(Mesh *mesh, Change *c, Vertex_ *verts, Color *cols); |
---|
31 | extern void setupVertexBufferObjects(Mesh *mesh, Color *colors); |
---|
32 | extern void updateVertexBufferObjects(Mesh *mesh, Change *c); |
---|
33 | extern void printInterleave(VertexIL *interleave, int num); |
---|
34 | extern void updateAllColorInterleave(VertexIL *interleave, int num, Color *colors); |
---|
35 | extern void updateColorInterleave(VertexIL *interleave, int num, Color *colors, int begin, int end); |
---|
36 | extern void fillColorInterleave(VertexIL *interleave, int num, int begin, int end, GLubyte color); |
---|
37 | |
---|
38 | } |
---|
39 | |
---|
40 | #endif |
---|