Ignore:
Timestamp:
Sep 27, 2008, 3:12:46 PM (12 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/spritedit.c

    r2313 r2821  
    2121#endif
    2222
    23 #include "cucul.h"
    2423#include "caca.h"
    2524
     
    4948int main(int argc, char **argv)
    5049{
    51     cucul_canvas_t *sprite;
     50    caca_canvas_t *sprite;
    5251    size_t len;
    5352    void *buffer;
     
    5554
    5655    /* Create a canvas with 4 frames */
    57     sprite = cucul_create_canvas(0, 0);
     56    sprite = caca_create_canvas(0, 0);
    5857    for(i = 0; i < 3; i++)
    59         cucul_create_frame(sprite, 0);
     58        caca_create_frame(sprite, 0);
    6059
    6160    /* Load stuff in all 4 frames */
    6261    for(i = 0; i < 4; i++)
    6362    {
    64         cucul_set_frame(sprite, i);
    65         cucul_import_memory(sprite, guy[i], strlen(guy[i]), "utf8");
     63        caca_set_frame(sprite, i);
     64        caca_import_memory(sprite, guy[i], strlen(guy[i]), "utf8");
    6665    }
    6766
    6867    /* Export our sprite in a memory buffer. We could save this to
    6968     * disk afterwards. */
    70     buffer = cucul_export_memory(sprite, "caca", &len);
     69    buffer = caca_export_memory(sprite, "caca", &len);
    7170
    7271    /* Free our sprite and reload it from the memory buffer. We could
    7372     * load this from disk, too. */
    74     cucul_free_canvas(sprite);
    75     sprite = cucul_create_canvas(0, 0);
    76     cucul_import_memory(sprite, buffer, len, "caca");
     73    caca_free_canvas(sprite);
     74    sprite = caca_create_canvas(0, 0);
     75    caca_import_memory(sprite, buffer, len, "caca");
    7776    free(buffer);
    7877
     
    8079    for(i = 0; i < 4; i++)
    8180    {
    82         cucul_set_frame(sprite, i);
     81        caca_set_frame(sprite, i);
    8382        printf("Frame #%i\n", i);
    84         buffer = cucul_export_memory(sprite, "utf8", &len);
     83        buffer = caca_export_memory(sprite, "utf8", &len);
    8584        fwrite(buffer, len, 1, stdout);
    8685        free(buffer);
     
    8887
    8988    /* Free our sprite */
    90     cucul_free_canvas(sprite);
     89    caca_free_canvas(sprite);
    9190
    9291    return 0;
Note: See TracChangeset for help on using the changeset viewer.