Last change
on this file since 836 was
836,
checked in by Sam Hocevar, 17 years ago
|
- Oops, tutorial.dox was actually missing. Also, added a style.dox skeleton.
|
-
Property svn:keywords set to
Id
|
File size:
825 bytes
|
Line | |
---|
1 | /* $Id: tutorial.dox 836 2006-04-21 21:41:30Z sam $ */ |
---|
2 | |
---|
3 | /** \page tutorial A libcucul and libcaca tutorial |
---|
4 | |
---|
5 | Super short example: |
---|
6 | |
---|
7 | \code |
---|
8 | #include <cucul.h> |
---|
9 | #include <caca.h> |
---|
10 | |
---|
11 | int main(void) |
---|
12 | { |
---|
13 | /* Initialise libcaca */ |
---|
14 | cucul_canvas_t *cv; caca_display_t *dp; caca_event_t ev; |
---|
15 | cv = cucul_create_canvas(0, 0); |
---|
16 | dp = caca_create_display(cv); |
---|
17 | /* Set window title */ |
---|
18 | caca_set_display_title(dp, "Hello!"); |
---|
19 | /* Choose drawing colours */ |
---|
20 | cucul_set_color(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_WHITE); |
---|
21 | /* Draw a string at coordinates (0, 0) */ |
---|
22 | cucul_putstr(cv, 0, 0, "This is a message"); |
---|
23 | /* Refresh display */ |
---|
24 | caca_refresh_display(); |
---|
25 | /* Wait for a key press event */ |
---|
26 | caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1); |
---|
27 | /* Clean up library */ |
---|
28 | caca_free_display(dp); |
---|
29 | cucul_free_canvas(cv); |
---|
30 | |
---|
31 | return 0; |
---|
32 | } |
---|
33 | \endcode |
---|
34 | |
---|
35 | */ |
---|
Note: See
TracBrowser
for help on using the repository browser.