MCPcopy Create free account
hub / github.com/LukasBanana/LLGL / OnDrawFrame

Method OnDrawFrame

examples/Cpp/Queries/Example.cpp:291–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289 }
290
291 void OnDrawFrame() override
292 {
293 UpdateScene();
294
295 commands->Begin();
296 {
297 // Measure GPU performance
298 commands->BeginQuery(*timerQuery);
299 {
300 // Set buffers
301 commands->SetVertexBuffer(*vertexBuffer);
302
303 // Start with geometry query
304 commands->BeginQuery(*geometryQuery);
305 {
306 commands->SetViewport(swapChain->GetResolution());
307
308 commands->BeginRenderPass(*swapChain);
309 {
310 RenderBoundingBoxes();
311 RenderScene();
312 }
313 commands->EndRenderPass();
314 }
315 commands->EndQuery(*geometryQuery);
316 }
317 commands->EndQuery(*timerQuery);
318 }
319 commands->End();
320 commandQueue->Submit(*commands);
321
322 // Print query results every couple of milliseconds
323 auto currentTime = Clock::now();
324 if (std::chrono::duration_cast<Ticks>(currentTime - prevPrintTime).count() >= printRefreshRate)
325 {
326 prevPrintTime = currentTime;
327 PrintQueryResults();
328 }
329 }
330
331};
332

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected