Trait rin::gl::renderer::Renderer2d [−][src]
pub trait Renderer2d: Renderer3d { pub fn draw_mesh_with_material<T, U, M, G>(&self, mesh: &G, material: &M)
where
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
M: Material; pub fn draw_meshes_with_material<T, U, M, G, I>(
&self,
mesh: I,
material: &M
)
where
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
I: IntoIterator<Item = G>,
M: Material; pub fn draw_meshes_with_trafos_and_material<V, U, M, G, T, I>(
&self,
mesh: I,
material: &M
)
where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = (G, T)>,
M: Material; pub fn draw_mesh_with_trafos_and_material<V, U, M, G, T, I>(
&self,
mesh: &G,
trafos: I,
material: &M
)
where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = T>,
M: Material; pub fn draw_pos<M, R>(&self, obj: R, pos: &Point<f32, U2>)
where
M: Material,
R: Render2d<Material = M>; pub fn draw_size<M, R>(
&self,
obj: R,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>
)
where
M: Material,
R: Render2d<Material = M>; pub fn draw_rect<M, R>(&self, obj: R, rect: &Rect<f32>)
where
M: Material,
R: Render2d<Material = M>; pub fn draw_pos_with_material<M, M2, R>(
&self,
obj: R,
pos: &Point<f32, U2>,
mat: &M2
)
where
M: Material,
R: Render2d<Material = M>,
M2: Material; pub fn draw_size_with_material<M, M2, R>(
&self,
obj: R,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>,
mat: &M2
)
where
M: Material,
R: Render2d<Material = M>,
M2: Material; pub fn draw_rect_with_material<M, M2, R>(
&self,
obj: R,
rect: &Rect<f32>,
mat: &M2
)
where
M: Material,
R: Render2d<Material = M>,
M2: Material; }
2D rendering functionality for Renderer
Required methods
pub fn draw_mesh_with_material<T, U, M, G>(&self, mesh: &G, material: &M) where
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
M: Material,
[src]
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
M: Material,
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
pub fn draw_meshes_with_material<T, U, M, G, I>(&self, mesh: I, material: &M) where
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
I: IntoIterator<Item = G>,
M: Material,
[src]
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
I: IntoIterator<Item = G>,
M: Material,
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
pub fn draw_meshes_with_trafos_and_material<V, U, M, G, T, I>(
&self,
mesh: I,
material: &M
) where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = (G, T)>,
M: Material,
[src]
&self,
mesh: I,
material: &M
) where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = (G, T)>,
M: Material,
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
pub fn draw_mesh_with_trafos_and_material<V, U, M, G, T, I>(
&self,
mesh: &G,
trafos: I,
material: &M
) where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = T>,
M: Material,
[src]
&self,
mesh: &G,
trafos: I,
material: &M
) where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = T>,
M: Material,
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
pub fn draw_pos<M, R>(&self, obj: R, pos: &Point<f32, U2>) where
M: Material,
R: Render2d<Material = M>,
[src]
M: Material,
R: Render2d<Material = M>,
Draws any Render2d at the passed position
pub fn draw_size<M, R>(
&self,
obj: R,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>
) where
M: Material,
R: Render2d<Material = M>,
[src]
&self,
obj: R,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>
) where
M: Material,
R: Render2d<Material = M>,
Draws any Render2d at the passed position and size
pub fn draw_rect<M, R>(&self, obj: R, rect: &Rect<f32>) where
M: Material,
R: Render2d<Material = M>,
[src]
M: Material,
R: Render2d<Material = M>,
Draws any Render2d at the position of the passed rectangle and it’s size
pub fn draw_pos_with_material<M, M2, R>(
&self,
obj: R,
pos: &Point<f32, U2>,
mat: &M2
) where
M: Material,
R: Render2d<Material = M>,
M2: Material,
[src]
&self,
obj: R,
pos: &Point<f32, U2>,
mat: &M2
) where
M: Material,
R: Render2d<Material = M>,
M2: Material,
Draws any Render2d at the passed position with the passed material
pub fn draw_size_with_material<M, M2, R>(
&self,
obj: R,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>,
mat: &M2
) where
M: Material,
R: Render2d<Material = M>,
M2: Material,
[src]
&self,
obj: R,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>,
mat: &M2
) where
M: Material,
R: Render2d<Material = M>,
M2: Material,
Draws any Render2d at the passed position and size with the passed material
pub fn draw_rect_with_material<M, M2, R>(
&self,
obj: R,
rect: &Rect<f32>,
mat: &M2
) where
M: Material,
R: Render2d<Material = M>,
M2: Material,
[src]
&self,
obj: R,
rect: &Rect<f32>,
mat: &M2
) where
M: Material,
R: Render2d<Material = M>,
M2: Material,
Draws any Render2d at the position of the passed rectangle and it’s size with the passed material
Implementors
impl<'c, R> Renderer2d for Renderer<'c, R> where
R: 'c + RenderSurface,
[src]
impl<'c, R> Renderer2d for Renderer<'c, R> where
R: 'c + RenderSurface,
[src]pub fn draw_mesh_with_material<T, U, M, G>(&self, mesh: &G, material: &M) where
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
M: Material,
[src]
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
M: Material,
pub fn draw_meshes_with_material<T, U, M, G, I>(&self, meshes: I, material: &M) where
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
I: IntoIterator<Item = G>,
M: Material,
[src]
T: VertexFormat + Clone + 'static,
G: ToSimpleVao<T, U>,
I: IntoIterator<Item = G>,
M: Material,
pub fn draw_meshes_with_trafos_and_material<V, U, M, G, T, I>(
&self,
meshes: I,
material: &M
) where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = (G, T)>,
M: Material,
[src]
&self,
meshes: I,
material: &M
) where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = (G, T)>,
M: Material,
pub fn draw_mesh_with_trafos_and_material<V, U, M, G, T, I>(
&self,
mesh: &G,
trafos: I,
material: &M
) where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = T>,
M: Material,
[src]
&self,
mesh: &G,
trafos: I,
material: &M
) where
T: Into<Model>,
V: VertexFormat + Clone + 'static,
G: ToSimpleVao<V, U>,
I: IntoIterator<Item = T>,
M: Material,
pub fn draw_pos<M, O>(&self, obj: O, pos: &Point<f32, U2>) where
M: Material,
O: Render2d<Material = M>,
[src]
M: Material,
O: Render2d<Material = M>,
pub fn draw_size<M, O>(
&self,
obj: O,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>
) where
M: Material,
O: Render2d<Material = M>,
[src]
&self,
obj: O,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>
) where
M: Material,
O: Render2d<Material = M>,
pub fn draw_rect<M, O>(&self, obj: O, rect: &Rect<f32>) where
M: Material,
O: Render2d<Material = M>,
[src]
M: Material,
O: Render2d<Material = M>,
pub fn draw_pos_with_material<M, M2, O>(
&self,
obj: O,
pos: &Point<f32, U2>,
mat: &M2
) where
M: Material,
O: Render2d<Material = M>,
M2: Material,
[src]
&self,
obj: O,
pos: &Point<f32, U2>,
mat: &M2
) where
M: Material,
O: Render2d<Material = M>,
M2: Material,
pub fn draw_size_with_material<M, M2, O>(
&self,
obj: O,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>,
mat: &M2
) where
M: Material,
O: Render2d<Material = M>,
M2: Material,
[src]
&self,
obj: O,
pos: &Point<f32, U2>,
size: &Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>,
mat: &M2
) where
M: Material,
O: Render2d<Material = M>,
M2: Material,
pub fn draw_rect_with_material<M, M2, O>(
&self,
obj: O,
rect: &Rect<f32>,
mat: &M2
) where
M: Material,
O: Render2d<Material = M>,
M2: Material,
[src]
&self,
obj: O,
rect: &Rect<f32>,
mat: &M2
) where
M: Material,
O: Render2d<Material = M>,
M2: Material,