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

doc: include attribute position for vertex attrib pointer #3050

Merged
merged 2 commits into from
Aug 30, 2022

Conversation

CallumFerguson
Copy link
Contributor

In the guide's WebGL example, vertex_attrib_pointer_with_i32 is used which takes an attribute location (indx). The attributes location position_attribute_location should be used instead of a hard coded 0.

You can see #2609 updated

context.enable_vertex_attrib_array(0);

to be

context.enable_vertex_attrib_array(position_attribute_location as u32);

but failed to also update

context.vertex_attrib_pointer_with_i32(0, 3, WebGl2RenderingContext::FLOAT, false, 0, 0);

to be

context.vertex_attrib_pointer_with_i32(position_attribute_location as u32, 3, WebGl2RenderingContext::FLOAT, false, 0, 0);

Copy link
Collaborator

@Liamolucko Liamolucko left a comment

Choose a reason for hiding this comment

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

Thanks!

@Liamolucko Liamolucko merged commit 1b9dc07 into rustwasm:main Aug 30, 2022
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.

2 participants