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§
source§impl VertexLayoutBuilder
impl VertexLayoutBuilder
sourcepub fn begin(renderer_type: RendererType) -> VertexLayoutBuilder
pub fn begin(renderer_type: RendererType) -> VertexLayoutBuilder
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) -> BuiltVertexLayout
Auto Trait Implementations§
impl Freeze for VertexLayoutBuilder
impl RefUnwindSafe for VertexLayoutBuilder
impl Send for VertexLayoutBuilder
impl Sync for VertexLayoutBuilder
impl Unpin for VertexLayoutBuilder
impl UnwindSafe for VertexLayoutBuilder
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