diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2015-11-28 01:26:12 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2015-11-28 01:26:12 +0000 |
commit | a2ce2aebe3ee8b3f15a05f8760834a7dc1b8ccd6 (patch) | |
tree | c7cd714c80baed6eff2168d1f4dc60667c35dba1 | |
parent | 9086e6353212da91f4eb0a4efda361aa03850e42 (diff) | |
download | imv-a2ce2aebe3ee8b3f15a05f8760834a7dc1b8ccd6.tar.gz |
Reintroduce text overlay
-rw-r--r-- | src/main.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -388,6 +388,23 @@ int main(int argc, char** argv) nav.cur_path + 1, nav.num_paths, tex.width, tex.height, current_path); imv_viewport_set_title(&view, title); + + if(overlay_surf) { + free(overlay_surf); + overlay_surf = NULL; + } + if(overlay_tex) { + SDL_DestroyTexture(overlay_tex); + overlay_tex = NULL; + } + if(font) { + snprintf(&title[0], sizeof(title), "[%i/%i] %s", + nav.cur_path + 1, nav.num_paths, current_path); + SDL_Color w = {255,255,255,255}; + overlay_surf = TTF_RenderUTF8_Blended(font, &title[0], w); + overlay_tex = SDL_CreateTextureFromSurface(renderer, overlay_surf); + } + imv_viewport_scale_to_window(&view, &tex); if(g_options.actual) { imv_viewport_scale_to_actual(&view, &tex); |