Drawing using buffer elements with indices