Ignore:
Timestamp:
Sep 19, 2006, 10:18:32 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Optimised memory usage in the GL driver and added a few comments.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver_gl.c

    r1063 r1064  
    496496    int i, b, w, h, x, y;
    497497
     498    /* Count how many glyphs this font has */
    498499    dp->drv.p->blocks = cucul_get_font_blocks(dp->drv.p->f);
    499500
     
    501502        b += dp->drv.p->blocks[i + 1] - dp->drv.p->blocks[i];
    502503
    503     dp->drv.p->txid = malloc(b * sizeof(int));
     504    /* Allocate a libcucul canvas and print all the glyphs on it */
    504505    cv = cucul_create_canvas(1, b);
    505506    cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     
    515516    }
    516517
     518    /* Draw the cucul canvas onto an image buffer */
    517519    image = malloc(b * dp->drv.p->font_height
    518520                     * dp->drv.p->font_width * sizeof(uint32_t));
     
    520522                        b * dp->drv.p->font_height, 4 * dp->drv.p->font_width);
    521523    cucul_free_canvas(cv);
     524
     525    /* Convert all glyphs in the image buffer to GL textures */
     526    dp->drv.p->txid = malloc(b * sizeof(int));
    522527
    523528    w = dp->drv.p->font_width <= 16 ? dp->drv.p->font_width : 16;
Note: See TracChangeset for help on using the changeset viewer.