You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
593 B

  1. //
  2. // Deus Hax (working title)
  3. // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
  4. //
  5. #if HAVE_CONFIG_H
  6. # include "config.h"
  7. #endif
  8. #include <cstdlib>
  9. #include <cstdio>
  10. #include <caca.h>
  11. int main(void)
  12. {
  13. caca_canvas_t *cv = caca_create_canvas(16, 16);
  14. caca_set_color_ansi(cv, CACA_WHITE, CACA_TRANSPARENT);
  15. for (unsigned int n = 0; n < 256; n++)
  16. caca_put_char(cv, n % 16, n / 16, n);
  17. size_t len;
  18. void *buffer = caca_export_canvas_to_memory(cv, "tga", &len);
  19. fwrite(buffer, len, 1, stdout);
  20. free(buffer);
  21. caca_free_canvas(cv);
  22. return 0;
  23. }