use kas::draw::color::Rgba;
use kas::draw::{DrawIface, DrawImpl, DrawSharedImpl, PassId};
use kas::geom::Quad;
pub trait DrawShaded {
fn shaded_square(&mut self, rect: Quad, norm: (f32, f32), col: Rgba);
fn shaded_circle(&mut self, rect: Quad, norm: (f32, f32), col: Rgba);
fn shaded_square_frame(
&mut self,
outer: Quad,
inner: Quad,
norm: (f32, f32),
outer_col: Rgba,
inner_col: Rgba,
);
fn shaded_round_frame(&mut self, outer: Quad, inner: Quad, norm: (f32, f32), col: Rgba);
}
impl<'a, DS: DrawSharedImpl> DrawShaded for DrawIface<'a, DS>
where
DS::Draw: DrawShadedImpl,
{
fn shaded_square(&mut self, rect: Quad, norm: (f32, f32), col: Rgba) {
self.draw.shaded_square(self.pass, rect, norm, col);
}
fn shaded_circle(&mut self, rect: Quad, norm: (f32, f32), col: Rgba) {
self.draw.shaded_circle(self.pass, rect, norm, col);
}
fn shaded_square_frame(
&mut self,
outer: Quad,
inner: Quad,
norm: (f32, f32),
outer_col: Rgba,
inner_col: Rgba,
) {
self.draw
.shaded_square_frame(self.pass, outer, inner, norm, outer_col, inner_col);
}
fn shaded_round_frame(&mut self, outer: Quad, inner: Quad, norm: (f32, f32), col: Rgba) {
self.draw
.shaded_round_frame(self.pass, outer, inner, norm, col);
}
}
#[cfg_attr(not(feature = "internal_doc"), doc(hidden))]
#[cfg_attr(doc_cfg, doc(cfg(internal_doc)))]
pub trait DrawShadedImpl: DrawImpl {
fn shaded_square(&mut self, pass: PassId, rect: Quad, norm: (f32, f32), col: Rgba);
fn shaded_circle(&mut self, pass: PassId, rect: Quad, norm: (f32, f32), col: Rgba);
fn shaded_square_frame(
&mut self,
pass: PassId,
outer: Quad,
inner: Quad,
norm: (f32, f32),
outer_col: Rgba,
inner_col: Rgba,
);
fn shaded_round_frame(
&mut self,
pass: PassId,
outer: Quad,
inner: Quad,
norm: (f32, f32),
col: Rgba,
);
}