|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Files | |
| file | vmu_fb.h |
| VMU framebuffer. | |
Data Structures | |
| struct | vmufb_t |
| Virtual framebuffer for the VMU. More... | |
| struct | vmufb_font_t |
| VMU framebuffer font meta-data. More... | |
Functions | |
| void | vmufb_paint_area (vmufb_t *fb, unsigned int x, unsigned int y, unsigned int w, unsigned int h, const char *data) |
| Render into the VMU framebuffer. | |
| void | vmufb_clear_area (vmufb_t *fb, unsigned int x, unsigned int y, unsigned int w, unsigned int h) |
| Clear a specific area of the VMU framebuffer. | |
| void | vmufb_clear (vmufb_t *fb) |
| Clear the VMU framebuffer. | |
| void | vmufb_paint_xbm (vmufb_t *fb, unsigned int x, unsigned int y, unsigned int w, unsigned int h, const uint8_t *xbm_data) |
| Render a XBM image into the VMU framebuffer. | |
| void | vmufb_present (const vmufb_t *fb, maple_device_t *dev) |
| Present the VMU framebuffer to a VMU. | |
| void | vmufb_print_string_into (vmufb_t *fb, const vmufb_font_t *font, unsigned int x, unsigned int y, unsigned int w, unsigned int h, unsigned int line_spacing, const char *str) |
| Render a string into the VMU framebuffer. | |
| static __inline__ void | vmufb_print_string (vmufb_t *fb, const vmufb_font_t *font, const char *str) |
| Render a string into the VMU framebuffer. | |
| void | vmu_printf (const char *fmt,...) __printflike(1 |
| Render a string to attached VMUs using the built-in font. | |
| void const vmufb_font_t * | vmu_set_font (const vmufb_font_t *font) |
| Sets the default font for drawing text to the VMU. | |
| const vmufb_font_t * | vmu_get_font (void) |
| Returns the default font used to draw text to the VMU. | |
| int | vmufb_screen_shot (vmufb_t *fb, const char *destfn) |
| Take a screenshot. | |
This API provides a virtual framebuffer abstraction for the VMU with a series of convenient methods for drawing complex and dynamic content.
| const vmufb_font_t * vmu_get_font | ( | void | ) |
Returns the default font used to draw text to the VMU.
| void vmu_printf | ( | const char * | fmt, |
| ... ) |
Render a string to attached VMUs using the built-in font.
Uses the built-in VMU font to render a string to all VMUs connected to the system.
| fmt | The format string, optionally followed by extra arguments. |
| void const vmufb_font_t * vmu_set_font | ( | const vmufb_font_t * | font | ) |
Sets the default font for drawing text to the VMU.
This function allows you to set a custom font for drawing text to the VMU screen. If the font parameter is set to NULL, the built-in VMU font will be used as the default.
font, so the given pointer must remain valid as long as it is set as the default!| font | Pointer to the font to set as default |
| void vmufb_clear | ( | vmufb_t * | fb | ) |
Clear the VMU framebuffer.
This function clears the whole VMU framebuffer.
| fb | A pointer to the vmufb_t to paint to. |
| void vmufb_clear_area | ( | vmufb_t * | fb, |
| unsigned int | x, | ||
| unsigned int | y, | ||
| unsigned int | w, | ||
| unsigned int | h ) |
Clear a specific area of the VMU framebuffer.
This function clears the area of the VMU framebuffer designated by the x, y, w and h values.
| fb | A pointer to the vmufb_t to paint to. |
| x | The horizontal position of the top-left corner of the drawing area, in pixels |
| y | The vertical position of the top-left corner of the drawing area, in pixels |
| w | The width of the drawing area, in pixels |
| h | The height of the drawing area, in pixels |
| void vmufb_paint_area | ( | vmufb_t * | fb, |
| unsigned int | x, | ||
| unsigned int | y, | ||
| unsigned int | w, | ||
| unsigned int | h, | ||
| const char * | data ) |
Render into the VMU framebuffer.
This function will paint the provided pixel data into the VMU framebuffer, into the rectangle provided by the x, y, w and h values.
| fb | A pointer to the vmufb_t to paint to. |
| x | The horizontal position of the top-left corner of the drawing area, in pixels |
| y | The vertical position of the top-left corner of the drawing area, in pixels |
| w | The width of the drawing area, in pixels |
| h | The height of the drawing area, in pixels |
| data | A pointer to the pixel data that will be painted into the drawing area. |
| void vmufb_paint_xbm | ( | vmufb_t * | fb, |
| unsigned int | x, | ||
| unsigned int | y, | ||
| unsigned int | w, | ||
| unsigned int | h, | ||
| const uint8_t * | xbm_data ) |
Render a XBM image into the VMU framebuffer.
This function will paint the provided XBM data into the VMU framebuffer, into the rectangle provided by the x, y, w and h values.
| fb | A pointer to the vmufb_t to paint to. |
| x | The horizontal position of the top-left corner of the drawing area, in pixels |
| y | The vertical position of the top-left corner of the drawing area, in pixels |
| w | The width of the drawing area, in pixels. It must correspond to the width of the XBM image. |
| h | The height of the drawing area, in pixels. It must correspond to the height of the XBM image. |
| xbm_data | A pointer to the pixel data in XBM format that will be painted |
| void vmufb_present | ( | const vmufb_t * | fb, |
| maple_device_t * | dev ) |
Present the VMU framebuffer to a VMU.
This function presents the previously rendered VMU framebuffer to the VMU identified by the dev argument.
| fb | A pointer to the vmufb_t to paint to. |
| dev | The maple device of the VMU to present to |
|
static |
Render a string into the VMU framebuffer.
Simplified version of vmufb_print_string_into(). This is the same as calling vmufb_print_string_into with x=0, y=0, w=48, h=32, line_spacing=0.
| fb | A pointer to the vmufb_t to paint to. |
| font | A pointer to the vmufb_font_t that will be used for painting the text (or NULL to use the default) |
| str | The text to render |
References VMU_SCREEN_HEIGHT, VMU_SCREEN_WIDTH, and vmufb_print_string_into().
| void vmufb_print_string_into | ( | vmufb_t * | fb, |
| const vmufb_font_t * | font, | ||
| unsigned int | x, | ||
| unsigned int | y, | ||
| unsigned int | w, | ||
| unsigned int | h, | ||
| unsigned int | line_spacing, | ||
| const char * | str ) |
Render a string into the VMU framebuffer.
This function uses the provided font to render text into the VMU framebuffer.
| fb | A pointer to the vmufb_t to paint to. |
| font | A pointer to the vmufb_font_t that will be used for painting the text (or NULL to use the default) |
| x | The horizontal position of the top-left corner of the drawing area, in pixels |
| y | The vertical position of the top-left corner of the drawing area, in pixels |
| w | The width of the drawing area, in pixels |
| h | The height of the drawing area, in pixels |
| line_spacing | Specify the number of empty lines that should separate two lines of text |
| str | The text to render |
Referenced by vmufb_print_string().