Catch create WebGLRenderer error
This commit is contained in:
parent
58a6b2a418
commit
39fde2cefc
|
@ -13,7 +13,13 @@ export const scene = ({ ref }) => {
|
||||||
|
|
||||||
var scene = new THREE.Scene();
|
var scene = new THREE.Scene();
|
||||||
|
|
||||||
const renderer = new THREE.WebGLRenderer({ antialias: true });
|
let renderer = null;
|
||||||
|
try {
|
||||||
|
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||||
|
} catch (error) {
|
||||||
|
console.log('Problem creating WebGLRenderer:', error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const width = ref.current.clientWidth;
|
const width = ref.current.clientWidth;
|
||||||
const height = ref.current.clientHeight;
|
const height = ref.current.clientHeight;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user