// luma.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors import { isBrowser } from '@probe.gl/env'; import { log } from "./utils/log.js"; import { lumaStats } from "./utils/stats-manager.js"; /** * By adding the result of init() to Device.VERSION we guarantee it will be called * @returns version */ function initializeLuma() { // Version detection using babel plugin // @ts-expect-error const VERSION = typeof "9.0.27" !== 'undefined' ? "9.0.27" : 'running from source'; const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering'; // Assign luma.log.level in console to control logging: \ // 0: none, 1: minimal, 2: verbose, 3: attribute/uniforms, 4: gl logs // luma.log.break[], set to gl funcs, luma.log.profile[] set to model names`; if (globalThis.luma && globalThis.luma.VERSION !== VERSION) { throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${VERSION}`); } if (!globalThis.luma) { if (isBrowser()) { log.log(1, `${VERSION} - ${STARTUP_MESSAGE}`)(); } globalThis.luma = globalThis.luma || { VERSION, version: VERSION, log, // A global stats object that various components can add information to // E.g. see webgl/resource.js stats: lumaStats }; } return VERSION; } export const VERSION = initializeLuma();