Fixed WebGL detection and code colour on Firefox.

This commit is contained in:
photonstorm
2013-10-23 15:13:21 +01:00
parent ffd5ddc534
commit 94c7c57e1c
3 changed files with 12 additions and 2 deletions
+10
View File
@@ -324,6 +324,16 @@ Phaser.Device.prototype = {
this.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob'];
this.fileSystem = !!window['requestFileSystem'];
this.webGL = ( function () { try { var canvas = document.createElement( 'canvas' ); return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); } catch( e ) { return false; } } )();
if (this.webGL === null)
{
this.webGL = false;
}
else
{
this.webGL = true;
}
this.worker = !!window['Worker'];
if ('ontouchstart' in document.documentElement || window.navigator.msPointerEnabled) {