#[cfg(feature="colour_filter")]
use crate::Colour;
pub (crate) mod two_dimensions;
pub use two_dimensions::{
Graphics2D,
TexturedVertex2D,
Vertex2D
};
mod base;
pub use base::Graphics;
mod objects;
pub use objects::DependentObject;
#[cfg(feature="colour_filter")]
mod colour_filter;
#[cfg(feature="colour_filter")]
pub use colour_filter::{
FilteringFunction,
ColourFilter,
};
#[derive(Clone,Debug)]
pub enum ObjectType{
Simple,
Textured,
Text,
}
#[derive(Clone,Debug)]
pub enum DrawType{
Common,
Shifting([f32;2]),
Rotating((f32,[f32;2])),
}
#[derive(Clone,Debug)]
pub struct InnerGraphicsSettings{
pub vertex_buffer_size:usize,
pub vertex_buffer_offset:usize,
pub index_buffer_size:usize,
pub index_buffer_offset:usize,
pub object_buffer_size:usize,
}
impl InnerGraphicsSettings{
pub const fn new()->InnerGraphicsSettings{
Self{
vertex_buffer_size:128,
vertex_buffer_offset:64,
index_buffer_size:128,
index_buffer_offset:64,
object_buffer_size:16,
}
}
}
#[derive(Clone,Debug)]
pub struct TextGraphicsSettings{
pub glyph_texture_size:[u32;2],
}
impl TextGraphicsSettings{
pub const fn new()->TextGraphicsSettings{
Self{
glyph_texture_size:[256;2]
}
}
}
#[derive(Clone,Debug)]
pub struct GraphicsSettings{
#[cfg(feature="texture_graphics")]
pub texture:InnerGraphicsSettings,
#[cfg(feature="simple_graphics")]
pub simple:InnerGraphicsSettings,
#[cfg(feature="text_graphics")]
pub text:TextGraphicsSettings,
}
impl GraphicsSettings{
pub const fn new()->GraphicsSettings{
Self{
#[cfg(feature="texture_graphics")]
texture:InnerGraphicsSettings::new(),
#[cfg(feature="simple_graphics")]
simple:InnerGraphicsSettings::new(),
#[cfg(feature="text_graphics")]
text:TextGraphicsSettings::new(),
}
}
}