Last change
on this file since 1661 was
1490,
checked in by sam, 11 years ago
|
build: import new libcaca binaries (from r4822) so that we no longer need
to provide sprintf_s and others when building with mingw32.
|
-
Property svn:keywords set to
Id
|
File size:
601 bytes
|
Line | |
---|
1 | // |
---|
2 | // Deus Hax (working title) |
---|
3 | // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> |
---|
4 | // |
---|
5 | |
---|
6 | #if defined HAVE_CONFIG_H |
---|
7 | # include "config.h" |
---|
8 | #endif |
---|
9 | |
---|
10 | #include <cstdlib> |
---|
11 | #include <cstdio> |
---|
12 | |
---|
13 | #include <caca.h> |
---|
14 | |
---|
15 | int main(void) |
---|
16 | { |
---|
17 | caca_canvas_t *cv = caca_create_canvas(16, 16); |
---|
18 | caca_set_color_ansi(cv, CACA_WHITE, CACA_TRANSPARENT); |
---|
19 | |
---|
20 | for (unsigned int n = 0; n < 256; n++) |
---|
21 | caca_put_char(cv, n % 16, n / 16, n); |
---|
22 | |
---|
23 | size_t len; |
---|
24 | void *buffer = caca_export_canvas_to_memory(cv, "tga", &len); |
---|
25 | fwrite(buffer, len, 1, stdout); |
---|
26 | free(buffer); |
---|
27 | |
---|
28 | caca_free_canvas(cv); |
---|
29 | |
---|
30 | return 0; |
---|
31 | } |
---|
32 | |
---|
Note: See
TracBrowser
for help on using the repository browser.