1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 21:32:42 +00:00

Report OSG rendering stats

This commit is contained in:
elsid 2020-07-11 16:16:44 +02:00
parent 9124a18bb6
commit db0ad8421f
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

View File

@ -908,7 +908,14 @@ void OMW::Engine::go()
if (stats)
{
const auto frameNumber = mViewer->getFrameStamp()->getFrameNumber();
mViewer->getViewerStats()->report(stats, frameNumber);
if (frameNumber >= 2)
{
mViewer->getViewerStats()->report(stats, frameNumber - 2);
osgViewer::Viewer::Cameras cameras;
mViewer->getCameras(cameras);
for (auto camera : cameras)
camera->getStats()->report(stats, frameNumber - 2);
}
}
mEnvironment.limitFrameRate(frameTimer.time_s());