Index: trunk/src/gl/gl_context.cc
===================================================================
--- trunk/src/gl/gl_context.cc	(revision 501)
+++ trunk/src/gl/gl_context.cc	(revision 502)
@@ -1057,2 +1057,23 @@
 	}
 }
+
+void nv::gl_context::draw_instanced( primitive prim, const render_state& rs, program p, size_t instances, vertex_array va, size_t count, size_t first /*= 0 */ )
+{
+	apply_render_state( rs );
+	const vertex_array_info* info = m_vertex_arrays.get( va );
+	if ( count > 0 && info )
+	{
+		bind( p );
+		bind( va );
+		if ( info->index.is_valid() )
+		{
+			glDrawElementsInstanced( primitive_to_enum( prim ), static_cast<GLsizei>( count ), datatype_to_gl_enum( info->index_type ), reinterpret_cast<const void*>( get_datatype_info( info->index_type ).size * first ), instances );
+		}
+		else
+		{
+			glDrawArraysInstanced( primitive_to_enum( prim ), static_cast<GLint>( first ), static_cast<GLsizei>( count ), instances );
+		}
+		unbind( va );
+		//unbind( p );
+	}
+}
