Ignore:
Timestamp:
Oct 26, 2006, 10:16:43 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Allow to create the initial canvas with a zero size. Either the application resizes it later, or the driver changes it to fit the display.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/cucul.c

    r1231 r1233  
    4444 *  should be called at the end of the program to free all allocated resources.
    4545 *
    46  *  If one of the desired canvas coordinates is zero, a default canvas size
    47  *  of 80x32 is used instead.
    48  *
    4946 *  If an error occurs, NULL is returned and \b errno is set accordingly:
    5047 *  - \c ENOMEM Not enough memory for the requested canvas size.
     
    5754{
    5855    cucul_canvas_t *cv = malloc(sizeof(cucul_canvas_t));
    59     int ret;
    6056
    6157    if(!cv)
     
    8985    cv->allattr[0] = NULL;
    9086
    91     /* Initialise to a default size. 80x32 is arbitrary but matches AAlib's
    92      * default X11 window. When a graphic driver attaches to us, it can set
    93      * a different size. */
    94     if(width && height)
    95         ret = _cucul_set_canvas_size(cv, width, height);
    96     else
    97         ret = _cucul_set_canvas_size(cv, 80, 32);
    98 
    99     if(ret < 0)
     87    if(_cucul_set_canvas_size(cv, width, height) < 0)
    10088    {
    10189#if defined(HAVE_ERRNO_H)
Note: See TracChangeset for help on using the changeset viewer.