import { syncCamera } from "./main11.mjs";
import { useFunction } from "./main10.mjs";
function useRender({
  map,
  origin,
  useThree,
  frameloop,
  r3m
}) {
  const render = useFunction((_gl, projViewMx) => {
    const pVMx = "defaultProjectionData" in projViewMx ? Object.values(projViewMx.defaultProjectionData.mainMatrix) : projViewMx;
    r3m.viewProjMx.splice(0, 16, ...pVMx);
    const state = useThree.getState();
    const camera = state.camera;
    const { gl, advance } = state;
    syncCamera(camera, origin, projViewMx);
    gl.resetState();
    advance(Date.now() * 1e-3, true);
    if (!frameloop || frameloop === "always")
      map.triggerRepaint();
  });
  return render;
}
export {
  useRender
};
//# sourceMappingURL=main16.mjs.map
