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

draw_elements: Separate count from the (optional) element list. Allows buffered drawing. #16

Merged
merged 1 commit into from Apr 18, 2013

Conversation

@robn
Copy link
Contributor

robn commented Apr 12, 2013

No description provided.

@pcwalton
Copy link
Contributor

pcwalton commented Apr 12, 2013

Couldn't the caller just use .slice() on the buffer before passing to draw_elements()?

@robn
Copy link
Contributor Author

robn commented Apr 12, 2013

No. There is no buffer - its already been submitted to the GPU at startup. The render mainloop looks something like:

gl2::bind_buffer(gl2::ARRAY_BUFFER, vertex_buffer_id);
gl2::bind_buffer(gl2::ELEMENT_ARRAY_BUFFER, element_buffer_id);
gl2::draw_elements(gl2::TRIANGLE_STRIP, count, gl2::UNSIGNED_SHORT, None);

(Actual example in robn/rust-hello-gl)

metajack added a commit that referenced this pull request Apr 18, 2013
draw_elements: Separate count from the (optional) element list. Allows buffered drawing.
@metajack metajack merged commit f133413 into servo:master Apr 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.