Browse Source

WebGLRenderer: Check if context gets created with default attributes. Closes #5467.

Mr.doob 10 years ago
parent
commit
bde5f99b71
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/renderers/WebGLRenderer.js

+ 9 - 1
src/renderers/WebGLRenderer.js

@@ -199,7 +199,15 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		if ( _gl === null ) {
 
-			throw 'Error creating WebGL context.';
+			if ( _canvas.getContext( 'webgl') !== null ) {
+
+				throw 'Error creating WebGL context with your selected attributes.';
+
+			} else {
+
+				throw 'Error creating WebGL context.';
+
+			}
 
 		}