| 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 |
nothing calls this directly
no test coverage detected