Fixing bug when no WebGL is available
The switch to Phaser 3.50 introduced a bug when WebGL is not available in a browser. The changes in this commit prevent calls to the WebGL pipeline if the pipeline is not available.
This commit is contained in:
+4
-3
@@ -73,9 +73,10 @@ const config: GameConfig = {
|
||||
},
|
||||
callbacks: {
|
||||
postBoot: game => {
|
||||
// FIXME: we should fore WebGL in the config.
|
||||
const renderer = game.renderer as WebGLRenderer;
|
||||
renderer.pipelines.add(OutlinePipeline.KEY, new OutlinePipeline(game));
|
||||
const renderer = game.renderer;
|
||||
if (renderer instanceof WebGLRenderer) {
|
||||
renderer.pipelines.add(OutlinePipeline.KEY, new OutlinePipeline(game));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user