pub struct BufferDescriptor<'a, R: Renderable + ?Sized> {
pub data: &'a BufferData<'a, R>,
pub stride: u32,
pub byte_offset: u32,
pub elements: Vec<VertexDesc>,
/* private fields */
}Expand description
A descriptor of a subset of a BufferData, used for vertex attributes;
hence for use in a vertex attribute pointer.
A BufferDescriptor is used for a single attribute of a set of data, such as
Position or Normal.
Fields§
§data: &'a BufferData<'a, R>The BufferData that contains the actual vertex attribute data
stride: u32Stride of data in the buffer - 0 for count*sizeof(ele_type) Unused for indices
byte_offset: u32Byte offset to first data inside ‘data’
elements: Vec<VertexDesc>Description of the layout of the elements of the actual portion of buffer data
This could become a reference to a struct that is borrowed here, with its own client ref
Implementations§
Source§impl<'a, R: Renderable> BufferDescriptor<'a, R>
impl<'a, R: Renderable> BufferDescriptor<'a, R>
Sourcepub fn new(
data: &'a BufferData<'a, R>,
byte_offset: u32,
stride: u32,
elements: Vec<VertexDesc>,
) -> Self
pub fn new( data: &'a BufferData<'a, R>, byte_offset: u32, stride: u32, elements: Vec<VertexDesc>, ) -> Self
Create a new view of a BufferData
Sourcepub fn create_client(&self, renderable: &mut R)
pub fn create_client(&self, renderable: &mut R)
Create the render buffer required by the BufferDescriptor
Sourcepub fn borrow_client(&self) -> Ref<'_, R::Descriptor>
pub fn borrow_client(&self) -> Ref<'_, R::Descriptor>
Borrow the client
Trait Implementations§
Source§impl<'a, R> Debug for BufferDescriptor<'a, R>where
R: Renderable,
impl<'a, R> Debug for BufferDescriptor<'a, R>where
R: Renderable,
Source§impl<'a, R: Renderable> Display for BufferDescriptor<'a, R>
impl<'a, R: Renderable> Display for BufferDescriptor<'a, R>
impl<'a, R: Renderable> DefaultIndentedDisplay for BufferDescriptor<'a, R>
Auto Trait Implementations§
impl<'a, R> !Freeze for BufferDescriptor<'a, R>
impl<'a, R> !RefUnwindSafe for BufferDescriptor<'a, R>
impl<'a, R> !Send for BufferDescriptor<'a, R>
impl<'a, R> !Sync for BufferDescriptor<'a, R>
impl<'a, R> Unpin for BufferDescriptor<'a, R>
impl<'a, R> !UnwindSafe for BufferDescriptor<'a, R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more