History

Update scriptengine update rate to match displayPlugin target framerate

Ryan Huffman committed 9 years ago

Commit 97719cd1 parent a2c5c0f3 files · +18 −6Browse files

Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Application.cpp+9−0
@@ -5419,6 +5419,15 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 5418 unmodified lines
54195419 return !entityServerNode || isPhysicsEnabled();
54205420 });
54215421
5422+ scriptEngine->setGetTargetUpdateRateFunction([this]() {
5423+ auto displayPlugin = _displayPlugin;
5424+ if (displayPlugin) {
5425+ auto targetUpdateRate = displayPlugin->getTargetFrameRate();
5426+ return targetUpdateRate;
5427+ }
5428+ return 60.0f;
5429+ });
5430+
54225431 // setup the packet senders and jurisdiction listeners of the script engine's scripting interfaces so
54235432 // we can use the same ones from the application.
54245433 auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();