Struct mod3d_base::BufferAccessor
source · pub struct BufferAccessor<'a, R: Renderable + ?Sized> {
pub data: &'a BufferData<'a, R>,
pub elements_per_data: u32,
pub ele_type: BufferElementType,
pub byte_offset: u32,
pub stride: u32,
/* private fields */
}Expand description
A subset of a BufferData, used for vertex attributes;
hence for use in a vertex attribute pointer.
A BufferAccessor 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
elements_per_data: u32For attributes: number of elements per vertex (1 to 4, or 4, 9 or 16) For indices: number of indices in the buffer
ele_type: BufferElementTypeThe type of each element
For indices this must be Int8, Int16 or Int32
byte_offset: u32Offset from start of buffer to first byte of data
stride: u32Stride of data in the buffer - 0 for count*sizeof(ele_type) Unused for indices
Implementations§
source§impl<'a, R: Renderable> BufferAccessor<'a, R>
impl<'a, R: Renderable> BufferAccessor<'a, R>
sourcepub fn new(
data: &'a BufferData<'a, R>,
count: u32,
ele_type: BufferElementType,
byte_offset: u32,
stride: u32,
) -> Self
pub fn new( data: &'a BufferData<'a, R>, count: u32, ele_type: BufferElementType, byte_offset: u32, stride: u32, ) -> Self
Create a new view of a BufferData
sourcepub fn create_client(&self, attr: VertexAttr, renderable: &mut R)
pub fn create_client(&self, attr: VertexAttr, renderable: &mut R)
Create the render buffer required by the BufferAccessor
sourcepub fn borrow_client(&self) -> Ref<'_, R::Accessor>
pub fn borrow_client(&self) -> Ref<'_, R::Accessor>
Borrow the client
Trait Implementations§
source§impl<'a, R> Debug for BufferAccessor<'a, R>where
R: Renderable,
impl<'a, R> Debug for BufferAccessor<'a, R>where
R: Renderable,
source§impl<'a, R: Renderable> Display for BufferAccessor<'a, R>
impl<'a, R: Renderable> Display for BufferAccessor<'a, R>
impl<'a, R: Renderable> DefaultIndentedDisplay for BufferAccessor<'a, R>
Auto Trait Implementations§
impl<'a, R> !Freeze for BufferAccessor<'a, R>
impl<'a, R> !RefUnwindSafe for BufferAccessor<'a, R>
impl<'a, R> !Send for BufferAccessor<'a, R>
impl<'a, R> !Sync for BufferAccessor<'a, R>
impl<'a, R> Unpin for BufferAccessor<'a, R>
impl<'a, R> !UnwindSafe for BufferAccessor<'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