void renderToTexture(const RenderQueue& renderQueue, FrameBufferObject* target) { target->bind(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); for(RenderQueue::const_iterator it = renderQueue.begin(); it != renderQueue.end(); ++it) (*it)(); target->unbind(); }
void D3DRenderContext::Render(D3DMaterial* material, RenderQueue& renderableObjects) { for (RenderQueue::const_iterator i = renderableObjects.begin(); i != renderableObjects.end(); ++i) { uint passesCount = material->BeginPasses("RenderScene"); for (uint passNo = 0; passNo < passesCount; ++passNo) { (*i)->ApplyTransformations(); material->SetMatrices(); material->BeginPass(passNo); (*i)->Render(); (*i)->IdentityTransformation(); material->EndPass(); } material->EndPasses(); } }