#![cfg_attr(doc_cfg, feature(doc_cfg))]
pub mod draw;
mod draw_shaded;
pub mod options;
mod shaded_theme;
mod surface;
use crate::draw::{CustomPipeBuilder, DrawPipe};
use kas::shell::{GraphicalShell, Result};
pub use draw_shaded::{DrawShaded, DrawShadedImpl};
pub use options::Options;
pub use shaded_theme::ShadedTheme;
pub extern crate wgpu;
pub struct WgpuShellBuilder<CB: CustomPipeBuilder>(CB, Options);
impl<CB: CustomPipeBuilder> GraphicalShell for WgpuShellBuilder<CB> {
type Shared = DrawPipe<CB::Pipe>;
type Window = draw::DrawWindow<<CB::Pipe as draw::CustomPipe>::Window>;
type Surface = surface::Surface<CB::Pipe>;
fn build(self) -> Result<Self::Shared> {
DrawPipe::new(self.0, &self.1)
}
}
impl Default for WgpuShellBuilder<()> {
fn default() -> Self {
WgpuShellBuilder((), Options::from_env())
}
}
impl<CB: CustomPipeBuilder> From<CB> for WgpuShellBuilder<CB> {
fn from(cb: CB) -> Self {
WgpuShellBuilder(cb, Options::from_env())
}
}
pub type DefaultGraphicalShell = WgpuShellBuilder<()>;