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.
 
 
 
 
 
 

36 lines
827 B

  1. /* $Id$ */
  2. /** \page tutorial A libcucul and libcaca tutorial
  3. Super short example:
  4. \code
  5. #include <cucul.h>
  6. #include <caca.h>
  7. int main(void)
  8. {
  9. /* Initialise libcaca */
  10. cucul_canvas_t *cv; caca_display_t *dp; caca_event_t ev;
  11. cv = cucul_create_canvas(0, 0);
  12. dp = caca_create_display(cv);
  13. /* Set window title */
  14. caca_set_display_title(dp, "Hello!");
  15. /* Choose drawing colours */
  16. cucul_set_color(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_WHITE);
  17. /* Draw a string at coordinates (0, 0) */
  18. cucul_putstr(cv, 0, 0, "This is a message");
  19. /* Refresh display */
  20. caca_refresh_display(dp);
  21. /* Wait for a key press event */
  22. caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);
  23. /* Clean up library */
  24. caca_free_display(dp);
  25. cucul_free_canvas(cv);
  26. return 0;
  27. }
  28. \endcode
  29. */