-
-// sets up the requested state
-void R_Mesh_State(const rmeshstate_t *m);
-
-// enlarges geometry buffers if they are too small
-#define R_Mesh_ResizeCheck(numverts, numtriangles) if ((numverts) > mesh_maxverts || (numtriangles) > mesh_maxtris) _R_Mesh_ResizeCheck(numverts, numtriangles);
-void _R_Mesh_ResizeCheck(int numverts, int numtriangles);
-
-// renders the mesh in the varray_* buffers
-void R_Mesh_Draw(int numverts, int numtriangles);
-
-// saves a section of the rendered frame to a .tga file
-qboolean SCR_ScreenShot(char *filename, int x, int y, int width, int height);
+// sets the vertex array pointer
+void R_Mesh_VertexPointer(const float *vertex3f, int bufferobject, size_t bufferoffset);
+// sets the color array pointer (GL_Color only works when this is NULL)
+void R_Mesh_ColorPointer(const float *color4f, int bufferobject, size_t bufferoffset);
+// sets the texcoord array pointer for an array unit
+void R_Mesh_TexCoordPointer(unsigned int unitnum, unsigned int numcomponents, const float *texcoord, int bufferobject, size_t bufferoffset);
+// sets all textures bound to an image unit (multiple can be non-zero at once, according to OpenGL rules the highest one overrides the others)
+void R_Mesh_TexBindAll(unsigned int unitnum, int tex1d, int tex2d, int tex3d, int texcubemap);
+// sets these are like TexBindAll with only one of the texture indices non-zero
+// (binds one texture type and unbinds all other types)
+void R_Mesh_TexBind1D(unsigned int unitnum, int texnum);
+void R_Mesh_TexBind(unsigned int unitnum, int texnum);
+void R_Mesh_TexBind3D(unsigned int unitnum, int texnum);
+void R_Mesh_TexBindCubeMap(unsigned int unitnum, int texnum);
+// sets the texcoord matrix for a texenv unit
+void R_Mesh_TexMatrix(unsigned int unitnum, const matrix4x4_t *matrix);
+// sets the combine state for a texenv unit
+void R_Mesh_TexCombine(unsigned int unitnum, int combinergb, int combinealpha, int rgbscale, int alphascale);
+// set up the requested texture state
+void R_Mesh_TextureState(const rmeshstate_t *m);
+// set up a blank texture state (faster/easier specialized version of R_Mesh_TextureState)
+void R_Mesh_ResetTextureState(void);
+
+// renders a mesh
+void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtriangles, const int *element3i, const unsigned short *element3s, int bufferobject3i, int bufferobject3s);
+
+// saves a section of the rendered frame to a .tga or .jpg file
+qboolean SCR_ScreenShot(char *filename, unsigned char *buffer1, unsigned char *buffer2, unsigned char *buffer3, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg, qboolean gammacorrect);