- if(EXT_draw_range_elements)
- glDrawRangeElements(prim_type, min_index, max_index, size(), data_type, data_ptr);
- else
- glDrawElements(prim_type, size(), data_type, data_ptr);
+ glDrawElements(prim_type, size(), data_type, data_ptr);
+}
+
+void Batch::draw_instanced(unsigned count) const
+{
+ static Require req(ARB_draw_instanced);
+
+ BindRestore _bind_ibuf(get_buffer(), ELEMENT_ARRAY_BUFFER);
+ const void *data_ptr = setup_draw();
+
+ glDrawElementsInstanced(prim_type, size(), data_type, data_ptr, count);