initialize method

Future initialize(
  1. int width,
  2. int height, {
  3. String? uberArchivePath,
})

Implementation

Future initialize(int width, int height, {String? uberArchivePath}) async {
  final context = _module.ccall("thermion_dart_web_create_gl_context", "int",
      <JSString>[].toJS, <JSAny>[].toJS, null);
  final loader = _module.ccall(
      "thermion_dart_web_get_resource_loader_wrapper",
      "void*",
      <JSString>[].toJS,
      <JSAny>[].toJS,
      null);
  _viewer = _module.ccall(
      "create_filament_viewer",
      "void*",
      ["void*".toJS, "void*".toJS, "void*".toJS, "string".toJS].toJS,
      [context, loader, null, uberArchivePath?.toJS].toJS,
      null) as JSNumber;
  await createSwapChain(width, height);
  _updateViewportAndCameraProjection(width, height, 1.0);
  _sceneManager = _module.ccall("get_scene_manager", "void*",
      ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber;
  _initialized = true;
}