From 94c7c57e1c2ff10d6d777c81c76babe08667a011 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Wed, 23 Oct 2013 15:13:21 +0100 Subject: [PATCH] Fixed WebGL detection and code colour on Firefox. --- examples/_site/css/phaser-examples.css | 2 +- examples/index.html | 2 +- src/system/Device.js | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/_site/css/phaser-examples.css b/examples/_site/css/phaser-examples.css index abd5b211..c3ffec32 100644 --- a/examples/_site/css/phaser-examples.css +++ b/examples/_site/css/phaser-examples.css @@ -166,7 +166,7 @@ ul.right-controls > li{margin:0;padding:0; display: inline-block; vertical-align .reset-button{width: 121px; height:52px; display:inline-block; background: url('../../_site/images/reset-button.png') no-repeat;} .pause-button:hover, .mute-button:hover, .reset-button:hover{cursor: pointer;} .filler{height: 720px;} -.code-block{font-family: Courier; font-size: 12px; width:750px; height:auto; overflow: scroll; margin:0 auto; border-radius: 10px; background:#fdfdfd; border:0 !important; box-shadow: inset 0 5px 15px rgba(0,0,0,0.15), 0 0 10px rgba(106,200,248,0.5); padding: 25px !important;display: block; margin-bottom: 20px; margin-top: 30px;} +.code-block{font-family: Courier; font-size: 12px; color: #fff; width:750px; height:auto; overflow: scroll; margin:0 auto; border-radius: 10px; background:#fdfdfd; border:0 !important; box-shadow: inset 0 5px 15px rgba(0,0,0,0.15), 0 0 10px rgba(106,200,248,0.5); padding: 25px !important;display: block; margin-bottom: 20px; margin-top: 30px;} .px800{width:800px; clear:both; display: block; margin:0 auto; line-height: 1.5em;} .gradient p{color:#333;} diff --git a/examples/index.html b/examples/index.html index 0bea009e..9ecc2085 100644 --- a/examples/index.html +++ b/examples/index.html @@ -24,7 +24,7 @@ - + diff --git a/src/system/Device.js b/src/system/Device.js index 5aa7cec3..bcb97952 100644 --- a/src/system/Device.js +++ b/src/system/Device.js @@ -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) {