aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrNuget <drnuget@outlook.com>2025-11-02 03:47:12 +0200
committerDrNuget <drnuget@outlook.com>2025-11-02 03:47:12 +0200
commitab4cb5e7a4946d951b7445af165531ad7c029d88 (patch)
treef4ea500b580145a2d6a2089ba4c369966ac9b0c8
parent2ce5ebc536eebce92614f930a1150a30f51e3f92 (diff)
downloadbrailleboi-ab4cb5e7a4946d951b7445af165531ad7c029d88.tar.gz
add escape sequences for cursor hiding, clearing screen when doing screen update
-rw-r--r--src/brailleboi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/brailleboi.c b/src/brailleboi.c
index d1f14c6..53f7a01 100644
--- a/src/brailleboi.c
+++ b/src/brailleboi.c
@@ -8,6 +8,7 @@
int brailleInit(int width, int height, image_buffer* buf)
{
setlocale(LC_ALL, "");
+ wprintf(L"\e[?25l");
buf->width = width;
buf->height = height;
buf->char_width = (width+1)/2;
@@ -18,6 +19,7 @@ int brailleInit(int width, int height, image_buffer* buf)
int brailleStop(image_buffer* buf)
{
+ wprintf(L"\e[?25h");
free(buf->contents);
return 0;
}
@@ -47,6 +49,7 @@ int braillePlot(int x, int y, image_buffer* buf)
void brailleUpdateScreen(image_buffer* buf)
{
+ wprintf(L"\e[2J");
for (int x=0;x<buf->char_width;x++) {
for (int y=0;y<buf->char_height;y++) {
wprintf(L"\e[%d;%dH", y+1, x+1);