MentOS
0.8.0
The Mentoring Operating System
|
Functions required to manage the Video Graphics Array (VGA). More...
Go to the source code of this file.
Functions | |
void | vga_initialize (void) |
Initializes the VGA. | |
void | vga_finalize (void) |
Finalizes the VGA. | |
void | vga_update (void) |
Updates the graphic elements. | |
int | vga_is_enabled (void) |
Checks if the VGA is enabled. More... | |
int | vga_width (void) |
Returns the width of the screen. More... | |
int | vga_height (void) |
Returns the height of the screen. More... | |
void | vga_clear_screen (void) |
Clears the screen. | |
void | vga_draw_pixel (int x, int y, unsigned char color) |
Draws a pixel at the given position. More... | |
unsigned int | vga_read_pixel (int x, int y) |
Reads a pixel at the given position. More... | |
void | vga_draw_char (int x, int y, unsigned char c, unsigned char color) |
Draws a character at the given position. More... | |
void | vga_draw_string (int x, int y, const char *str, unsigned char color) |
Draws a string at the given position. More... | |
void | vga_draw_line (int x0, int y0, int x1, int y1, unsigned char color) |
Draws a line from point 1 to point 2. More... | |
void | vga_draw_rectangle (int sx, int sy, int w, int h, unsigned char color) |
Draws a rectangle provided the position of the starting corner and the ending corner. More... | |
void | vga_draw_circle (int xc, int yc, int r, unsigned char color) |
Draws a circle provided the position of the center and the radius. More... | |
void | vga_draw_triangle (int x1, int y1, int x2, int y2, int x3, int y3, unsigned char color) |
Draws a triangle. More... | |
void | vga_putc (int c) |
Print the given character on the screen. More... | |
void | vga_puts (const char *str) |
Prints the given string on the screen. More... | |
void | vga_move_cursor (unsigned int x, unsigned int y) |
Move the cursor at the position x, y on the screen. More... | |
void | vga_get_cursor_position (unsigned int *x, unsigned int *y) |
Returns cursor's position on the screen. More... | |
void | vga_get_screen_size (unsigned int *width, unsigned int *height) |
Returns screen size. More... | |
void | vga_new_line (void) |
Move to the following line (the effect of character). | |
void | vga_set_color (unsigned int color) |
Change the color. More... | |
void | vga_run_test (void) |
Run some VGA tests. | |
Functions required to manage the Video Graphics Array (VGA).
void vga_draw_char | ( | int | x, |
int | y, | ||
unsigned char | c, | ||
unsigned char | color | ||
) |
Draws a character at the given position.
x | x-axis position. |
y | y-axis position. |
c | character to draw. |
color | color of the character. |
void vga_draw_circle | ( | int | xc, |
int | yc, | ||
int | r, | ||
unsigned char | color | ||
) |
Draws a circle provided the position of the center and the radius.
xc | x-axis position. |
yc | y-axis position. |
r | radius. |
color | used to draw the circle. |
void vga_draw_line | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
unsigned char | color | ||
) |
Draws a line from point 1 to point 2.
x0 | point 1 x-axis position. |
y0 | point 1 y-axis position. |
x1 | point 2 x-axis position. |
y1 | point 2 y-axis position. |
color | color of the line. |
void vga_draw_pixel | ( | int | x, |
int | y, | ||
unsigned char | color | ||
) |
Draws a pixel at the given position.
x | x-axis position. |
y | y-axis position. |
color | color of the character. |
void vga_draw_rectangle | ( | int | sx, |
int | sy, | ||
int | w, | ||
int | h, | ||
unsigned char | color | ||
) |
Draws a rectangle provided the position of the starting corner and the ending corner.
sx | top-left corner x-axis position. |
sy | top-left corner y-axis position. |
w | width. |
h | height. |
color | color of the rectangle. |
void vga_draw_string | ( | int | x, |
int | y, | ||
const char * | str, | ||
unsigned char | color | ||
) |
Draws a string at the given position.
x | x-axis position. |
y | y-axis position. |
str | string to draw. |
color | color of the character. |
void vga_draw_triangle | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | x3, | ||
int | y3, | ||
unsigned char | color | ||
) |
Draws a triangle.
x1 | 1st point x-axis position. |
y1 | 1st point y-axis position. |
x2 | 2nd point x-axis position. |
y2 | 2nd point y-axis position. |
x3 | 3rd point x-axis position. |
y3 | 3rd point y-axis position. |
color | used to draw the triangle. |
void vga_get_cursor_position | ( | unsigned int * | x, |
unsigned int * | y | ||
) |
Returns cursor's position on the screen.
x | The output x coordinate. |
y | The output y coordinate. |
void vga_get_screen_size | ( | unsigned int * | width, |
unsigned int * | height | ||
) |
Returns screen size.
width | The screen width. |
height | The screen height. |
int vga_height | ( | void | ) |
Returns the height of the screen.
int vga_is_enabled | ( | void | ) |
Checks if the VGA is enabled.
void vga_move_cursor | ( | unsigned int | x, |
unsigned int | y | ||
) |
Move the cursor at the position x, y on the screen.
x | The x coordinate. |
y | The y coordinate. |
void vga_putc | ( | int | c | ) |
Print the given character on the screen.
c | The character to print. |
void vga_puts | ( | const char * | str | ) |
Prints the given string on the screen.
str | The string to print. |
unsigned int vga_read_pixel | ( | int | x, |
int | y | ||
) |
Reads a pixel at the given position.
x | x-axis position. |
y | y-axis position. |
void vga_set_color | ( | unsigned int | color | ) |
Change the color.
color | the color to set. |
int vga_width | ( | void | ) |
Returns the width of the screen.