Ignore:
Timestamp:
Sep 27, 2008, 3:12:46 PM (11 years ago)
Author:
Sam Hocevar
Message:

Starting refactoring to get rid of libcucul. The initial reason for the
split is rendered moot by the plugin system: when enabled, binaries do
not link directly with libX11 or libGL. I hope this is a step towards
more consisteny and clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/examples/frames.c

    r2299 r2821  
    1919#endif
    2020
    21 #include "cucul.h"
    2221#include "caca.h"
    2322
    2423int main(int argc, char *argv[])
    2524{
    26     cucul_canvas_t *cv;
     25    caca_canvas_t *cv;
    2726    caca_display_t *dp;
    2827
     
    3029
    3130    /* Create a canvas with 200 frames */
    32     cv = cucul_create_canvas(0, 0);
     31    cv = caca_create_canvas(0, 0);
    3332    if(cv == NULL)
    3433    {
     
    3837
    3938    for(frame = 1; frame < 200; frame++)
    40         cucul_create_frame(cv, frame);
     39        caca_create_frame(cv, frame);
    4140
    4241    fprintf(stderr, "canvas created, size is %ix%i\n",
    43             cucul_get_canvas_width(cv), cucul_get_canvas_height(cv));
     42            caca_get_canvas_width(cv), caca_get_canvas_height(cv));
    4443
    4544    /* Resize it to 150 x 80 (around 19MB) */
    46     cucul_set_canvas_size(cv, 150, 80);
     45    caca_set_canvas_size(cv, 150, 80);
    4746
    4847    fprintf(stderr, "canvas expanded, size is %ix%i\n",
    49             cucul_get_canvas_width(cv), cucul_get_canvas_height(cv));
     48            caca_get_canvas_width(cv), caca_get_canvas_height(cv));
    5049
    5150    /* Fill the first 16 frames with a different colour */
    5251    for(frame = 0; frame < 16; frame++)
    5352    {
    54         cucul_set_frame(cv, frame);
    55         cucul_set_color_ansi(cv, CUCUL_WHITE, frame);
    56         cucul_fill_box(cv, 0, 0, 40, 15, ':');
    57         cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE);
    58         cucul_put_str(cv, frame * 5 / 2, frame, "カカ");
    59         cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT);
     53        caca_set_frame(cv, frame);
     54        caca_set_color_ansi(cv, CACA_WHITE, frame);
     55        caca_fill_box(cv, 0, 0, 40, 15, ':');
     56        caca_set_color_ansi(cv, CACA_WHITE, CACA_BLUE);
     57        caca_put_str(cv, frame * 5 / 2, frame, "カカ");
     58        caca_set_color_ansi(cv, CACA_DEFAULT, CACA_TRANSPARENT);
    6059    }
    6160
    6261    /* Resize it to a more decent size */
    63     cucul_set_canvas_size(cv, 41, 16);
     62    caca_set_canvas_size(cv, 41, 16);
    6463
    6564    fprintf(stderr, "canvas shrinked, size is %ix%i\n",
    66             cucul_get_canvas_width(cv), cucul_get_canvas_height(cv));
     65            caca_get_canvas_width(cv), caca_get_canvas_height(cv));
    6766
    6867    dp = caca_create_display(cv);
     
    7069
    7170    fprintf(stderr, "display attached, size is %ix%i\n",
    72             cucul_get_canvas_width(cv), cucul_get_canvas_height(cv));
     71            caca_get_canvas_width(cv), caca_get_canvas_height(cv));
    7372
    7473    n = 0;
    7574    while(!caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, 0))
    7675    {
    77         cucul_set_frame(cv, n % 16);
     76        caca_set_frame(cv, n % 16);
    7877        caca_refresh_display(dp);
    7978        n++;
     
    8483    /* It is possible, though not necessary, to free all additional frames
    8584     * separately. */
    86     cucul_free_canvas(cv);
     85    caca_free_canvas(cv);
    8786
    8887    return 0;
Note: See TracChangeset for help on using the changeset viewer.