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

x/mobile/gl: Mismatch in Uniform and Attrib Value types #9438

Open
mokiat opened this issue Dec 24, 2014 · 2 comments
Open

x/mobile/gl: Mismatch in Uniform and Attrib Value types #9438

mokiat opened this issue Dec 24, 2014 · 2 comments
Assignees
Labels
mobile Android, iOS, and x/mobile
Milestone

Comments

@mokiat
Copy link

mokiat commented Dec 24, 2014

Hi,

I noticed that the Value field of the Attrib and Uniform types is of different type - uint and int32 respectively.
http://godoc.org/golang.org/x/mobile/gl#Attrib
http://godoc.org/golang.org/x/mobile/gl#Uniform

According to the documentation, they both should be uint.
https://www.khronos.org/opengles/sdk/docs/man3/html/glGetAttribLocation.xhtml
https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformLocation.xhtml

So I see no sense in them being of different type.

Furthermore, shouldn't the type of Attrib be a bit more strictly specified - for example uint32 - similar to other ID types in the mobile/gl API?

Regards,
Momchil Atanasov

@crawshaw crawshaw self-assigned this Dec 24, 2014
@crawshaw
Copy link
Member

I'm not sure why this ended up this way, I'll take a look.

@mikioh mikioh changed the title mobile/gl Mismatch in Uniform and Attrib Value types gl: Mismatch in Uniform and Attrib Value types Jan 4, 2015
@bryanturley
Copy link

Using opengl in Go I have found many places where opengl writes either uint32 or int32 into []int32.
It is slightly annoying but I don't know if we can really do anything about it.

So far for me this has been the worst one
https://www.opengl.org/sdk/docs/man/html/glGetActiveUniformsiv.xhtml
The *params parameter returns an array that can be GLint, GLuint or GLenum and since C doesn't care and the type size doesn't change it is acceptable to that world.

Things like this are why I kept the types as basic as possible (uint32 vs Enum for instance).
I am in favor of the named types, they will just require some extra casting every now and then.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title gl: Mismatch in Uniform and Attrib Value types x/mobile/gl: Mismatch in Uniform and Attrib Value types Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-mobile label Apr 14, 2015
@changkun changkun added the mobile Android, iOS, and x/mobile label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile
Projects
None yet
Development

No branches or pull requests

6 participants