-
Notifications
You must be signed in to change notification settings - Fork 26
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
Attrib.Value is int for webgl and uint for opengl? #26
Comments
Hi, thanks for reporting this.
Can you please elaborate on how you're trying to manipulate them? That would help me better understand if there's a problem with some use-case I'm not aware of, or perhaps what you're doing can be done differently. Thanks! |
For example, my current application does the following:
To ensure that I can switch between multiple shaders without changing the vertex attribute pointers of my meshes. This becomes especially important once we have support for Vertex Array Objects in WebGL 2.0, since then one bakes the vertex attribute pointers once at mesh creation, and never change them again. |
Thanks, that's helpful. It sounds like you still need the ability to create ad-hoc The code you posted should work in a cross-platform compatible way. Can you show me some problem code where the different underlying types are causing problems? That way, I can see if a potential change would resolve your problem. I'm guessing you're trying to extract/save/load the After looking a bit more into the specs for OpenGL and WebGL, it looks like |
I've moved to passing around the gl.Attrib values directly, which works, but I'd love to be able to pass around the indices by themselves, to avoid exposing gl.* types in my own API. As for the int/uint difference, I'll try and get some code up over the weekend to illustrate my usage a little more clearly. Thanks! |
I see.
Yep, that was the conclusion I came to as well. 👍 Hence it should be possible to use
All right. But no need to spend a lot of time on it, if you could just copy/paste the relevant lines, that'd be good enough. It doesn't need to be a fully standalone program, just a relevant snippet would do. Thanks. |
In attempting to cross-compile a program for both WebGL and Desktop OpenGL, I've noticed that the Attrib type is
uint
for the former, andint
for the latter. This makes it a little hard to manipulate these in a portable way.Is there a technical reason why these are different, or could they be brought into alignment?
The text was updated successfully, but these errors were encountered: