Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/assets/threejs/r73/Detector.js
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45/**6* @author alteredq / http://alteredqualia.com/7* @author mr.doob / http://mrdoob.com/8*/910var Detector = {1112canvas: !! window.CanvasRenderingContext2D,13webgl: ( function () {1415try {1617var canvas = document.createElement( 'canvas' ); return !! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) );1819} catch ( e ) {2021return false;2223}2425} )(),26workers: !! window.Worker,27fileapi: window.File && window.FileReader && window.FileList && window.Blob,2829getWebGLErrorMessage: function () {3031var element = document.createElement( 'div' );32element.id = 'webgl-error-message';33element.style.fontFamily = 'monospace';34element.style.fontSize = '13px';35element.style.fontWeight = 'normal';36element.style.textAlign = 'center';37element.style.background = '#fff';38element.style.color = '#000';39element.style.padding = '1.5em';40element.style.width = '400px';41element.style.margin = '5em auto 0';4243if ( ! this.webgl ) {4445element.innerHTML = window.WebGLRenderingContext ? [46'Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br />',47'Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.'48].join( '\n' ) : [49'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br/>',50'Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.'51].join( '\n' );5253}5455return element;5657},5859addGetWebGLMessage: function ( parameters ) {6061var parent, id, element;6263parameters = parameters || {};6465parent = parameters.parent !== undefined ? parameters.parent : document.body;66id = parameters.id !== undefined ? parameters.id : 'oldie';6768element = Detector.getWebGLErrorMessage();69element.id = id;7071parent.appendChild( element );7273}7475};7677// browserify support78if ( typeof module === 'object' ) {7980module.exports = Detector;8182}838485