Esempio n. 1
0
//---------------------------------------------------------------------------//
RenderContext* RenderContext::AllocateContext()
{
  if (!locAvailableRenderContexts.empty())
  {
    RenderContext* context = locAvailableRenderContexts.front();
    context->Reset();
    locAvailableRenderContexts.pop_front();
    return context;
  }

  locRenderContextPool.push_back(std::make_unique<RenderContext>());
  return locRenderContextPool.back().get();
}