Index: trunk/src/gl/gl_context.cc
===================================================================
--- trunk/src/gl/gl_context.cc	(revision 108)
+++ trunk/src/gl/gl_context.cc	(revision 116)
@@ -363,5 +363,12 @@
 		p->bind();
 		va->bind();
-		glDrawArrays( primitive_to_enum(prim), 0, count);
+		if ( va->has_index_buffer() )
+		{
+			glDrawElements( primitive_to_enum(prim), count, datatype_to_gl_enum( va->get_index_buffer_type() ), 0 );
+		}
+		else
+		{
+			glDrawArrays( primitive_to_enum(prim), 0, count);
+		}
 		va->unbind();
 		p->unbind();
Index: trunk/src/gl/gl_vertex_buffer.cc
===================================================================
--- trunk/src/gl/gl_vertex_buffer.cc	(revision 108)
+++ trunk/src/gl/gl_vertex_buffer.cc	(revision 116)
@@ -92,8 +92,17 @@
 	}
 
+	if ( m_index )
+	{
+		m_index->bind();
+	}
 }
 
 void gl_vertex_array::unbind()
 {
+	if ( m_index )
+	{
+		m_index->unbind();
+	}
+
 	for ( vertex_buffer_attribute_map::iterator i = m_map.begin(); 	i != m_map.end(); ++i ) 
 	{
