pub fn new(cx: &Context, pipeline: &BatchRenderPipeline) -> Self {
        let renderer = BatchRenderer::new(pipeline);

        let rect = Mesh::new(
            &cx,
            &[
                Vertex {
                    pos: [0., 0.],
                    uv: [0., 0.],
                },
                Vertex {
                    pos: [1., 0.],
                    uv: [1., 0.],
                },
                Vertex {
                    pos: [0., 1.],
                    uv: [0., 1.],
                },
                Vertex {
                    pos: [1., 1.],
                    uv: [1., 1.],
                },
            ],
            &[0, 2, 1, 2, 3, 1],
        );

        let white = ImageTexture {
            format: wgpu::TextureFormat::Rgba8UnormSrgb,
            pixels: Cow::Borrowed(&[255, 255, 255, 255]),
            width: 1,
            height: 1,
        }
        .create(&cx);

        SpriteBatchRenderer {
            renderer,
            rect,
            white,
            matrix: glam::Mat4::IDENTITY,
        }
    }
/// Creates a new [SpriteBatchRenderer].
///
/// See [BatchRenderer::new].
Creates a new [SpriteBatchRenderer].
Creates a new [ SpriteBatchRenderer ] .
pub fn new(cx: &Context, pipeline: &BatchRenderPipeline) -> Self {
        let renderer = BatchRenderer::new(pipeline);
        let rect = Mesh::new(
            &cx,
            &[
                Vertex {
                    pos: [0., 0.],
                    uv: [0., 0.],
                },
                Vertex {
                    pos: [1., 0.],
                    uv: [1., 0.],
                },
                Vertex {
                    pos: [0., 1.],
                    uv: [0., 1.],
                },
                Vertex {
                    pos: [1., 1.],
                    uv: [1., 1.],
                },
            ],
            &[0, 2, 1, 2, 3, 1],
        );
        let white = ImageTexture {
            format: wgpu::TextureFormat::Rgba8UnormSrgb,
            pixels: Cow::Borrowed(&[255, 255, 255, 255]),
            width: 1,
            height: 1,
        }
        .create(&cx);
        SpriteBatchRenderer {
            renderer,
            rect,
            white,
            matrix: glam::Mat4::IDENTITY,
        }
    }
pub fn new ( cx : & Context , pipeline : & BatchRenderPipeline ) -> Self { let renderer = BatchRenderer :: new ( pipeline ) ; let rect = Mesh :: new ( & cx , & [ Vertex { pos : [ 0. , 0. ] , uv : [ 0. , 0. ] , } , Vertex { pos : [ 1. , 0. ] , uv : [ 1. , 0. ] , } , Vertex { pos : [ 0. , 1. ] , uv : [ 0. , 1. ] , } , Vertex { pos : [ 1. , 1. ] , uv : [ 1. , 1. ] , } , ] , & [ 0 , 2 , 1 , 2 , 3 , 1 ] , ) ; let white = ImageTexture { format : wgpu :: TextureFormat :: Rgba8UnormSrgb , pixels : Cow :: Borrowed ( & [ 255 , 255 , 255 , 255 ] ) , width : 1 , height : 1 , } . create ( & cx ) ; SpriteBatchRenderer { renderer , rect , white , matrix : glam :: Mat4 :: IDENTITY , } }
Creates a new [SpriteBatchRenderer].
Creates a new [ SpriteBatchRenderer ] .
cx
&Context
pipeline
&BatchRenderPipeline
cx
&Context
pipeline
&BatchRenderPipeline