API for framebuffer management.
More...
|
void | vid_set_vram (uint32_t base) |
| Set the VRAM convenience pointers.
|
|
void | vid_set_start (uint32_t base) |
| Set the VRAM base of the framebuffer.
|
|
uint32_t | vid_get_start (int32_t fb) |
| Get the VRAM base of a framebuffer.
|
|
void | vid_set_fb (int32_t fb) |
| Set the current framebuffer in a multibuffered setup.
|
|
void | vid_flip (int32_t fb) |
| Flip to a framebuffer in a multibuffered setup.
|
|
void | vid_clear (uint8_t r, uint8_t g, uint8_t b) |
| Clear the framebuffer.
|
|
int | vid_screen_shot (const char *destfn) |
| Take a screenshot.
|
|
|
uint16_t * | vram_s |
| 16-bit size pointer to the current drawing area.
|
|
uint32_t * | vram_l |
| 32-bit size pointer to the current drawing area.
|
|
API for framebuffer management.
◆ vid_clear()
void vid_clear |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b |
|
) |
| |
Clear the framebuffer.
This function sets the whole framebuffer to the specified color. Internally, this uses the store queues to actually clear the display entirely.
- Note
- This operates via the vram convenience pointers. In multibuffered mode, by default it will clear the framebuffer you are currently writing to rather than the one being displayed.
- Parameters
-
r | The red value of the color (0-255). |
g | The green value of the color (0-255). |
b | The blue value of the color (0-255). |
◆ vid_flip()
void vid_flip |
( |
int32_t |
fb | ) |
|
Flip to a framebuffer in a multibuffered setup.
This function sets the displayed framebuffer to the specified buffer and sets the vram_s and vram_l pointers to point at the next framebuffer, to allow for tearing-free framebuffer-direct drawing.
- Parameters
-
fb | The framebuffer to display or any other value to display the next one. |
◆ vid_get_start()
uint32_t vid_get_start |
( |
int32_t |
fb | ) |
|
Get the VRAM base of a framebuffer.
This function gets the position of the specified framebuffer within VRAM. Any invalid fb value will be treated as the current framebuffer.
- Parameters
-
fb | The number of the framebuffer or -1 for current. |
◆ vid_screen_shot()
int vid_screen_shot |
( |
const char * |
destfn | ) |
|
Take a screenshot.
This function takes the current framebuffer (/vram_l) and dumps it out to a PPM file.
- Parameters
-
destfn | The filename to save to. |
- Returns
- 0 on success, <0 on failure.
◆ vid_set_fb()
void vid_set_fb |
( |
int32_t |
fb | ) |
|
Set the current framebuffer in a multibuffered setup.
This function sets the displayed framebuffer to the specified buffer. Unlike vid_set_fb, this does not point the vram pointers to the next framebuffer, allowing for non-linear management of the FBs.
- Parameters
-
fb | The framebuffer to display or any other value to display the next one. |
◆ vid_set_start()
void vid_set_start |
( |
uint32_t |
base | ) |
|
Set the VRAM base of the framebuffer.
This function sets the vram_s and vram_l pointers to specified offset within VRAM and sets the start position of the framebuffer to the same offset.
- Parameters
-
base | The offset within VRAM to set the base to. |
◆ vid_set_vram()
void vid_set_vram |
( |
uint32_t |
base | ) |
|
Set the VRAM convenience pointers.
This function sets the vram_s and vram_l pointers to specified offset within VRAM. In multibuffered mode it allows manual management of them.
- Parameters
-
base | The offset within VRAM to set the base to. |
◆ vram_l
32-bit size pointer to the current drawing area.
◆ vram_s
16-bit size pointer to the current drawing area.