| 232 | } |
| 233 | |
| 234 | void Batcher::Flush(ref_ptr<GraphicsContext> context) |
| 235 | { |
| 236 | ASSERT(m_flushInterface != NULL, ()); |
| 237 | std::for_each(m_buckets.begin(), m_buckets.end(), [this, context](TBuckets::value_type & bucket) |
| 238 | { |
| 239 | ASSERT(bucket.second != nullptr, ()); |
| 240 | bucket.second->GetBuffer()->Preflush(context); |
| 241 | m_flushInterface(bucket.first, std::move(bucket.second)); |
| 242 | }); |
| 243 | |
| 244 | m_buckets.clear(); |
| 245 | } |
| 246 | |
| 247 | template <typename TBatcher, typename... TArgs> |
| 248 | IndicesRange Batcher::InsertPrimitives(ref_ptr<GraphicsContext> context, RenderState const & state, |