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(context: &Context) -> ThreeDResult<Self>
pub fn new(context: &Context) -> ThreeDResult<Self>
Creates a new empty element buffer.
sourcepub fn new_with_data<T: ElementBufferDataType>(
context: &Context,
data: &[T]
) -> ThreeDResult<Self>
pub fn new_with_data<T: ElementBufferDataType>(
context: &Context,
data: &[T]
) -> ThreeDResult<Self>
Creates a new element buffer and fills it with the given indices which must be divisable by 3.
sourcepub fn new_with<T: ElementBufferDataType>(
context: &Context,
data: &[T]
) -> ThreeDResult<Self>
👎 Deprecated: use new_with_data()
pub fn new_with<T: ElementBufferDataType>(
context: &Context,
data: &[T]
) -> ThreeDResult<Self>
use new_with_data()
Creates a new element buffer and fills it with the given indices which must be divisable by 3.
sourcepub fn fill<T: ElementBufferDataType>(&mut self, data: &[T]) -> ThreeDResult<()>
pub fn fill<T: ElementBufferDataType>(&mut self, data: &[T]) -> ThreeDResult<()>
Fills the buffer with the given indices which must be divisable by 3.
sourcepub fn fill_with<T: ElementBufferDataType>(
&mut self,
data: &[T]
) -> ThreeDResult<()>
👎 Deprecated: use fill()
pub fn fill_with<T: ElementBufferDataType>(
&mut self,
data: &[T]
) -> ThreeDResult<()>
use fill()
Fills the buffer with the given indices which must be divisable by 3.
sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
The number of triangles in the buffer.
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 · sourcefn borrow_mut(&mut self) -> &mut T
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>
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