#[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

source

pub fn begin(renderer_type: RendererType) -> VertexLayoutBuilder

  • renderer_type: Renderer backend type. See: bgfx::RendererType
source

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.
source

pub fn has(&self, attrib: Attrib) -> bool

  • attrib: Attribute semantics. See: bgfx::Attrib
source

pub fn skip(self, num: u8) -> Self

  • num: Number of bytes to skip.
source

pub fn end(self) -> BuiltVertexLayout

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.