Drawing to the frame buffer. More...
Go to the source code of this file.
Functions | |
| int | hal_init (void) |
| Initialize the frame buffer. | |
| void | hal_putpixel (uint32_t x, uint32_t y, color_t color) |
| Draw a pixel to the screen. | |
| void | hal_fillrect (uint32_t x, uint32_t y, uint32_t w, uint32_t h, color_t color) |
| Draw a rectangle to the screen. | |
| uint64_t | hal_width (void) |
| Get screen width. | |
| uint64_t | hal_height (void) |
| Get screen height. | |
Drawing to the frame buffer.
The HAL (hardware abstraction layer) generally provides a way for other parts of the OS to interact with low-lever hardware functions without needing to know details specific to a particular platform.
In this case, the HAL provides a generatic way to draw pixels to the screen.
Draw a rectangle to the screen.
| x | Pixels from left edge of screen to left edge of rectangle |
| y | Pixels from top edge of screen to top edge of rectangle |
| w | Width of rectangle in pixels |
| h | Height of rectangle in pixels |
| color | Color value to set all pixels within the rectangle to |
| uint64_t hal_height | ( | void | ) |
Get screen height.
| int hal_init | ( | void | ) |
Initialize the frame buffer.
This should be called before any other function in this header, otherwise the behavior is undefined.
Draw a pixel to the screen.
| x | Pixels from left edge |
| y | Pixels from top edge |
| color | Color value to set the pixel to |
| uint64_t hal_width | ( | void | ) |
Get screen width.