Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

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 robn commented Apr 12, 2013

No description provided.

@pcwalton
Copy link
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants