use device;
#[derive(Copy, Clone, PartialEq, Debug)]
pub enum Plane {
Surface(device::SurfaceHandle),
Texture(device::TextureHandle, device::target::Level,
Option<device::target::Layer>),
}
impl Plane {
pub fn get_surface_info(&self) -> device::tex::SurfaceInfo {
match *self {
Plane::Surface(ref suf) => *suf.get_info(),
Plane::Texture(ref tex, _, _) => tex.get_info().to_surface_info(),
}
}
}
#[derive(Clone, PartialEq, Debug)]
pub struct Frame {
pub width: u16,
pub height: u16,
pub colors: Vec<Plane>,
pub depth: Option<Plane>,
pub stencil: Option<Plane>,
}
impl Frame {
pub fn new(width: u16, height: u16) -> Frame {
Frame {
width: width,
height: height,
colors: Vec::new(),
depth: None,
stencil: None,
}
}
pub fn is_default(&self) -> bool {
self.colors.is_empty() &&
self.depth.is_none() &&
self.stencil.is_none()
}
}