Add hw acceleration, improve video performance

This commit is contained in:
markmental 2026-03-27 23:19:42 -04:00
commit 7c5d82e124
13 changed files with 273 additions and 72 deletions

View file

@ -14,18 +14,56 @@ typedef struct UiFonts {
TTF_Font *large;
} UiFonts;
typedef struct UiTextTexture {
SDL_Texture *texture;
int width;
int height;
} UiTextTexture;
typedef struct UiChannelCache {
UiTextTexture name_medium;
UiTextTexture number_medium;
UiTextTexture file_small;
UiTextTexture program_small_light;
UiTextTexture program_medium_dark;
UiTextTexture detail_small_dark;
} UiChannelCache;
typedef struct UiCache {
SDL_Renderer *renderer;
UiTextTexture no_media_title;
UiTextTexture no_media_body;
UiTextTexture no_media_hint;
UiTextTexture timeline_day;
UiTextTexture footer_a;
UiTextTexture footer_time;
UiTextTexture footer_b;
UiTextTexture footer_theme;
UiTextTexture footer_c;
UiTextTexture footer_title;
UiTextTexture preview_badge;
UiTextTexture *timeline_labels;
time_t timeline_label_slot;
UiChannelCache *channels;
int channel_count;
} UiCache;
void ui_render_fullscreen(SDL_Renderer *renderer, SDL_Texture *video_texture, int texture_width, int texture_height);
void ui_render_guide(SDL_Renderer *renderer,
SDL_Texture *video_texture,
int texture_width,
int texture_height,
const UiFonts *fonts,
UiCache *cache,
const ChannelList *channels,
int active_channel,
time_t app_start_time,
time_t now);
void ui_render_no_media(SDL_Renderer *renderer, const UiFonts *fonts);
Uint64 app_start_ticks,
Uint64 now_ticks,
time_t now_wall);
void ui_render_no_media(SDL_Renderer *renderer, const UiCache *cache);
int ui_load_fonts(UiFonts *fonts);
void ui_destroy_fonts(UiFonts *fonts);
int ui_cache_init(UiCache *cache, SDL_Renderer *renderer, const UiFonts *fonts, const ChannelList *channels);
void ui_cache_destroy(UiCache *cache);
#endif