pub trait DrawRenderer {
Show 29 methods
// Required methods
fn pixel<C: ToColor>(&self, x: i16, y: i16, color: C) -> Result<(), String>;
fn hline<C: ToColor>(
&self,
x1: i16,
x2: i16,
y: i16,
color: C,
) -> Result<(), String>;
fn vline<C: ToColor>(
&self,
x: i16,
y1: i16,
y2: i16,
color: C,
) -> Result<(), String>;
fn rectangle<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String>;
fn rounded_rectangle<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
rad: i16,
color: C,
) -> Result<(), String>;
fn box_<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String>;
fn rounded_box<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
rad: i16,
color: C,
) -> Result<(), String>;
fn line<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String>;
fn aa_line<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
color: C,
) -> Result<(), String>;
fn thick_line<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
width: u8,
color: C,
) -> Result<(), String>;
fn circle<C: ToColor>(
&self,
x: i16,
y: i16,
rad: i16,
color: C,
) -> Result<(), String>;
fn aa_circle<C: ToColor>(
&self,
x: i16,
y: i16,
rad: i16,
color: C,
) -> Result<(), String>;
fn filled_circle<C: ToColor>(
&self,
x: i16,
y: i16,
rad: i16,
color: C,
) -> Result<(), String>;
fn arc<C: ToColor>(
&self,
x: i16,
y: i16,
rad: i16,
start: i16,
end: i16,
color: C,
) -> Result<(), String>;
fn ellipse<C: ToColor>(
&self,
x: i16,
y: i16,
rx: i16,
ry: i16,
color: C,
) -> Result<(), String>;
fn aa_ellipse<C: ToColor>(
&self,
x: i16,
y: i16,
rx: i16,
ry: i16,
color: C,
) -> Result<(), String>;
fn filled_ellipse<C: ToColor>(
&self,
x: i16,
y: i16,
rx: i16,
ry: i16,
color: C,
) -> Result<(), String>;
fn pie<C: ToColor>(
&self,
x: i16,
y: i16,
rad: i16,
start: i16,
end: i16,
color: C,
) -> Result<(), String>;
fn filled_pie<C: ToColor>(
&self,
x: i16,
y: i16,
rad: i16,
start: i16,
end: i16,
color: C,
) -> Result<(), String>;
fn trigon<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
x3: i16,
y3: i16,
color: C,
) -> Result<(), String>;
fn aa_trigon<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
x3: i16,
y3: i16,
color: C,
) -> Result<(), String>;
fn filled_trigon<C: ToColor>(
&self,
x1: i16,
y1: i16,
x2: i16,
y2: i16,
x3: i16,
y3: i16,
color: C,
) -> Result<(), String>;
fn polygon<C: ToColor>(
&self,
vx: &[i16],
vy: &[i16],
color: C,
) -> Result<(), String>;
fn aa_polygon<C: ToColor>(
&self,
vx: &[i16],
vy: &[i16],
color: C,
) -> Result<(), String>;
fn filled_polygon<C: ToColor>(
&self,
vx: &[i16],
vy: &[i16],
color: C,
) -> Result<(), String>;
fn textured_polygon<C: ToColor>(
&self,
vx: &[i16],
vy: &[i16],
texture: &Surface<'_>,
texture_dx: i16,
texture_dy: i16,
color: C,
) -> Result<(), String>;
fn bezier<C: ToColor>(
&self,
vx: &[i16],
vy: &[i16],
s: i32,
color: C,
) -> Result<(), String>;
fn character<C: ToColor>(
&self,
x: i16,
y: i16,
c: char,
color: C,
) -> Result<(), String>;
fn string<C: ToColor>(
&self,
x: i16,
y: i16,
s: &str,
color: C,
) -> Result<(), String>;
}
Expand description
For drawing with rust-sdl2 Renderer
Required Methods§
fn pixel<C: ToColor>(&self, x: i16, y: i16, color: C) -> Result<(), String>
fn hline<C: ToColor>( &self, x1: i16, x2: i16, y: i16, color: C, ) -> Result<(), String>
fn vline<C: ToColor>( &self, x: i16, y1: i16, y2: i16, color: C, ) -> Result<(), String>
fn rectangle<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, color: C, ) -> Result<(), String>
fn rounded_rectangle<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, rad: i16, color: C, ) -> Result<(), String>
fn box_<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, color: C, ) -> Result<(), String>
fn rounded_box<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, rad: i16, color: C, ) -> Result<(), String>
fn line<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, color: C, ) -> Result<(), String>
fn aa_line<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, color: C, ) -> Result<(), String>
fn thick_line<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, width: u8, color: C, ) -> Result<(), String>
fn circle<C: ToColor>( &self, x: i16, y: i16, rad: i16, color: C, ) -> Result<(), String>
fn aa_circle<C: ToColor>( &self, x: i16, y: i16, rad: i16, color: C, ) -> Result<(), String>
fn filled_circle<C: ToColor>( &self, x: i16, y: i16, rad: i16, color: C, ) -> Result<(), String>
fn arc<C: ToColor>( &self, x: i16, y: i16, rad: i16, start: i16, end: i16, color: C, ) -> Result<(), String>
fn ellipse<C: ToColor>( &self, x: i16, y: i16, rx: i16, ry: i16, color: C, ) -> Result<(), String>
fn aa_ellipse<C: ToColor>( &self, x: i16, y: i16, rx: i16, ry: i16, color: C, ) -> Result<(), String>
fn filled_ellipse<C: ToColor>( &self, x: i16, y: i16, rx: i16, ry: i16, color: C, ) -> Result<(), String>
fn pie<C: ToColor>( &self, x: i16, y: i16, rad: i16, start: i16, end: i16, color: C, ) -> Result<(), String>
fn filled_pie<C: ToColor>( &self, x: i16, y: i16, rad: i16, start: i16, end: i16, color: C, ) -> Result<(), String>
fn trigon<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, x3: i16, y3: i16, color: C, ) -> Result<(), String>
fn aa_trigon<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, x3: i16, y3: i16, color: C, ) -> Result<(), String>
fn filled_trigon<C: ToColor>( &self, x1: i16, y1: i16, x2: i16, y2: i16, x3: i16, y3: i16, color: C, ) -> Result<(), String>
fn polygon<C: ToColor>( &self, vx: &[i16], vy: &[i16], color: C, ) -> Result<(), String>
fn aa_polygon<C: ToColor>( &self, vx: &[i16], vy: &[i16], color: C, ) -> Result<(), String>
fn filled_polygon<C: ToColor>( &self, vx: &[i16], vy: &[i16], color: C, ) -> Result<(), String>
fn textured_polygon<C: ToColor>( &self, vx: &[i16], vy: &[i16], texture: &Surface<'_>, texture_dx: i16, texture_dy: i16, color: C, ) -> Result<(), String>
fn bezier<C: ToColor>( &self, vx: &[i16], vy: &[i16], s: i32, color: C, ) -> Result<(), String>
fn character<C: ToColor>( &self, x: i16, y: i16, c: char, color: C, ) -> Result<(), String>
fn string<C: ToColor>( &self, x: i16, y: i16, s: &str, color: C, ) -> Result<(), String>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.