#ifndef __GL_ARRAYS_H__
#define __GL_ARRAYS_H__

/*
====================================================================

// Knightmare: Vertex arrays

====================================================================
*/

#define VA_SetElem2(v,a,b)		((v)[0]=(a),(v)[1]=(b))
#define VA_SetElem3(v,a,b,c)	((v)[0]=(a),(v)[1]=(b),(v)[2]=(c))
#define VA_SetElem4(v,a,b,c,d)	((v)[0]=(a),(v)[1]=(b),(v)[2]=(c),(v)[3]=(d))

#define VA_SetElem2v(v,a)		((v)[0]=(a)[0],(v)[1]=(a)[1])
#define VA_SetElem3v(v,a)		((v)[0]=(a)[0],(v)[1]=(a)[1],(v)[2]=(a)[2])
#define VA_SetElem4v(v,a)		((v)[0]=(a)[0],(v)[1]=(a)[1],(v)[2]=(a)[2],(v)[3]=(a)[3])

#define MAX_TMUS		4
#define MAX_VERTICES	8192
#define MAX_INDICES		MAX_VERTICES * 3

extern unsigned	indexArray[MAX_INDICES];
extern float	texCoordArray[MAX_TMUS][MAX_VERTICES][2];
extern float	vertexArray[MAX_VERTICES][3];
extern float	colorArray[MAX_VERTICES][4];

extern unsigned	rb_vertex, rb_index;

void R_InitVertexArrays (void);
qboolean R_CheckArrayOverflow (int numVerts, int numIndex);
void R_DrawArrays (void);
void R_DrawRangeArrays (unsigned start, unsigned end);
void R_DrawPrimitiveArrays (GLenum mode);
void R_DrawMeshTris (void);
void R_RenderMeshGeneric (qboolean drawTris);
// end Knightmare

#endif /* __GL_ARRAYS_H__ */
