Trait rin_gl::Renderer2d[][src]

pub trait Renderer2d: Renderer3d {
    fn draw_mesh_with_material<T, U, M: Material, G: ToSimpleVao<T, U>>(
        &self,
        mesh: &G,
        material: &M
    )
    where
        T: VertexFormat + Clone + 'static
;
fn draw_meshes_with_material<T, U, M: Material, G: ToSimpleVao<T, U>, I: IntoIterator<Item = G>>(
        &self,
        mesh: I,
        material: &M
    )
    where
        T: VertexFormat + Clone + 'static
;
fn draw_meshes_with_trafos_and_material<V, U, M: Material, G: ToSimpleVao<V, U>, T: Into<Model>, I: IntoIterator<Item = (G, T)>>(
        &self,
        mesh: I,
        material: &M
    )
    where
        V: VertexFormat + Clone + 'static
;
fn draw_mesh_with_trafos_and_material<V, U, M: Material, G: ToSimpleVao<V, U>, T: Into<Model>, I: IntoIterator<Item = T>>(
        &self,
        mesh: &G,
        trafos: I,
        material: &M
    )
    where
        V: VertexFormat + Clone + 'static
;
fn draw_pos<M: Material, R: Render2d<Material = M>>(
        &self,
        obj: R,
        pos: &Pnt2
    );
fn draw_size<M: Material, R: Render2d<Material = M>>(
        &self,
        obj: R,
        pos: &Pnt2,
        size: &Vec2
    );
fn draw_rect<M: Material, R: Render2d<Material = M>>(
        &self,
        obj: R,
        rect: &Rect<f32>
    );
fn draw_pos_with_material<M: Material, M2: Material, R: Render2d<Material = M>>(
        &self,
        obj: R,
        pos: &Pnt2,
        mat: &M2
    );
fn draw_size_with_material<M: Material, M2: Material, R: Render2d<Material = M>>(
        &self,
        obj: R,
        pos: &Pnt2,
        size: &Vec2,
        mat: &M2
    );
fn draw_rect_with_material<M: Material, M2: Material, R: Render2d<Material = M>>(
        &self,
        obj: R,
        rect: &Rect<f32>,
        mat: &M2
    ); }

2D rendering functionality for Renderer

Required methods

fn draw_mesh_with_material<T, U, M: Material, G: ToSimpleVao<T, U>>(
    &self,
    mesh: &G,
    material: &M
) where
    T: VertexFormat + Clone + 'static, 
[src]

Draws a mesh in RAM using the passed material

The renderer keeps a pool of VAOs and buffers of every used type so when using this function it’ll upload the mesh to one of this buffers and draw with it

If this object is going to be drawn repeatedly probably pre-uploading it to the gpu might make the application faster

fn draw_meshes_with_material<T, U, M: Material, G: ToSimpleVao<T, U>, I: IntoIterator<Item = G>>(
    &self,
    mesh: I,
    material: &M
) where
    T: VertexFormat + Clone + 'static, 
[src]

Draws several meshes in RAM using the passed material

Similar to draw_mesh_with_material but faster when we want to draw multiple meshes with the same material

fn draw_meshes_with_trafos_and_material<V, U, M: Material, G: ToSimpleVao<V, U>, T: Into<Model>, I: IntoIterator<Item = (G, T)>>(
    &self,
    mesh: I,
    material: &M
) where
    V: VertexFormat + Clone + 'static, 
[src]

Draws several meshes in RAM using the passed material

Similar to with_model + draw_mesh_with_material but faster when we want to draw multiple meshes with different transformations and the same material

fn draw_mesh_with_trafos_and_material<V, U, M: Material, G: ToSimpleVao<V, U>, T: Into<Model>, I: IntoIterator<Item = T>>(
    &self,
    mesh: &G,
    trafos: I,
    material: &M
) where
    V: VertexFormat + Clone + 'static, 
[src]

Draws several meshes in RAM using the passed material

Similar to with_model + draw_mesh_with_material but faster when we want to draw the same mesh with different transformations and the same material

fn draw_pos<M: Material, R: Render2d<Material = M>>(&self, obj: R, pos: &Pnt2)[src]

Draws any Render2d at the passed position

fn draw_size<M: Material, R: Render2d<Material = M>>(
    &self,
    obj: R,
    pos: &Pnt2,
    size: &Vec2
)
[src]

Draws any Render2d at the passed position and size

fn draw_rect<M: Material, R: Render2d<Material = M>>(
    &self,
    obj: R,
    rect: &Rect<f32>
)
[src]

Draws any Render2d at the position of the passed rectangle and it’s size

fn draw_pos_with_material<M: Material, M2: Material, R: Render2d<Material = M>>(
    &self,
    obj: R,
    pos: &Pnt2,
    mat: &M2
)
[src]

Draws any Render2d at the passed position with the passed material

fn draw_size_with_material<M: Material, M2: Material, R: Render2d<Material = M>>(
    &self,
    obj: R,
    pos: &Pnt2,
    size: &Vec2,
    mat: &M2
)
[src]

Draws any Render2d at the passed position and size with the passed material

fn draw_rect_with_material<M: Material, M2: Material, R: Render2d<Material = M>>(
    &self,
    obj: R,
    rect: &Rect<f32>,
    mat: &M2
)
[src]

Draws any Render2d at the position of the passed rectangle and it’s size with the passed material

Loading content...

Implementors

impl<'c, R: RenderSurface + 'c> Renderer2d for Renderer<'c, R>[src]

Loading content...