|
|
@@ -24,33 +24,41 @@ |
|
|
|
#include "cucul.h" |
|
|
|
|
|
|
|
#define STRING \ |
|
|
|
"Hello world!\n" \ |
|
|
|
" _,----._ \n" \ |
|
|
|
" (/ @ @ \\) \n" \ |
|
|
|
" | OO | \n" \ |
|
|
|
" \\ `--' / \n" \ |
|
|
|
" `----' \n" |
|
|
|
" `----' \n" \ |
|
|
|
"Hello world!\n" |
|
|
|
|
|
|
|
int main(int argc, char *argv[]) |
|
|
|
{ |
|
|
|
cucul_canvas_t *cv; |
|
|
|
cucul_canvas_t *cv, *pig; |
|
|
|
void *buffer; |
|
|
|
unsigned long int len; |
|
|
|
|
|
|
|
cv = cucul_create_canvas(0, 0); |
|
|
|
pig = cucul_create_canvas(0, 0); |
|
|
|
cucul_import_memory(pig, STRING, strlen(STRING), "text"); |
|
|
|
|
|
|
|
cucul_import_memory(cv, STRING, strlen(STRING), "text"); |
|
|
|
cv = cucul_create_canvas(cucul_get_canvas_width(pig) * 2, |
|
|
|
cucul_get_canvas_height(pig) * 2); |
|
|
|
|
|
|
|
buffer = cucul_export_memory(cv, "utf8", &len); |
|
|
|
fwrite(buffer, len, 1, stdout); |
|
|
|
free(buffer); |
|
|
|
|
|
|
|
cucul_rotate(cv); |
|
|
|
cucul_blit(cv, 0, 0, pig, NULL); |
|
|
|
cucul_flip(pig); |
|
|
|
cucul_blit(cv, cucul_get_canvas_width(pig), 0, pig, NULL); |
|
|
|
cucul_flip(pig); |
|
|
|
cucul_flop(pig); |
|
|
|
cucul_blit(cv, 0, cucul_get_canvas_height(pig), pig, NULL); |
|
|
|
cucul_flop(pig); |
|
|
|
cucul_rotate(pig); |
|
|
|
cucul_blit(cv, cucul_get_canvas_width(pig), |
|
|
|
cucul_get_canvas_height(pig), pig, NULL); |
|
|
|
|
|
|
|
buffer = cucul_export_memory(cv, "utf8", &len); |
|
|
|
fwrite(buffer, len, 1, stdout); |
|
|
|
free(buffer); |
|
|
|
|
|
|
|
cucul_free_canvas(pig); |
|
|
|
cucul_free_canvas(cv); |
|
|
|
|
|
|
|
return 0; |
|
|
|