pub struct VertexAttribPointer { /* private fields */ }Expand description
Struct representing a vertex attribute in OpenGL.
Implementations§
Source§impl VertexAttribPointer
impl VertexAttribPointer
Sourcepub fn new(
index: u32,
size: i32,
data_type: DataType,
normalized: bool,
stride: i32,
) -> VertexAttribPointer
pub fn new( index: u32, size: i32, data_type: DataType, normalized: bool, stride: i32, ) -> VertexAttribPointer
Creates a new VertexAttribPointer and sets up the vertex attribute pointer.
§Arguments
index- Index of the vertex attribute.size- Number of components per vertex attribute (1-4 orGL_BGRA).data_type- Data type of the attribute components.normalized- Whether fixed-point data values should be normalized.stride- Byte offset between consecutive attributes.pointer- Pointer to the first component of the attribute data.
§Panics
This function panics if size is not within the valid range for OpenGL (1-4).
§Safety
This function is unsafe because it dereferences a raw pointer (pointer), which could lead to undefined behavior if the pointer is invalid.
Auto Trait Implementations§
impl Freeze for VertexAttribPointer
impl RefUnwindSafe for VertexAttribPointer
impl Send for VertexAttribPointer
impl Sync for VertexAttribPointer
impl Unpin for VertexAttribPointer
impl UnwindSafe for VertexAttribPointer
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.