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

Surport for OpenGL ES rendering. #13046

Closed
wants to merge 1 commit into from
Closed

Surport for OpenGL ES rendering. #13046

wants to merge 1 commit into from

Conversation

raindust
Copy link

@raindust raindust commented Jan 5, 2018

I fixed an bug when i migrated to my android phone, because my gl version string is "OpenGL ES 3.2 v1.r12p1-04bet0.76b1d268c59a490265a02c702c8aa55c"

@takahirox
Copy link
Collaborator

Thanks for the contribution.

You don't need to include build/* in PR and please follow the code style https://github.com/mrdoob/three.js/wiki/Mr.doob's-Code-Style%E2%84%A2

@mrdoob
Copy link
Owner

mrdoob commented Jan 5, 2018

Yes please, do not include the builds files in the PR.

@mrdoob
Copy link
Owner

mrdoob commented Jan 5, 2018

Also, in which environment are you getting OpenGL ES while using three.js?

@kzyman
Copy link

kzyman commented Jan 14, 2018

@mrdoob maybe WeChat small program

@mrdoob mrdoob added this to the r91 milestone Jan 18, 2018
var versionString = gl.getParameter(gl.VERSION);
var lineWidthAvailable = false;
var version = 0.0;
if(versionString.indexOf("WebGL") != -1)
Copy link
Contributor

Choose a reason for hiding this comment

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

use !== is better

version = parseFloat( /^WebGL\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] );
lineWidthAvailable = parseFloat( version ) >= 1.0;
}
else if(versionString.indexOf("OpenGL ES") != -1)
Copy link
Contributor

Choose a reason for hiding this comment

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

use !== is better

else if(versionString.indexOf("OpenGL ES") != -1)
{
version = parseFloat( /^OpenGL ES\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] );
lineWidthAvailable = parseFloat( version ) >= 2.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need parseFloat again

if(versionString.indexOf("WebGL") != -1)
{
version = parseFloat( /^WebGL\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] );
lineWidthAvailable = parseFloat( version ) >= 1.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need parseFloat again

var version = 0.0;
if(versionString.indexOf("WebGL") != -1)
{
version = parseFloat( /^WebGL\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] );
Copy link
Contributor

Choose a reason for hiding this comment

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

use versionString instead of call gl.getParameter( gl.VERSION ) again

}
else if(versionString.indexOf("OpenGL ES") != -1)
{
version = parseFloat( /^OpenGL ES\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] );
Copy link
Contributor

Choose a reason for hiding this comment

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

use versionString instead of call gl.getParameter( gl.VERSION ) again

@mrdoob mrdoob closed this Jan 31, 2018
@mrdoob
Copy link
Owner

mrdoob commented Jan 31, 2018

#13211 was merged instead.

@mrdoob mrdoob removed this from the r91 milestone Feb 14, 2018
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.

5 participants