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

OpenGL ES 3.0 / core desktop GL way of retrieving extension information #3472

Closed
mosra opened this issue May 24, 2015 · 8 comments
Closed

OpenGL ES 3.0 / core desktop GL way of retrieving extension information #3472

mosra opened this issue May 24, 2015 · 8 comments
Assignees
Labels

Comments

@mosra
Copy link
Contributor

mosra commented May 24, 2015

In OpenGL ES 3.0 (and GL 3.0+) it is possible to retrieve extension list like this:

GLint count;
glGetIntegerv(GL_NUM_EXTENSIONS, &count);
for(int i = 0; i != count; ++i)
    extensions.add(glGetStringi(GL_EXTENSIONS, i));

Looking at the current code in library_gl.js it looks like WebGL is indeed providing the extension list as an array, but the code then joins it to one large string to support ES2/GL2.1 usage via glGetString(GL_EXTENSIONS). Would it be possible to support also the above usage for better compatibility with ES 3.0 code that's being ported to WebGL 2?

One reason glGetStringi() is used instead of the original glGetString(GL_EXTENSIONS) is that the original way is no longer available in core desktop OpenGL and thus using it harms portability.

Thank you!

@juj juj added the GL label May 25, 2015
@juj
Copy link
Collaborator

juj commented May 25, 2015

Your comments are accurate, this is a feature we haven't implemented yet. For GLES3/WebGL2 support we will have to implement that form of extension querying. However this will not be available when targeting GLES2/WebGL1, although that is probably not a concern for you?

@mosra
Copy link
Contributor Author

mosra commented May 25, 2015

I still need to use glGetString(GL_EXTENSIONS) in GLES2/WebGL1 path to stay compatible with native GLES2 implementations, so yes, that's not a concern for me.

@gouletr
Copy link

gouletr commented Aug 28, 2015

Bump, I'm running into the same issue. Would prefer to have glGetStringi available if this is possible. Thanks!

@juj
Copy link
Collaborator

juj commented Aug 28, 2015

@gouletr: Are you building a WebGL2/GLES3 targeting application? Native GLES2/WebGL1 does not have the function glGetStringi.

@gouletr
Copy link

gouletr commented Aug 28, 2015

Yes, we are targeting WebGL2/GLES3.

@gouletr
Copy link

gouletr commented Sep 3, 2015

@juj Thanks for the fix! I will use it right away! 👍

@mosra
Copy link
Contributor Author

mosra commented Sep 3, 2015

@juj Awesome! Thank you! 👍

@juj
Copy link
Collaborator

juj commented Sep 21, 2015

This was merged in the above PR.

@juj juj closed this as completed Sep 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants