MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / Draw

Method Draw

src/Nazara/Graphics/DeferredRenderTechnique.cpp:245–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243 */
244
245 bool DeferredRenderTechnique::Draw(const SceneData& sceneData) const
246 {
247 NazaraAssert(sceneData.viewer, "Invalid viewer");
248 Recti viewerViewport = sceneData.viewer->GetViewport();
249
250 Vector2ui viewportDimensions(viewerViewport.width, viewerViewport.height);
251 if (viewportDimensions != m_GBufferSize)
252 {
253 if (!Resize(viewportDimensions))
254 {
255 NazaraError("Failed to update RTT");
256 return false;
257 }
258 }
259
260 unsigned int sceneTexture = 0;
261 unsigned int workTexture = 1;
262 for (auto& passIt : m_passes)
263 {
264 for (auto& passIt2 : passIt.second)
265 {
266 const DeferredRenderPass* pass = passIt2.second.get();
267 if (pass->IsEnabled())
268 {
269 if (pass->Process(sceneData, workTexture, sceneTexture))
270 std::swap(workTexture, sceneTexture);
271 }
272 }
273 }
274
275 return true;
276 }
277
278 /*!
279 * \brief Enables a pass

Callers

nothing calls this directly

Calls 4

swapFunction · 0.85
GetViewportMethod · 0.80
IsEnabledMethod · 0.45
ProcessMethod · 0.45

Tested by

no test coverage detected