Struct three_d::core::buffer::ElementBuffer [−][src]
pub struct ElementBuffer { /* fields omitted */ }
Expand description
A buffer containing 3 indices for each triangle to be rendered, which is why it is also known as an index buffer. The three indices refer to three places in a set of VertexBuffer where the data (position, normal etc.) is found for the three vertices of the triangle. See for example Program::draw_elements to use this for drawing.
Implementations
Creates a new empty element buffer.
pub fn new_with<T: ElementBufferDataType>(
context: &Context,
data: &[T]
) -> ThreeDResult<ElementBuffer>
pub fn new_with<T: ElementBufferDataType>(
context: &Context,
data: &[T]
) -> ThreeDResult<ElementBuffer>
Creates a new element buffer and fills it with the given indices which must be divisable by 3.
Fills the buffer with the given indices which must be divisable by 3.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ElementBuffer
impl !Send for ElementBuffer
impl !Sync for ElementBuffer
impl Unpin for ElementBuffer
impl !UnwindSafe for ElementBuffer
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more