1
0
Fork 0
forked from AbleOS/ableos
ableOS_v1Change/ableos/src/vga_e.rs

48 lines
1.2 KiB
Rust
Raw Normal View History

2022-01-07 10:31:47 -06:00
use alloc::string::String;
2022-01-13 08:54:33 -06:00
use vga::{
colors::Color16,
writers::{Graphics640x480x16, GraphicsWriter},
};
2022-01-07 10:31:47 -06:00
pub fn test_it_fucko() {
let mode = Graphics640x480x16::new();
mode.set_mode();
mode.clear_screen(Color16::Black);
mode.draw_line((80, 60), (80, 420), Color16::White);
mode.draw_line((80, 60), (540, 60), Color16::White);
{
let offset = 110;
mode.draw_character(offset - 15 - 4, 60 + 15 - 4, 'x', Color16::Red);
mode.draw_line(
(offset.try_into().unwrap(), 60),
(offset.try_into().unwrap(), 90),
Color16::White,
);
}
mode.draw_line((80, 420), (540, 420), Color16::White);
mode.draw_line((540, 420), (540, 60), Color16::White);
mode.draw_line((80, 90), (540, 90), Color16::White);
for (offset, character) in "ableOS".chars().enumerate() {
mode.draw_character(270 + offset * 8, 72, character, Color16::White)
}
2022-01-13 08:54:33 -06:00
for (offset, character) in "S".chars().enumerate() {
mode.draw_character(270 + offset * 8, 50, character, Color16::White)
}
2022-01-07 10:31:47 -06:00
}
pub trait GraphicsAPI {
2022-01-13 08:54:33 -06:00
fn add_shader() {}
2022-01-07 10:31:47 -06:00
}
pub struct Buffer {
label: String,
resolution: (u64, u64),
// pointer
}