Struct rin::gl::buffer::Builder[][src]

pub struct Builder<'a>(_);

Implementations

impl<'a> Builder<'a>[src]

pub fn create<T>(&self, len: usize, usage: u32) -> Result<Buffer<T>, Error>[src]

Creates a new buffer and allocates it with enough capacity to hold len elements of type T

equivalent to glGenBuffers/glCreateBuffers + gl(Named)BufferData

pub fn create_target<T>(
    &self,
    len: usize,
    usage: u32,
    target: u32
) -> Result<Buffer<T>, Error>
[src]

Creates a new buffer and allocates it with enough capacity to hold len elements of type T

equivalent to glGenBuffers/glCreateBuffers + gl(Named)BufferData. target specifies the target to which to bind the buffer before creation. This is only useful with no DSA where in certain platforms you can’t change the target initially bound

pub fn empty<T>(&self) -> Result<Buffer<T>, Error>[src]

Creates an empty buffer

Call load after empty to actually allocate the buffer with enough capacity

equivalent to glGenBuffers/glCreateBuffers

pub fn empty_target<T>(&self, target: u32) -> Result<Buffer<T>, Error>[src]

Creates an empty buffer

Call load after empty to actually allocate the buffer with enough capacity

equivalent to glGenBuffers/glCreateBuffers

pub fn from_data<T>(&self, data: &[T], usage: u32) -> Result<Buffer<T>, Error> where
    T: 'static, 
[src]

Creates a buffer, allocates it and loads the data passed as parameter in it

equivalent to glGenBuffers/glCreateBuffers + gl(Named)BufferData

pub fn from_data_target<T>(
    &self,
    data: &[T],
    usage: u32,
    target: u32
) -> Result<Buffer<T>, Error> where
    T: 'static, 
[src]

Creates a buffer, allocates it and loads the data passed as parameter in it

equivalent to glGenBuffers/glCreateBuffers + gl(Named)BufferData

pub fn create_immutable<T>(
    &self,
    len: usize,
    flags: u32
) -> Result<BufferStorage<T>, Error>
[src]

Allocates a buffer with enough capacity to hold len elemnts of type T

see gl(Named)BufferStorage

pub fn create_immutable_target<T>(
    &self,
    len: usize,
    flags: u32,
    target: u32
) -> Result<BufferStorage<T>, Error>
[src]

Allocates a buffer with enough capacity to hold len elemnts of type T

see gl(Named)BufferStorage

pub fn immutable_from_data<T>(
    &self,
    data: &[T],
    flags: u32
) -> Result<BufferStorage<T>, Error>
[src]

Allocates a buffer and loads the passed data in it

see gl(Named)BufferStorage

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Builder<'a>

impl<'a> !Send for Builder<'a>

impl<'a> !Sync for Builder<'a>

impl<'a> Unpin for Builder<'a>

impl<'a> !UnwindSafe for Builder<'a>

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[src]

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

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

impl<T> Downcast for T where
    T: Any
[src]

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

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

impl<V> IntoPnt<V> for V[src]

impl<V> IntoVec<V> for V[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

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.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]