draw_triangles_2d

Function draw_triangles_2d 

Source
pub fn draw_triangles_2d(
    clip_rect: &Rectangle,
    indices: &[u32],
    positions: &[f32],
    colors: &[u8],
)
Expand description

Draw colored 2D triangles in screen space (physical pixel coordinates).

  • colors - Assumes premultiplied alpha.

ยงErrors

Returns an crate::ErrorCode::InvalidArguments for the following cases:

  • positions length is not an even multiple of 2.
  • indices length is not an even multiple of 3.
  • colors length is not an even multiple of 4.