aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2015-11-28 01:26:12 +0000
committerHarry Jeffery <harry@exec64.co.uk>2015-11-28 01:26:12 +0000
commita2ce2aebe3ee8b3f15a05f8760834a7dc1b8ccd6 (patch)
treec7cd714c80baed6eff2168d1f4dc60667c35dba1 /src/main.c
parent9086e6353212da91f4eb0a4efda361aa03850e42 (diff)
downloadimv-a2ce2aebe3ee8b3f15a05f8760834a7dc1b8ccd6.tar.gz
Reintroduce text overlay
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 17 insertions, 0 deletions
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);