History

Type registeration fixes for scripting engine

ksuprynowicz committed 4 years ago

Commit 0a3ec921 parent 50a6a6334 files · +266 −67Browse files

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

Unified · Split

interface/src/RefreshRateManager.cpp+9−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 //
55 // Created by Dante Ruiz on 2019-04-15.
66 // Copyright 2019 High Fidelity, Inc.
7+// Copyright 2022 Overte e.V.
78 //
89 // Distributed under the Apache License, Version 2.0.
910 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -13,7 +14,15 @@ · 3 unmodified lines
1314 #include "RefreshRateManager.h"
1415
1516 #include <array>
17+#include <ScriptEngineCast.h>
18+#include <ScriptManager.h>
1619
20+STATIC_SCRIPT_TYPES_INITIALIZER(+[](ScriptManager* manager){
21+ auto scriptEngine = manager->engine().get();
22+
23+ scriptRegisterMetaType(scriptEngine, scriptValueFromEnumClass<RefreshRateManager::RefreshRateRegime>, scriptValueToEnumClass<RefreshRateManager::RefreshRateRegime>, "RefreshRateRegime");
24+ scriptRegisterMetaType(scriptEngine, scriptValueFromEnumClass<RefreshRateManager::UXMode>, scriptValueToEnumClass<RefreshRateManager::UXMode>, "UXMode");
25+});
1726
1827 static const int VR_TARGET_RATE = 90;
1928