iced/examples/ggez/renderer.rs
2019-07-21 12:35:25 +02:00

26 lines
544 B
Rust

mod text;
use ggez::graphics::{self, Color};
use ggez::Context;
pub struct Renderer<'a> {
pub context: &'a mut Context,
}
impl Renderer<'_> {
pub fn flush(&mut self) {
graphics::draw_queued_text(
self.context,
graphics::DrawParam::default(),
Default::default(),
graphics::FilterMode::Linear,
)
.expect("Draw text");
}
}
impl iced::Renderer for Renderer<'_> {
type Color = Color;
fn explain(&mut self, layout: &iced::Layout<'_>, color: Color) {}
}