| 160 | } |
| 161 | |
| 162 | void SetEngine(Napi::Object& jsEngine) |
| 163 | { |
| 164 | // This implementation must be switched to simply unwrapping the JavaScript object as soon as NativeEngine |
| 165 | // is transitioned away from a singleton pattern. Part of that change will remove the GetEngine method, as |
| 166 | // documented in https://github.com/BabylonJS/BabylonNative/issues/62 |
| 167 | auto nativeEngine = jsEngine.Get("_native").As<Napi::Object>(); |
| 168 | auto getEngine = nativeEngine.Get("getEngine").As<Napi::Function>(); |
| 169 | m_engineImpl = getEngine.Call(nativeEngine, {}).As<Napi::External<NativeEngine>>().Data(); |
| 170 | } |
| 171 | |
| 172 | void DoFrame(std::function<void(const xr::System::Session::Frame&)> callback) |
| 173 | { |
no test coverage detected