01fa5c89884ebf874a08ee3dd7d26de1c1f0056e
[nexus3d] / src / gl / gfx_gl.h
1 #ifndef NEXUS3D_GFX_GL_H_
2 #define NEXUS3D_GFX_GL_H_
3
4 #include <stddef.h>
5 #include "gfx.h"
6
7 struct nex_buffer {
8         unsigned int bo;
9         size_t size;
10 };
11
12 #define MAX_VAO_BUF             8
13 #define MAX_VAO_ATTR    32
14
15 struct nex_attr_desc {
16         enum nex_vattr_type type;
17         unsigned int size, bufid;
18 };
19
20 struct nex_geometry {
21         unsigned int vao;
22         const struct nex_buffer *buf[MAX_VAO_BUF];
23         const struct nex_buffer *ibuf;
24         struct nex_attr_desc attr[MAX_VAO_ATTR];
25         unsigned int vcount;    /* computed by buf size / attr size */
26 };
27
28 #define MAX_SDR_CONST   64
29
30 struct nex_shader {
31         unsigned int sdr;
32         enum nex_sdr_type type;
33         char *name;
34         int src, compiled, nref;
35
36         unsigned int cidx[MAX_SDR_CONST];
37         unsigned int cval[MAX_SDR_CONST];
38         unsigned int num_const;
39 };
40
41 #define MAX_SDRPROG_SDR 8
42
43 struct nex_sdrprog {
44         unsigned int prog;
45
46         nex_shader *sdr[MAX_SDRPROG_SDR];
47         int num_sdr;
48 };
49
50 #endif  /* NEXUS3D_GFX_GL_H_ */