Implement clear

This commit is contained in:
Baptiste Wicht 2014-01-14 21:30:21 +01:00
parent c81fcfbabc
commit 0b7facea32
3 changed files with 22 additions and 3 deletions

View File

@ -114,6 +114,9 @@ void draw_hline(size_t x, size_t y, size_t w, uint32_t color);
void draw_vline(size_t x, size_t y, size_t h, uint32_t color);
void draw_vline(size_t x, size_t y, size_t h, uint8_t r, uint8_t g, uint8_t b);
void draw_rect(size_t x, size_t y, size_t w, size_t h, uint32_t color);
void draw_rect(size_t x, size_t y, size_t w, size_t h, uint8_t r, uint8_t g, uint8_t b);
void draw_char(size_t x, size_t y, char c, uint32_t color);
void draw_char(size_t x, size_t y, char c, uint8_t r, uint8_t g, uint8_t b);

View File

@ -108,7 +108,7 @@ void vesa::draw_vline(size_t x, size_t y, size_t h, uint32_t color){
}
void vesa::draw_vline(size_t x, size_t y, size_t h, uint8_t r, uint8_t g, uint8_t b){
return draw_vline(x, y, h, make_color(r, g, b));
draw_vline(x, y, h, make_color(r, g, b));
}
void vesa::draw_char(size_t x, size_t y, char c, uint32_t color){
@ -130,5 +130,21 @@ void vesa::draw_char(size_t x, size_t y, char c, uint32_t color){
}
void vesa::draw_char(size_t x, size_t y, char c, uint8_t r, uint8_t g, uint8_t b){
return draw_char(x, y, c, make_color(r, g, b));
draw_char(x, y, c, make_color(r, g, b));
}
void vesa::draw_rect(size_t x, size_t y, size_t w, size_t h, uint32_t color){
auto where = x + y * y_shift;
for(size_t j = 0; j < h; ++j){
for(size_t i = 0; i < w; ++i){
screen[where + i] = color;
}
where += y_shift;
}
}
void vesa::draw_rect(size_t x, size_t y, size_t w, size_t h, uint8_t r, uint8_t g, uint8_t b){
draw_rect(x, y, w, h, make_color(r, g, b));
}

View File

@ -45,7 +45,7 @@ size_t vesa_console::columns(){
}
void vesa_console::clear(){
vesa::draw_rect(LEFT, TOP, _columns * 8, _lines* 16, 0, 0, 0);
}
void vesa_console::scroll_up(){