Basic output system
This commit is contained in:
35
src/device.rs
Normal file
35
src/device.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::screen::Screen;
|
||||
|
||||
pub struct DeviceT {
|
||||
pub screen: Screen
|
||||
}
|
||||
|
||||
impl DeviceT {
|
||||
fn new() -> Self {
|
||||
let screen = Screen::new();
|
||||
|
||||
DeviceT {
|
||||
screen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Device {
|
||||
pub shared: Rc<DeviceT>
|
||||
}
|
||||
|
||||
impl Device {
|
||||
pub fn new() -> Self {
|
||||
return Device {
|
||||
shared: Rc::new(DeviceT::new())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn share(&self) -> Self {
|
||||
return Device {
|
||||
shared: self.shared.clone()
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user