mod atlases;
mod common;
mod custom;
mod draw_pipe;
mod flat_round;
mod images;
mod round_2col;
mod shaded_round;
mod shaded_square;
mod shaders;
mod text_pipe;
use kas::draw::WindowCommon;
use kas::geom::{Offset, Rect};
use shaders::ShaderManager;
use wgpu::TextureFormat;
pub use custom::{CustomPipe, CustomPipeBuilder, CustomWindow, DrawCustom};
pub(crate) const RENDER_TEX_FORMAT: TextureFormat = TextureFormat::Bgra8UnormSrgb;
type Scale = [f32; 4];
pub struct DrawPipe<C> {
pub(crate) instance: wgpu::Instance,
pub(crate) device: wgpu::Device,
queue: wgpu::Queue,
staging_belt: wgpu::util::StagingBelt,
bgl_common: wgpu::BindGroupLayout,
light_norm_buf: wgpu::Buffer,
bg_common: Vec<(wgpu::Buffer, wgpu::BindGroup)>,
images: images::Images,
shaded_square: shaded_square::Pipeline,
shaded_round: shaded_round::Pipeline,
flat_round: flat_round::Pipeline,
round_2col: round_2col::Pipeline,
custom: C,
pub(crate) text: text_pipe::Pipeline,
}
pub struct DrawWindow<CW: CustomWindow> {
pub(crate) common: WindowCommon,
scale: Scale,
clip_regions: Vec<(Rect, Offset)>,
images: images::Window,
shaded_square: shaded_square::Window,
shaded_round: shaded_round::Window,
flat_round: flat_round::Window,
round_2col: round_2col::Window,
custom: CW,
pub(crate) text: text_pipe::Window,
}