Struct three_d::VertexBuffer[][src]

pub struct VertexBuffer { /* fields omitted */ }
Expand description

A buffer containing per vertex data, for example positions, normals, uv coordinates or colors (see also use_attribute, use_attribute_vec2, etc.).

Implementations

impl VertexBuffer[src]

pub fn new_with_static_u8(
    context: &Context,
    data: &[u8]
) -> Result<VertexBuffer, Error>
[src]

Creates a new vertex buffer and fills it with the data in the given byte array. Use this method instead of new_with_dynamic_u8 when you do not expect the data to change very often.

pub fn fill_with_static_u8(&mut self, data: &[u8])[src]

Fills the vertex buffer with the data in the given byte array. Use this method instead of fill_with_dynamic_u8 when you expect the data to change often.

pub fn new_with_dynamic_u8(
    context: &Context,
    data: &[u8]
) -> Result<VertexBuffer, Error>
[src]

Creates a new vertex buffer and fill it with the data in the given byte array. Use this method instead of new_with_static_u8 when you expect the data to change often.

pub fn fill_with_dynamic_u8(&mut self, data: &[u8])[src]

Fills the vertex buffer with the data in the given byte array. Use this method instead of fill_with_static_u8 when you expect the data to change often.

pub fn new_with_static_f32(
    context: &Context,
    data: &[f32]
) -> Result<VertexBuffer, Error>
[src]

Creates a new vertex buffer and fill it with the data in the given float array. Use this method instead of new_with_dynamic_f32 when you do not expect the data to change very often.

pub fn fill_with_static_f32(&mut self, data: &[f32])[src]

Fills the vertex buffer with the data in the given float array. Use this method instead of fill_with_dynamic_f32 when you expect the data to change often.

pub fn new_with_dynamic_f32(
    context: &Context,
    data: &[f32]
) -> Result<VertexBuffer, Error>
[src]

Creates a new vertex buffer and fill it with the data in the given float array. Use this method instead of new_with_static_f32 when you do not expect the data to change very often.

pub fn fill_with_dynamic_f32(&mut self, data: &[f32])[src]

Fills the vertex buffer with the data in the given float array. Use this method instead of fill_with_static_f32 when you expect the data to change often.

pub fn count(&self) -> usize[src]

The number of elements in the buffer.

Trait Implementations

impl Drop for VertexBuffer[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.