diff options
| author | lvntky <klevent1903@gmail.com> | 2024-11-21 19:01:50 +0300 |
|---|---|---|
| committer | lvntky <klevent1903@gmail.com> | 2024-11-21 19:01:50 +0300 |
| commit | 0fa46770ba044b95dd8c253b7d1e12ca324e1556 (patch) | |
| tree | b56d59eadc21da9293219b8e250371c8994d0777 /example/empty_example.c | |
| parent | 95aa33f584b026ecbf1a515086f04a727bb0ae57 (diff) | |
[feature] basic rendering
Diffstat (limited to 'example/empty_example.c')
| -rw-r--r-- | example/empty_example.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/example/empty_example.c b/example/empty_example.c index 81f9c04..85aa2eb 100644 --- a/example/empty_example.c +++ b/example/empty_example.c @@ -1,19 +1,33 @@ #define FBGL_IMPLEMENTATION +//#define FBGL_HIDE_CURSOR #include "../fbgl.h" #include <stdio.h> +#include <stddef.h> int main() { printf("version %s\n", fbgl_version_info()); printf("name %s\n", fbgl_name_info()); fbgl_t buffer; - if( fbgl_init("/dev/fb0", &buffer) == -1) { - fprintf(stdout, "error could not oppen fb device"); - return -1; + if (fbgl_init("/dev/fb0", &buffer) == -1) { + fprintf(stdout, "error could not oppen fb device"); + return -1; } fbgl_set_bg(&buffer, 0xFF0000); - while(1){} + + for (size_t i = 0; i < 100; ++i) { + for (size_t j = 0; j < 100; ++j) { + fbgl_put_pixel(i, j, 0x00FFFF, &buffer); + } + } + int l = 0; + while (1) { + if(fbgl_check_esc_key()) { + fprintf(stdout, "esc pressed", fbgl_check_esc_key()); + + } + } return 0; } |
