evolving the basic gfx abstractions
[nexus3d] / src / gl / gfx_gl.h
diff --git a/src/gl/gfx_gl.h b/src/gl/gfx_gl.h
new file mode 100644 (file)
index 0000000..01fa5c8
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef NEXUS3D_GFX_GL_H_
+#define NEXUS3D_GFX_GL_H_
+
+#include <stddef.h>
+#include "gfx.h"
+
+struct nex_buffer {
+       unsigned int bo;
+       size_t size;
+};
+
+#define MAX_VAO_BUF            8
+#define MAX_VAO_ATTR   32
+
+struct nex_attr_desc {
+       enum nex_vattr_type type;
+       unsigned int size, bufid;
+};
+
+struct nex_geometry {
+       unsigned int vao;
+       const struct nex_buffer *buf[MAX_VAO_BUF];
+       const struct nex_buffer *ibuf;
+       struct nex_attr_desc attr[MAX_VAO_ATTR];
+       unsigned int vcount;    /* computed by buf size / attr size */
+};
+
+#define MAX_SDR_CONST  64
+
+struct nex_shader {
+       unsigned int sdr;
+       enum nex_sdr_type type;
+       char *name;
+       int src, compiled, nref;
+
+       unsigned int cidx[MAX_SDR_CONST];
+       unsigned int cval[MAX_SDR_CONST];
+       unsigned int num_const;
+};
+
+#define MAX_SDRPROG_SDR        8
+
+struct nex_sdrprog {
+       unsigned int prog;
+
+       nex_shader *sdr[MAX_SDRPROG_SDR];
+       int num_sdr;
+};
+
+#endif /* NEXUS3D_GFX_GL_H_ */