| 142 | } |
| 143 | |
| 144 | void RenderWindow::updateTitle() |
| 145 | { |
| 146 | Qt3DRaytrace::QRenderStatistics statistics; |
| 147 | if(raytraceAspect()->queryRenderStatistics(statistics)) { |
| 148 | double frameTime = std::max(statistics.cpuFrameTime, statistics.gpuFrameTime); |
| 149 | if(qFuzzyIsNull(frameTime)) { |
| 150 | return; |
| 151 | } |
| 152 | |
| 153 | QString statisticsString = QString("CPU: %1 ms | GPU: %2 ms | FPS: %3 | Current image: %5 s / %6 spp") |
| 154 | .arg(statistics.cpuFrameTime, 0, 'f', 2) |
| 155 | .arg(statistics.gpuFrameTime, 0, 'f', 2) |
| 156 | .arg(1000.0 / frameTime, 0, 'f', 0) |
| 157 | .arg(statistics.totalRenderTime, 0, 'f', 2) |
| 158 | .arg(statistics.numFramesRendered); |
| 159 | |
| 160 | setTitle(QString("%1 - %2 [ %3 ]") |
| 161 | .arg(m_sceneName) |
| 162 | .arg(QApplication::applicationName()) |
| 163 | .arg(statisticsString)); |
| 164 | } |
| 165 | else { |
| 166 | setTitle(QString("%1 - %2") |
| 167 | .arg(m_sceneName) |
| 168 | .arg(QApplication::applicationName())); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | void RenderWindow::imageReady(Qt3DRaytrace::QRenderImage type, Qt3DRaytrace::QImageDataPtr image) |
| 173 | { |
nothing calls this directly
no test coverage detected