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
+1 -1
View File
@@ -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;}
+1 -1
View File
@@ -24,7 +24,7 @@
<li class="link-home"><a href="http://phaser.io">Phaser Home</a></li>
<li class="link-latest"><a href="https://github.com/photonstorm/phaser">Download Latest</a></li>
<li class="link-forum"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Support Forum</a></li>
<li class="link-docs"><a href="../docs/out/">Documentation</a></li>
<li class="link-docs"><a href="../docs/">Documentation</a></li>
<li class="link-twitter"><a href="https://twitter.com/photonstorm">Twitter</a></li>
</ul>
</div>
+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) {