vtgl

terminal emulator implemented in OpenGL
git clone anongit@rnpnr.xyz:vtgl.git
Log | Files | Refs | Feed | LICENSE

Commit: 62abcc3db668320844d3128d653fb5a7bf9c10a2
Parent: 965a04d8039e9152ed57c2f11f1881b570105b8e
Author: Randy Palamar
Date:   Wed, 24 Jul 2024 07:53:10 -0600

fix resizing which was broken in last commit

Diffstat:
Mutil.h | 1+
Mvtgl.c | 9+++++++++
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/util.h b/util.h @@ -166,6 +166,7 @@ typedef struct { enum gl_flags { NEEDS_RESIZE = 1 << 0, + NEEDS_FULL_BLIT = 1 << 1, UPDATE_RENDER_UNIFORMS = 1 << 29, UPDATE_POST_UNIFORMS = 1 << 30, }; diff --git a/vtgl.c b/vtgl.c @@ -59,6 +59,7 @@ resize(Term *t) os_alloc_framebuffer(&t->fb, t->size.h, t->size.w); os_set_term_size(t->child, t->size.h, t->size.w, ws.w, ws.h); t->gl.flags &= ~NEEDS_RESIZE; + t->gl.flags |= NEEDS_FULL_BLIT; } static void @@ -388,6 +389,14 @@ do_terminal(Term *t, Arena a) RenderPushBuffer *rpb = alloc(&a, RenderPushBuffer, 1); + /* NOTE: this could cause extra work if there is new data and we need a full + * blit on the same frame but for now we will ignore that */ + if (t->gl.flags & NEEDS_FULL_BLIT) { + t->gl.flags &= ~NEEDS_FULL_BLIT; + term_reset(t); + blit_lines(t, a, MIN(t->log_lines.filled, t->size.h - 1)); + } + if (os_child_data_available(t->child)) { if (os_child_exited(t->child)) { /* TODO: is there a reason to not immediately exit? */