39 lines
769 B
Rust
39 lines
769 B
Rust
use super::positions::Position2D;
|
|
use alloc::string::{String, ToString};
|
|
|
|
/// NOTE: If this is a zero then no framebuffer has been created for this window.
|
|
pub type FrameBufferID = u16;
|
|
|
|
pub struct Window {
|
|
pub title: String,
|
|
pub resolution: Resolution,
|
|
pub position: Position2D,
|
|
pub is_fullscreen: bool,
|
|
pub framebuffer_id: FrameBufferID,
|
|
|
|
pub cursor_position: Position2D,
|
|
}
|
|
|
|
impl Window {
|
|
pub fn set_title(&mut self, title: &str) {
|
|
self.title = title.to_string();
|
|
}
|
|
pub fn get_cursor_position(&self) -> Position2D {
|
|
self.cursor_position
|
|
}
|
|
}
|
|
|
|
pub struct Resolution {
|
|
pub width: usize,
|
|
pub height: usize,
|
|
}
|
|
|
|
pub enum CursorType {
|
|
Arrow,
|
|
IBeam,
|
|
Crosshair,
|
|
Hand,
|
|
HResize,
|
|
VResize,
|
|
}
|