MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / OnDrawFrame

Method OnDrawFrame

deps/LLGL/examples/Cpp/Queries/Example.cpp:282–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280 }
281
282 void OnDrawFrame() override
283 {
284 UpdateScene();
285
286 commands->Begin();
287 {
288 // Measure GPU performance
289 commands->BeginQuery(*timerQuery);
290 {
291 // Set buffers
292 commands->SetVertexBuffer(*vertexBuffer);
293
294 // Start with qeometry query
295 commands->BeginQuery(*geometryQuery);
296 {
297 commands->SetViewport(LLGL::Viewport{ { 0, 0 }, context->GetResolution() });
298
299 commands->BeginRenderPass(*context);
300 {
301 RenderBoundingBoxes();
302 RenderScene();
303 }
304 commands->EndRenderPass();
305 }
306 commands->EndQuery(*geometryQuery);
307 }
308 commands->EndQuery(*timerQuery);
309 }
310 commands->End();
311 commandQueue->Submit(*commands);
312
313 // Print query results every couple of milliseconds
314 auto currentTime = Clock::now();
315 if (std::chrono::duration_cast<Ticks>(currentTime - prevPrintTime).count() >= printRefreshRate)
316 {
317 prevPrintTime = currentTime;
318 PrintQueryResults();
319 }
320
321 // Present result on the screen
322 context->Present();
323 }
324
325};
326

Callers

nothing calls this directly

Calls 13

UpdateSceneFunction · 0.85
BeginMethod · 0.45
BeginQueryMethod · 0.45
SetVertexBufferMethod · 0.45
SetViewportMethod · 0.45
GetResolutionMethod · 0.45
BeginRenderPassMethod · 0.45
EndRenderPassMethod · 0.45
EndQueryMethod · 0.45
EndMethod · 0.45
SubmitMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected