mod palette;
mod video_sdl;
pub use palette::Palette;
pub use video_sdl::VideoSdl;
#[derive(PartialEq, Eq, Hash, Copy, Clone)]
pub struct TextureInfo {
id: usize,
width: u32,
height: u32,
}
pub struct Rect {
x: i32,
y: i32,
w: u32,
h: u32,
}
impl Rect {
pub fn new(x: i32, y: i32, w: u32, h: u32) -> Rect {
Rect { x, y, w, h }
}
}
pub trait VideoDevice {
fn gen_texture(&mut self, width: u32, height: u32) -> TextureInfo;
fn set_title(&mut self, title: &str);
fn update_texture(&mut self, tex: TextureInfo, buffer: &[u8]);
fn begin(&mut self);
fn draw_texture_2d(&mut self, tex: TextureInfo, rect: Option<Rect>);
fn end(&mut self);
}