pub struct ElementBuffer { /* private fields */ }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
sourceimpl ElementBuffer
impl ElementBuffer
sourcepub fn new<T: ElementBufferDataType>(
context: &Context
) -> ThreeDResult<ElementBuffer>
pub fn new<T: ElementBufferDataType>(
context: &Context
) -> ThreeDResult<ElementBuffer>
Creates a new empty element buffer.
sourcepub 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.
sourcepub fn fill_with<T: ElementBufferDataType>(
&mut self,
data: &[T]
) -> ThreeDResult<()>
pub fn fill_with<T: ElementBufferDataType>(
&mut self,
data: &[T]
) -> ThreeDResult<()>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more