vtgl

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

Commit: df714e2b837723fe2fbb51c8d2e56a7c22d3b318
Parent: 137351243382fefabc0f9fa9124e0d24fd54ec6e
Author: Randy Palamar
Date:   Sun, 11 Aug 2024 11:40:44 -0600

draw a cursor

Diffstat:
Mvtgl.c | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/vtgl.c b/vtgl.c @@ -255,7 +255,7 @@ static void render_framebuffer(Term *t, RenderPushBuffer *rpb) { v2 cs = get_cell_size(t); - Rect cr = {.pos = { .y = t->gl.window_size.h - cs.h }, .size = cs}; + Rect cr = {.pos = {.y = t->gl.window_size.h - cs.h}, .size = cs}; for (u32 r = 0; r < t->size.h; r++) { for (u32 c = 0; c < t->size.w; c++) { @@ -265,6 +265,16 @@ render_framebuffer(Term *t, RenderPushBuffer *rpb) cr.pos.x = 0; cr.pos.y -= cs.h; } + + /* NOTE: draw cursor */ + /* TODO: hide cursor doesn't get reset properly */ + //if (!(t->gl.mode & WIN_MODE_HIDECURSOR)) { + Cell cursor = t->fb.rows[t->cursor.row][t->cursor.col]; + cr.pos.y = t->gl.window_size.h - cs.h * (t->cursor.row + 1); + cr.pos.x = t->cursor.col * cs.w; + cursor.style.attr ^= ATTR_INVERSE; + push_cell(rpb, &t->gl, cursor, cr, t->fa.deltay); + //} } /* NOTE: called when the window was resized */