VMUPro SDK v1.0.0
Application Development SDK for the VMUPro
Loading...
Searching...
No Matches
/home/runner/work/vmupro-sdk/vmupro-sdk/sdk/include/vmupro_display.h

Get the current global display brightness.

Get the current global display brightnessReturns the current brightness level of the display.

Returns
Current brightness level (0-100, where 0 is minimum and 100 is maximum)
Note
This is the system-wide brightness setting
Brightness affects the entire display output
// Check current brightness
int current_brightness = vmupro_get_global_brightness();
vmupro_log(VMUPRO_LOG_INFO, "DISPLAY", "Current brightness: %d%%", current_brightness);
int vmupro_get_global_brightness(void)
@ VMUPRO_LOG_INFO
Definition vmupro_log.h:33
void vmupro_log(vmupro_log_level_t level, const char *tag, const char *fmt,...)
Output a formatted log message.
#pragma once
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef enum
{
VMUPRO_COLOR_RED = 0x00f8,
VMUPRO_COLOR_GREEN = 0x0005,
VMUPRO_COLOR_BLUE = 0x5f04,
VMUPRO_COLOR_NAVY = 0x0c00,
VMUPRO_COLOR_GREY = 0xb6b5,
VMUPRO_COLOR_BLACK = 0x0000,
VMUPRO_COLOR_WHITE = 0xffff,
void vmupro_set_global_brightness(int brightness);
uint8_t *vmupro_get_front_fb();
uint8_t *vmupro_get_back_fb();
void vmupro_draw_rect(int x1, int y1, int x2, int y2, vmupro_color_t color);
void vmupro_draw_fill_rect(int x1, int y1, int x2, int y2, vmupro_color_t color);
void vmupro_blit_buffer_at(uint8_t *buffer, int x, int y, int width, int height);
void vmupro_blit_buffer_with_palette(uint8_t *buffer, int16_t *palette);
void vmupro_blit_buffer_transparent(uint8_t *buffer, int x, int y, int width, int height, vmupro_color_t transparent_color);
void vmupro_blit_buffer_blended(uint8_t *buffer, int x, int y, int width, int height, uint8_t alpha_level);
void vmupro_blit_buffer_dithered(uint8_t *buffer, int x, int y, int width, int height, int dither_strength);
void vmupro_blit_buffer_flip_h(uint8_t *buffer, int x, int y, int width, int height);
void vmupro_blit_buffer_flip_v(uint8_t *buffer, int x, int y, int width, int height);
void vmupro_blit_buffer_scaled(uint8_t* buffer, int buffer_width, int src_x, int src_y, int src_width, int src_height,
int dest_x, int dest_y, int dest_width, int dest_height);
void vmupro_blit_buffer_rotated_90(uint8_t* buffer, int x, int y, int width, int height, int rotation);
void vmupro_blit_buffer_rotated_precise(uint8_t* buffer, int x, int y, int width, int height, int rotation_degrees);
void vmupro_blit_tile_pattern(uint8_t *tile_buffer, int tile_width, int tile_height,
int dest_x, int dest_y, int dest_width, int dest_height);
void vmupro_blit_buffer_advanced(uint8_t *buffer, int buffer_width, int src_x, int src_y, int src_width, int src_height,
int dest_x, int dest_y, int dest_width, int dest_height,
int flip_h, int flip_v, int transparent_color);
void vmupro_draw_line(int x1, int y1, int x2, int y2, vmupro_color_t color);
void vmupro_draw_circle(int cx, int cy, int radius, vmupro_color_t color);
void vmupro_draw_circle_filled(int cx, int cy, int radius, vmupro_color_t color);
void vmupro_draw_ellipse(int cx, int cy, int rx, int ry, vmupro_color_t color);
void vmupro_draw_ellipse_filled(int cx, int cy, int rx, int ry, vmupro_color_t color);
void vmupro_draw_polygon(int *points, int num_points, vmupro_color_t color);
void vmupro_draw_polygon_filled(int *points, int num_points, vmupro_color_t color);
void vmupro_flood_fill(int x, int y, vmupro_color_t fill_color, vmupro_color_t boundary_color);
void vmupro_flood_fill_tolerance(int x, int y, vmupro_color_t fill_color, int tolerance);
// Background Scrolling Functions
void vmupro_blit_scrolling_background(uint8_t *bg_buffer, int bg_width, int bg_height,
int scroll_x, int scroll_y, int dest_width, int dest_height);
void vmupro_blit_infinite_scrolling_background(uint8_t *tile_buffer, int tile_width, int tile_height,
int scroll_x, int scroll_y, int dest_width, int dest_height);
void vmupro_blit_parallax_background(uint8_t *bg_buffer, int bg_width, int bg_height,
int scroll_x, int scroll_y, int parallax_factor_x, int parallax_factor_y);
void vmupro_blit_multi_parallax(uint8_t **bg_layers, int *layer_widths, int *layer_heights, int num_layers,
int *parallax_factors_x, int *parallax_factors_y, int scroll_x, int scroll_y);
void vmupro_blit_line_scroll_background(uint8_t *bg_buffer, int bg_width, int bg_height,
int *scroll_x_per_line, int *scroll_y_per_line);
void vmupro_blit_column_scroll_background(uint8_t *bg_buffer, int bg_width, int bg_height,
int *scroll_x_per_column, int *scroll_y_per_column);
// Visual Effects Functions
void vmupro_blit_buffer_mosaic(uint8_t *buffer, int x, int y, int width, int height, int mosaic_size);
void vmupro_blit_buffer_blurred(uint8_t *buffer, int x, int y, int width, int height, int blur_radius);
void vmupro_apply_mosaic_to_screen(int x, int y, int width, int height, int mosaic_size);
void vmupro_blit_buffer_shadow_highlight(uint8_t *buffer, int x, int y, int width, int height, int mode);
void vmupro_blit_buffer_color_multiply(uint8_t *buffer, int x, int y, int width, int height, vmupro_color_t color_filter);
void vmupro_blit_buffer_color_add(uint8_t *buffer, int x, int y, int width, int height, vmupro_color_t color_offset);
// Collision Detection Functions
int vmupro_sprite_collision_check(int sprite1_x, int sprite1_y, int sprite1_w, int sprite1_h,
int sprite2_x, int sprite2_y, int sprite2_w, int sprite2_h);
int vmupro_sprite_pixel_collision(uint8_t *sprite1, uint8_t *sprite2, int x1, int y1, int x2, int y2,
int width1, int height1, int width2, int height2);
// Enhanced Blending Functions
void vmupro_blit_buffer_fixed_alpha(uint8_t *buffer, int x, int y, int width, int height, int alpha_mode);
void vmupro_blend_layers_additive(uint8_t *layer1, uint8_t *layer2, int width, int height);
void vmupro_blend_layers_multiply(uint8_t *layer1, uint8_t *layer2, int width, int height);
void vmupro_blend_layers_screen(uint8_t *layer1, uint8_t *layer2, int width, int height);
// Windowing & Masking Functions
void vmupro_set_color_window(int x1, int y1, int x2, int y2, vmupro_color_t mask_color);
void vmupro_blit_buffer_masked(uint8_t *buffer, uint8_t *mask, int x, int y, int width, int height);
// Palette Operations
void vmupro_blit_buffer_palette_swap(uint8_t *buffer, int x, int y, int width, int height,
uint16_t *old_palette, uint16_t *new_palette, int palette_size);
void vmupro_animate_palette_range(uint16_t *palette, int start_index, int end_index, int shift_amount);
void vmupro_interpolate_palette(uint16_t *palette1, uint16_t *palette2, uint16_t *result, int size, int factor_256);
// Sprite System
typedef struct {
uint8_t *buffer;
int x, y;
int width, height;
int flip_h, flip_v;
uint8_t alpha;
vmupro_color_t transparent_color;
int priority;
void vmupro_sprite_batch_render(vmupro_sprite_t *sprites, int num_sprites);
// Multi-Layer System
#define VMUPRO_MAX_LAYERS 8
typedef struct {
bool active;
uint8_t *buffer;
int width, height;
int scroll_x, scroll_y;
int priority;
uint8_t alpha;
void vmupro_layer_create(int layer_id, int width, int height);
void vmupro_layer_destroy(int layer_id);
void vmupro_layer_set_scroll(int layer_id, int scroll_x, int scroll_y);
void vmupro_layer_set_priority(int layer_id, int priority);
void vmupro_layer_set_alpha(int layer_id, uint8_t alpha);
void vmupro_layer_blit_background(int layer_id, uint8_t *bg_buffer, int bg_width, int bg_height);
void vmupro_blit_tile(uint8_t *buffer, int x, int y, int src_x, int src_y, int width, int height, int tilemap_width);
// return whether the last buffer sent to the GPU was
// fb_side == 0, or fb_side == 1
// so we don't throw new frames at it before it finishes
#ifdef __cplusplus
}
#endif
Layer structure for multi-layer rendering.
Sprite structure for batch rendering.
void vmupro_set_global_brightness(int brightness)
uint8_t * vmupro_get_front_fb()
Get pointer to the front framebuffer.
void vmupro_blit_buffer_color_multiply(uint8_t *buffer, int x, int y, int width, int height, vmupro_color_t color_filter)
Apply color multiplication filter.
void vmupro_render_all_layers(void)
Render all active layers.
void vmupro_blit_buffer_masked(uint8_t *buffer, uint8_t *mask, int x, int y, int width, int height)
Blit buffer using mask.
void vmupro_animate_palette_range(uint16_t *palette, int start_index, int end_index, int shift_amount)
Animate palette color cycling.
void vmupro_layer_set_priority(int layer_id, int priority)
Set layer rendering priority.
void vmupro_draw_fill_rect(int x1, int y1, int x2, int y2, vmupro_color_t color)
Draw a filled rectangle.
void vmupro_blit_buffer_blended(uint8_t *buffer, int x, int y, int width, int height, uint8_t alpha_level)
Blit a buffer with alpha blending.
void vmupro_flood_fill(int x, int y, vmupro_color_t fill_color, vmupro_color_t boundary_color)
Flood fill an area with color.
void vmupro_blit_buffer_palette_swap(uint8_t *buffer, int x, int y, int width, int height, uint16_t *old_palette, uint16_t *new_palette, int palette_size)
Swap palette colors in buffer.
void vmupro_stop_double_buffer_renderer()
Stop the double buffer renderer.
void vmupro_blit_line_scroll_background(uint8_t *bg_buffer, int bg_width, int bg_height, int *scroll_x_per_line, int *scroll_y_per_line)
Blit background with per-line scrolling (Mega Drive style)
void vmupro_blit_tile_pattern(uint8_t *tile_buffer, int tile_width, int tile_height, int dest_x, int dest_y, int dest_width, int dest_height)
Blit a tiled pattern to fill an area.
void vmupro_interpolate_palette(uint16_t *palette1, uint16_t *palette2, uint16_t *result, int size, int factor_256)
Interpolate between two palettes.
void vmupro_blit_buffer_fixed_alpha(uint8_t *buffer, int x, int y, int width, int height, int alpha_mode)
Apply fixed alpha blending.
void vmupro_blit_multi_parallax(uint8_t **bg_layers, int *layer_widths, int *layer_heights, int num_layers, int *parallax_factors_x, int *parallax_factors_y, int scroll_x, int scroll_y)
Blit multiple parallax layers.
vmupro_color_t
Predefined color values for VMUPro display.
@ VMUPRO_COLOR_BLUE
@ VMUPRO_COLOR_RED
@ VMUPRO_COLOR_NAVY
@ VMUPRO_COLOR_ORANGE
@ VMUPRO_COLOR_GREY
@ VMUPRO_COLOR_VIOLET
@ VMUPRO_COLOR_YELLOW
@ VMUPRO_COLOR_WHITE
@ VMUPRO_COLOR_YELLOWGREEN
@ VMUPRO_COLOR_VMUINK
@ VMUPRO_COLOR_GREEN
@ VMUPRO_COLOR_MAGENTA
@ VMUPRO_COLOR_BLACK
@ VMUPRO_COLOR_VMUGREEN
int vmupro_sprite_pixel_collision(uint8_t *sprite1, uint8_t *sprite2, int x1, int y1, int x2, int y2, int width1, int height1, int width2, int height2)
Check pixel-perfect sprite collision.
void vmupro_blit_infinite_scrolling_background(uint8_t *tile_buffer, int tile_width, int tile_height, int scroll_x, int scroll_y, int dest_width, int dest_height)
Blit an infinitely scrolling tiled background.
void vmupro_blend_layers_additive(uint8_t *layer1, uint8_t *layer2, int width, int height)
Blend two layers additively.
uint8_t * vmupro_get_back_fb()
Get pointer to the back framebuffer.
void vmupro_blit_buffer_with_palette(uint8_t *buffer, int16_t *palette)
Blit a paletted buffer to the display.
void vmupro_pause_double_buffer_renderer()
Pause the double buffer renderer.
uint8_t vmupro_get_last_blitted_fb_side()
int vmupro_sprite_collision_check(int sprite1_x, int sprite1_y, int sprite1_w, int sprite1_h, int sprite2_x, int sprite2_y, int sprite2_w, int sprite2_h)
Check rectangular sprite collision.
void vmupro_blit_column_scroll_background(uint8_t *bg_buffer, int bg_width, int bg_height, int *scroll_x_per_column, int *scroll_y_per_column)
Blit background with per-column scrolling.
void vmupro_layer_destroy(int layer_id)
Destroy a layer.
void vmupro_display_clear(vmupro_color_t color)
Clear the display with a solid color.
void vmupro_blit_buffer_color_add(uint8_t *buffer, int x, int y, int width, int height, vmupro_color_t color_offset)
Apply color addition filter.
void vmupro_draw_polygon(int *points, int num_points, vmupro_color_t color)
Draw a polygon outline.
void vmupro_blit_buffer_flip_v(uint8_t *buffer, int x, int y, int width, int height)
Blit a buffer with vertical flipping.
void vmupro_resume_double_buffer_renderer()
Resume the double buffer renderer.
void vmupro_clear_color_window(void)
Clear the color window.
void vmupro_blit_buffer_shadow_highlight(uint8_t *buffer, int x, int y, int width, int height, int mode)
Apply shadow/highlight effect to buffer.
void vmupro_blend_layers_screen(uint8_t *layer1, uint8_t *layer2, int width, int height)
Blend two layers using screen mode.
void vmupro_blit_buffer_blurred(uint8_t *buffer, int x, int y, int width, int height, int blur_radius)
Apply blur effect to buffer.
void vmupro_display_refresh()
Refresh the display.
void vmupro_layer_blit_background(int layer_id, uint8_t *bg_buffer, int bg_width, int bg_height)
Blit background to layer.
void vmupro_start_double_buffer_renderer()
Start the double buffer renderer.
void vmupro_draw_ellipse_filled(int cx, int cy, int rx, int ry, vmupro_color_t color)
Draw a filled ellipse.
void vmupro_blit_scrolling_background(uint8_t *bg_buffer, int bg_width, int bg_height, int scroll_x, int scroll_y, int dest_width, int dest_height)
Blit a scrolling background.
void vmupro_blit_buffer_mosaic(uint8_t *buffer, int x, int y, int width, int height, int mosaic_size)
Apply mosaic effect to buffer.
void vmupro_blit_buffer_dithered(uint8_t *buffer, int x, int y, int width, int height, int dither_strength)
Blit a buffer with dithering effect.
void vmupro_blit_buffer_advanced(uint8_t *buffer, int buffer_width, int src_x, int src_y, int src_width, int src_height, int dest_x, int dest_y, int dest_width, int dest_height, int flip_h, int flip_v, int transparent_color)
Advanced blit with multiple effects combined.
void vmupro_blit_buffer_at(uint8_t *buffer, int x, int y, int width, int height)
Blit a buffer to the display at specified coordinates.
void vmupro_blit_buffer_transparent(uint8_t *buffer, int x, int y, int width, int height, vmupro_color_t transparent_color)
Blit a buffer with transparency support.
void vmupro_blit_buffer_flip_h(uint8_t *buffer, int x, int y, int width, int height)
Blit a buffer with horizontal flipping.
uint8_t * vmupro_get_back_buffer()
Get pointer to the back buffer.
void vmupro_blit_tile(uint8_t *buffer, int x, int y, int src_x, int src_y, int width, int height, int tilemap_width)
Blit a single tile from a tilemap/tileset.
void vmupro_apply_mosaic_to_screen(int x, int y, int width, int height, int mosaic_size)
Apply mosaic effect directly to screen.
void vmupro_push_double_buffer_frame()
Swap and display the current framebuffer.
void vmupro_layer_create(int layer_id, int width, int height)
Create a new layer.
void vmupro_draw_circle_filled(int cx, int cy, int radius, vmupro_color_t color)
Draw a filled circle.
void vmupro_layer_set_alpha(int layer_id, uint8_t alpha)
Set layer alpha transparency.
void vmupro_layer_set_scroll(int layer_id, int scroll_x, int scroll_y)
Set layer scroll position.
void vmupro_sprite_batch_render(vmupro_sprite_t *sprites, int num_sprites)
Render multiple sprites in priority order.
void vmupro_draw_rect(int x1, int y1, int x2, int y2, vmupro_color_t color)
Draw a rectangle outline.
void vmupro_blit_parallax_background(uint8_t *bg_buffer, int bg_width, int bg_height, int scroll_x, int scroll_y, int parallax_factor_x, int parallax_factor_y)
Blit background with parallax effect.
void vmupro_draw_circle(int cx, int cy, int radius, vmupro_color_t color)
Draw a circle outline.
void vmupro_blit_buffer_scaled(uint8_t *buffer, int buffer_width, int src_x, int src_y, int src_width, int src_height, int dest_x, int dest_y, int dest_width, int dest_height)
Blit a buffer with scaling support.
void vmupro_blit_buffer_rotated_90(uint8_t *buffer, int x, int y, int width, int height, int rotation)
Blit a buffer with 90-degree rotation increments.
void vmupro_set_color_window(int x1, int y1, int x2, int y2, vmupro_color_t mask_color)
Set a color window for masking.
void vmupro_draw_line(int x1, int y1, int x2, int y2, vmupro_color_t color)
Draw a line between two points.
void vmupro_draw_ellipse(int cx, int cy, int rx, int ry, vmupro_color_t color)
Draw an ellipse outline.
void vmupro_flood_fill_tolerance(int x, int y, vmupro_color_t fill_color, int tolerance)
Flood fill with color tolerance.
void vmupro_blend_layers_multiply(uint8_t *layer1, uint8_t *layer2, int width, int height)
Blend two layers multiplicatively.
void vmupro_draw_polygon_filled(int *points, int num_points, vmupro_color_t color)
Draw a filled polygon.
void vmupro_blit_buffer_rotated_precise(uint8_t *buffer, int x, int y, int width, int height, int rotation_degrees)
Blit a buffer with precise rotation (1-degree increments)