Start implementing ggez example
This commit is contained in:
parent
2b7ad3d50e
commit
0eaffff422
5 changed files with 188 additions and 0 deletions
26
examples/ggez/renderer.rs
Normal file
26
examples/ggez/renderer.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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) {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue