use std::default::Default;
pub use nalgebra as na;
pub mod gl;
pub mod shader;
pub mod buffer;
pub mod objects;
pub mod camera;
pub mod text_rendering;
pub mod texture;
#[derive(Debug, Copy, Clone)]
pub struct ScreenCoords {
pub x: f32,
pub y: f32
}
#[derive(Debug, Copy, Clone)]
pub struct ScreenBox {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub screen_w: f32,
pub screen_h: f32
}
impl ScreenBox {
pub fn new(pixel_x: f32, pixel_y: f32, pixel_w: f32, pixel_h: f32, screen_w: f32, screen_h: f32) -> Self {
ScreenBox {
x: pixel_x,
y: pixel_y,
width: pixel_w,
height: pixel_h,
screen_w,
screen_h
}
}
pub fn full_screen(screen_w: f32, screen_h: f32) -> Self {
ScreenBox {
x: 0.0,
y: 0.0,
width: screen_w,
height: screen_h,
screen_w,
screen_h
}
}
pub fn left(&self) -> f32 {
self.x
}
pub fn right(&self) -> f32 {
self.x + self.width
}
pub fn top(&self) -> f32 {
self.y
}
pub fn bottom(&self) -> f32 {
self.y + self.height
}
}