import { NanoPowGpu } from "./gpu.js"
let isGlSupported, isGpuSupported = false
-try {
- await NanoPowGl.init()
- isGlSupported = true
-} catch (err) {
- console.warn(`WebGL is not supported in this environment.`)
- isGlSupported = false
-}
try {
await NanoPowGpu.init()
isGpuSupported = true
console.warn(`WebGPU is not supported in this environment.`)
isGpuSupported = false
}
+try {
+ await NanoPowGl.init()
+ isGlSupported = true
+} catch (err) {
+ console.warn(`WebGL is not supported in this environment.`)
+ isGlSupported = false
+}
const NanoPow = isGpuSupported ? NanoPowGpu : isGlSupported ? NanoPowGl : null
export { NanoPow, NanoPowGl, NanoPowGpu }