Batch::Batch(PrimitiveType t):
prim_type(t),
index_type(UNSIGNED_SHORT),
+ gl_index_type(get_gl_type(index_type)),
max_index(0),
restart(false)
{ }
shrink<UInt32, UInt16>(data);
index_type = t;
+ gl_index_type = get_gl_type(t);
update_offset();
dirty = true;
}
BindRestore _bind_ibuf(get_buffer(), ELEMENT_ARRAY_BUFFER);
const void *data_ptr = setup_draw();
- glDrawElements(prim_type, size(), index_type, data_ptr);
+ glDrawElements(prim_type, size(), gl_index_type, data_ptr);
}
void Batch::draw_instanced(unsigned count) const
BindRestore _bind_ibuf(get_buffer(), ELEMENT_ARRAY_BUFFER);
const void *data_ptr = setup_draw();
- glDrawElementsInstanced(prim_type, size(), index_type, data_ptr, count);
+ glDrawElementsInstanced(prim_type, size(), gl_index_type, data_ptr, count);
}
const void *Batch::setup_draw() const