diff options
| author | DrNuget <drnuget@outlook.com> | 2025-11-02 15:24:16 +0200 |
|---|---|---|
| committer | DrNuget <drnuget@outlook.com> | 2025-11-02 15:24:16 +0200 |
| commit | da2c159e7f249091933659babaae9eb6fe8adc89 (patch) | |
| tree | 7b7ab1b35fb32868f4a1bb40f3e4fc7542d1a099 | |
| parent | 35b58a4123c0533d183aee0a7056044fd9ed52fe (diff) | |
| download | brailleboi-67b5aeab0231aee38d99ff309e5e549133910fd9.tar.gz | |
add image buffer clearingv0.2.0
| -rw-r--r-- | src/brailleboi.c | 6 | ||||
| -rw-r--r-- | src/brailleboi.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/brailleboi.c b/src/brailleboi.c index 83cb1bf..d7f3e67 100644 --- a/src/brailleboi.c +++ b/src/brailleboi.c @@ -2,6 +2,7 @@ #include <stdio.h> #include <wchar.h> #include <locale.h> +#include <string.h> #include "brailleboi.h" @@ -47,6 +48,11 @@ int braillePlot(int x, int y, image_buffer* buf) return 0; } +void brailleClearBuffer(image_buffer* buf) +{ + memset(buf->contents, 0, (buf->char_width * buf->char_height) * sizeof(int)); +} + void brailleUpdateScreen(image_buffer* buf) { wprintf(L"\033[2J"); diff --git a/src/brailleboi.h b/src/brailleboi.h index f06d0da..26ada93 100644 --- a/src/brailleboi.h +++ b/src/brailleboi.h @@ -17,6 +17,8 @@ void braillePrint(int data); int braillePlot(int x, int y, image_buffer* buf); +void brailleClearBuffer(image_buffer* buf); + void brailleUpdateScreen(image_buffer* buf); #endif |
