-// allocates a static element array buffer object
-// (storing triangle data in video memory)
-int R_Mesh_CreateStaticEBO(void *data, size_t size);
-// frees an element array buffer object
-void R_Mesh_DestroyEBO(int bufferobject);
-// allocates a static vertex/element array buffer object
-// (storing vertex or element data in video memory)
-// target is GL_ELEMENT_ARRAY_BUFFER_ARB (triangle elements)
-// or GL_ARRAY_BUFFER_ARB (vertex data)
-int R_Mesh_CreateStaticBufferObject(unsigned int target, void *data, size_t size, const char *name);
-// frees a vertex/element array buffer object
-void R_Mesh_DestroyBufferObject(int bufferobject);
-void GL_Mesh_ListVBOs(qboolean printeach);
+
+// vertex buffer and index buffer creation/updating/freeing
+r_meshbuffer_t *R_Mesh_CreateMeshBuffer(const void *data, size_t size, const char *name, qbool isindexbuffer, qbool isuniformbuffer, qbool isdynamic, qbool isindex16);
+void R_Mesh_UpdateMeshBuffer(r_meshbuffer_t *buffer, const void *data, size_t size, qbool subdata, size_t offset);
+void R_Mesh_DestroyMeshBuffer(r_meshbuffer_t *buffer);
+void GL_Mesh_ListVBOs(qbool printeach);
+
+void R_Mesh_PrepareVertices_Vertex3f(int numvertices, const float *vertex3f, const r_meshbuffer_t *buffer, int bufferoffset);
+void R_Mesh_PrepareVertices_Generic_Arrays(int numvertices, const float *vertex3f, const float *color4f, const float *texcoord2f);
+void R_Mesh_PrepareVertices_Mesh_Arrays(int numvertices, const float *vertex3f, const float *svector3f, const float *tvector3f, const float *normal3f, const float *color4f, const float *texcoordtexture2f, const float *texcoordlightmap2f);