#include #include #include #include #include "framebuffer.h" int main(void) { setlocale(LC_ALL,""); term_init(); fprintf(stderr, "%zux%zu\n", term_width, term_height); Framebuffer fb = fb_new(term_width, term_height); fb_fill(fb, P_RED); char c; const float k_x = 0.1; const float k_t = 0.1; size_t t = 0; while(1) { fb_fill(fb, P_RED); /* Sine wave */ for (size_t x = 0; x < term_width; x++) { size_t y = ((sin(k_x * x + k_t * t) + 1.0) / 2 * term_height / 2) + (size_t)(term_height / 4); fb.fb[y][x] = P_CYAN; } fb_print(fb); if (get_input(c) != 0 && c == 'q') { break; }; t++; } fb_free(&fb); term_cleanup(); }