@enable3d/common
Advanced tools
Comparing version 0.25.0 to 0.25.1
@@ -8,4 +8,13 @@ /** | ||
// copied from https://github.com/mrdoob/three.js/blob/dev/src/renderers/WebGLRenderer.js | ||
import { WEBGL } from 'three/examples/jsm/WebGL'; | ||
import { logger } from './logger'; | ||
/** Test if WebGL2 is available. */ | ||
const isWebGL2Available = () => { | ||
try { | ||
const canvas = document.createElement('canvas'); | ||
return !!(window.WebGL2RenderingContext && canvas.getContext('webgl2')); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
}; | ||
/** | ||
@@ -50,3 +59,3 @@ * The WebGL context created by Phaser does not meed the requirements of three.js. | ||
const contextCreationConfig = Object.assign({}, contextAttributes); | ||
const webgl = WEBGL.isWebGL2Available() ? 'webgl2' : 'webgl'; | ||
const webgl = isWebGL2Available() ? 'webgl2' : 'webgl'; | ||
// create context | ||
@@ -53,0 +62,0 @@ const myCustomContext = myCustomCanvas.getContext(webgl, contextCreationConfig); |
{ | ||
"name": "@enable3d/common", | ||
"version": "0.25.0", | ||
"version": "0.25.1", | ||
"description": "", | ||
@@ -15,3 +15,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@enable3d/three-wrapper": "^0.25.0", | ||
"@enable3d/three-wrapper": "^0.25.1", | ||
"@yandeu/events": "0.0.5" | ||
@@ -18,0 +18,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
250773
3353