From a2ce2aebe3ee8b3f15a05f8760834a7dc1b8ccd6 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Sat, 28 Nov 2015 01:26:12 +0000 Subject: Reintroduce text overlay --- src/main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 19f651d..e9e0b6c 100644 --- a/src/main.c +++ b/src/main.c @@ -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); -- cgit v1.2.3