Browse Source

Merge branch 'dev' of https://github.com/mrdoob/three.js into dev

Mr.doob 8 years ago
parent
commit
b7fdd9a759
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/renderers/webgl/WebGLState.js

+ 5 - 1
src/renderers/webgl/WebGLState.js

@@ -342,6 +342,10 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
 
 
 	var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );
 	var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );
 
 
+	var glVersion = gl.getParameter(gl.VERSION).split(' ')[1];
+	var glMajorVersion = glVersion.split('.').slice(0, 2).join('.');
+	var lineWidthAvailable = parseFloat(glMajorVersion) >= 1.0;
+
 	var currentTextureSlot = null;
 	var currentTextureSlot = null;
 	var currentBoundTextures = {};
 	var currentBoundTextures = {};
 
 
@@ -732,7 +736,7 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
 
 
 		if ( width !== currentLineWidth ) {
 		if ( width !== currentLineWidth ) {
 
 
-			gl.lineWidth( width );
+			if ( lineWidthAvailable ) gl.lineWidth( width );
 
 
 			currentLineWidth = width;
 			currentLineWidth = width;