mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-09 04:56:01 +10:00
build/Three.js - Includes all renderers + extras build/custom/ThreeCanvas.js - Canvas renderer only build/custom/ThreeDOM.js - DOM renderer only build/custom/ThreeSVG.js - SVG renderer only build/custom/ThreeWebGL.js - WebGL renderer only build/custom/ThreeExtras.js - Extras only Moved `THREE.Detector.js` to `examples/js/Detector.js`. Updated examples to reflect these changes.
63 lines
1.3 KiB
JavaScript
63 lines
1.3 KiB
JavaScript
/**
|
|
* @author alteredq / http://alteredqualia.com/
|
|
*/
|
|
|
|
Detector = {
|
|
|
|
// supported features
|
|
|
|
canvas : !!window.CanvasRenderingContext2D,
|
|
webgl : !!window.WebGLRenderingContext,
|
|
workers : !!window.Worker,
|
|
|
|
// helper methods
|
|
|
|
addGetWebGLMessage: function( parameters ) {
|
|
|
|
var parent = document.body,
|
|
id = "oldie" ;
|
|
|
|
if ( parameters ) {
|
|
|
|
if ( parameters.parent !== undefined ) parent = parameters.parent;
|
|
if ( parameters.id !== undefined ) id = parameters.id;
|
|
|
|
}
|
|
|
|
var html = [
|
|
|
|
'Sorry, your browser doesn\'t support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a><br/>',
|
|
'<br/>',
|
|
'Please try with',
|
|
'<a href="http://www.google.com/chrome">Chrome 9+</a> /',
|
|
'<a href="http://www.mozilla.com/en-US/firefox/all-beta.html">Firefox 4+</a> /',
|
|
'<a href="http://nightly.webkit.org/">Safari OSX 10.6+</a>'
|
|
|
|
].join("\n");
|
|
|
|
var wrap = document.createElement( "center" ),
|
|
message = document.createElement( "div" );
|
|
|
|
message.innerHTML = html;
|
|
message.id = id;
|
|
|
|
var style = message.style;
|
|
|
|
style.fontFamily = "monospace";
|
|
style.fontSize = "13px";
|
|
style.textAlign = "center";
|
|
style.background = "#eee";
|
|
style.color = "#000";
|
|
style.padding = "1em";
|
|
style.width = "475px";
|
|
style.margin = "5em auto 0";
|
|
|
|
wrap.appendChild( message )
|
|
parent.appendChild( wrap );
|
|
|
|
return message;
|
|
|
|
}
|
|
|
|
};
|