Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When gl.VERSION without WebGL , check OpenGL ES. #13211

Merged
merged 2 commits into from
Jan 31, 2018

Conversation

finscn
Copy link
Contributor

@finscn finscn commented Jan 31, 2018

more details at : #13210

@finscn finscn changed the title Add null-checking for gl.VERSION When gl.VERSION without WebGL , check OpenGL ES. Jan 31, 2018
}else if ( glVersion.indexOf("OpenGL ES") !== -1 ) {
version = parseFloat( /^OpenGL\ ES\ ([0-9])/.exec( glVersion )[ 1 ] );
lineWidthAvailable = version >= 2.0;
}
Copy link
Collaborator

@Mugen87 Mugen87 Jan 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some code style feedback 😊

var version = 0;
var lineWidthAvailable = false;

var glVersion = gl.getParameter( gl.VERSION );

if ( glVersion.indexOf( 'WebGL' ) !== - 1 ) {

   version = parseFloat( /^WebGL\ ([0-9])/.exec( glVersion )[ 1 ] );
   lineWidthAvailable = ( version >= 1.0 );

} else if ( glVersion.indexOf( 'OpenGL ES' ) !== - 1 ) {

   version = parseFloat( /^OpenGL\ ES\ ([0-9])/.exec( glVersion )[ 1 ] );
   lineWidthAvailable = ( version >= 2.0 );

}

@finscn finscn force-pushed the version-checking-null branch from 6b4e80f to 28f7fdf Compare January 31, 2018 21:25
@mrdoob mrdoob added this to the r90 milestone Jan 31, 2018
@mrdoob mrdoob merged commit 0793e3d into mrdoob:dev Jan 31, 2018
@mrdoob
Copy link
Owner

mrdoob commented Jan 31, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants