summaryrefslogtreecommitdiff
path: root/src/renderer/backend.rs
blob: 0aa994afdc8531eea80608a863515f685de43cb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use winit::application::ApplicationHandler;

use super::text::TextSpan;

/// Trait that all renderer backends must implement.
pub trait RendererBackend: ApplicationHandler {
    fn name(&self) -> &str;
    fn init(&mut self, width: i32, height: i32) -> bool;
    fn clear(&mut self);
    fn draw_text(&mut self, span: &TextSpan);
    fn present(&mut self);
    fn shutdown(&mut self);
}