#include #include #include #include int main (int argc, char *argv[]) { struct tart_window window = tart_create_window(); struct tart_buffer mainbuff = tart_create_buffer(109, {40,20},{20,20}); struct tart_cell* cells = (struct tart_cell*)malloc(mainbuff.cell_count * sizeof(struct tart_cell)); for(int i = 1; i < mainbuff.cell_count; i += 2) { cells[i] = tart_create_cell('^', TART_STYLE_BLINKING, TART_COLOR_BLACK_FOREGROUND, TART_COLOR_WHITE_BACKGROUND); } for(int i = 0; i < + mainbuff.cell_count; i += 2) { cells[i] = tart_create_cell('^', TART_STYLE_BLINKING, TART_COLOR_RED_FOREGROUND, TART_COLOR_BLACK_BACKGROUND); } tart_add_cells_to_buffer(&mainbuff, cells); struct tart_vec2 positions[4] = {{0,0},{0,1},{1,0},{1,1}}; struct tart_cell cell = tart_create_cell('0', TART_STYLE_BLINKING, TART_COLOR_RED_FOREGROUND, TART_COLOR_GREEN_BACKGROUND); struct tart_cell cellss[4] = {cell,cell,cell,cell}; struct tart_csprite sprite = tart_csprite(cellss,positions,4); tart_draw_csprite_position(&mainbuff, sprite, {2,2}); tart_draw_csprite_position(&mainbuff, sprite, {5,2}); tart_draw_csprite_position(&mainbuff, sprite, {5,5}); tart_draw_csprite_position(&mainbuff, sprite, {39,18}); float x = 0; tart_byte layer = tart_add_buffer(&window, mainbuff); char t[1] = {'0'}; struct tart_vec2 p = {0,0}; term_disable_cursor(); term_threaded_input_init(); for(;;) { // printf("\033[H"); // struct tart_buffer* buf = tart_get_buffer(&window, 0); // tart_draw_csprite_position(buf, sprite, {3,18}); // tart_draw_csprite_position(buf, sprite, p); // //tart_draw_window(&window, t); // tart_restore_window(&window); // tart_restore_buffer(buf); // if(term_tinput() == 's') { // x += 0.01; // } if(term_tinput() == 'q') { term_threaded_input_stop(); break; } // p.x = (int)x; } term_disable_cursor(); term_enable_cursor(); //term_getche(); term_threaded_input_stop(); return 0; }