const void *Batch::setup_draw() const
{
+ if(!get_buffer())
+ throw invalid_operation("Batch::setup_draw");
+
if(restart)
{
unsigned index = (index_type==UNSIGNED_INT ? 0xFFFFFFFF : 0xFFFF);
else if(restart_index && restart_index<=max_index)
set_restart_index(0);
- if(get_buffer())
- {
- refresh();
+ refresh();
- return reinterpret_cast<const void *>(get_offset());
- }
- else
- return &data[0];
+ return reinterpret_cast<const void *>(get_offset());
}
void Batch::set_restart_index(unsigned index)