KallistiOS git master
Independent SDK for the Sega Dreamcast
|
API for framebuffer management More...
Functions | |
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. | |
void | vid_empty (void) |
Clear VRAM. | |
int | vid_screen_shot (const char *destfn) |
Take a screenshot. | |
size_t | vid_screen_shot_data (uint8_t **buffer) |
Create image data from the current framebuffer. | |
Variables | |
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
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.
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). |
void vid_empty | ( | void | ) |
Clear VRAM.
This function is essentially a memset() for the whole of VRAM that will clear it all to 0 bytes.
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.
fb | The framebuffer to display or any other value to display the next one. |
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.
fb | The number of the framebuffer or -1 for current. |
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.
destfn | The filename to save to. |
size_t vid_screen_shot_data | ( | uint8_t ** | buffer | ) |
Create image data from the current framebuffer.
This function takes the current framebuffer (/vram_l) and converts it into 24bpp image data. The function allocates memory for the image data, which the caller is responsible for freeing.
buffer | A pointer to a uint8_t* that will be allocated and filled with the image data. |
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.
fb | The framebuffer to display or any other value to display the next one. |
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.
base | The offset within VRAM to set the base to. |
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.
base | The offset within VRAM to set the base to. |
|
extern |
32-bit size pointer to the current drawing area.
|
extern |
16-bit size pointer to the current drawing area.