Struct bgfx_rs::static_lib::VertexLayoutBuilder
source · [−]#[repr(C)]pub struct VertexLayoutBuilder {
pub hash: u32,
pub stride: u16,
pub offset: [u16; 18],
pub attributes: [u16; 18],
}
Expand description
Vertex layout.
Fields
hash: u32
Hash.
stride: u16
Stride.
offset: [u16; 18]
Attribute offsets.
attributes: [u16; 18]
Used attributes.
Implementations
sourceimpl VertexLayoutBuilder
impl VertexLayoutBuilder
pub fn new() -> VertexLayoutBuilder
sourcepub fn begin(&self, renderer_type: RendererType) -> &Self
pub fn begin(&self, renderer_type: RendererType) -> &Self
renderer_type
: Renderer backend type. See:bgfx::RendererType
sourcepub fn add(
&self,
attrib: Attrib,
num: u8,
type_r: AttribType,
params: AddArgs
) -> &Self
pub fn add(
&self,
attrib: Attrib,
num: u8,
type_r: AttribType,
params: AddArgs
) -> &Self
attrib
: Attribute semantics. See:bgfx::Attrib
num
: Number of elements 1, 2, 3 or 4.type_r
: Element type.normalized
: When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader.as_int
: Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader.
pub fn end(&self)
Auto Trait Implementations
impl RefUnwindSafe for VertexLayoutBuilder
impl Send for VertexLayoutBuilder
impl Sync for VertexLayoutBuilder
impl Unpin for VertexLayoutBuilder
impl UnwindSafe for VertexLayoutBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more