Ignore:
Timestamp:
Oct 26, 2006, 10:16:43 AM (13 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.
Location:
libcaca/trunk/caca
Files:
4 edited

Legend:

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

    r1218 r1233  
    8787    char *argv[2] = { "", NULL };
    8888    char const * const * fonts;
    89     unsigned int width = 0, height = 0;
     89    unsigned int width = dp->cv->width, height = dp->cv->height;
    9090    int argc = 1;
    9191
     
    100100#endif
    101101
    102     if(width && height)
    103         _cucul_set_canvas_size(dp->cv, width, height);
    104 
     102    _cucul_set_canvas_size(dp->cv, width ? width : 80, height ? height : 32);
    105103
    106104    /* Load a libcucul internal font */
  • libcaca/trunk/caca/driver_raw.c

    r1054 r1233  
    2222
    2323#include <stdio.h>
     24#include <stdlib.h>
    2425
    2526#include "caca.h"
     
    3031static int raw_init_graphics(caca_display_t *dp)
    3132{
     33    unsigned int width = dp->cv->width, height = dp->cv->height;
     34    char const *geometry;
     35
     36#if defined(HAVE_GETENV)
     37    geometry = getenv("CACA_GEOMETRY");
     38    if(geometry && *geometry)
     39        sscanf(geometry, "%ux%u", &width, &height);
     40#endif
     41
     42    _cucul_set_canvas_size(dp->cv, width ? width : 80, height ? height : 24);
     43
    3244    return 0;
    3345}
  • libcaca/trunk/caca/driver_win32.c

    r1218 r1233  
    113113
    114114    /* Set the new console size */
    115     size.X = dp->cv->width;
    116     size.Y = dp->cv->height;
     115    size.X = dp->cv->width ? dp->cv->width : 80;
     116    size.Y = dp->cv->height ? dp->cv->height : 25;
    117117    SetConsoleScreenBufferSize(dp->drv.p->screen, size);
    118118
  • libcaca/trunk/caca/driver_x11.c

    r1218 r1233  
    6868    char const *fonts[] = { NULL, "8x13bold", "fixed" }, **parser;
    6969    char const *geometry;
    70     unsigned int width = 0, height = 0;
     70    unsigned int width = dp->cv->width, height = dp->cv->height;
    7171    int i;
    7272
     
    7979#endif
    8080
    81     if(width && height)
    82         _cucul_set_canvas_size(dp->cv, width, height);
     81    _cucul_set_canvas_size(dp->cv, width ? width : 80, height ? height : 32);
    8382
    8483    dp->drv.p->dpy = XOpenDisplay(NULL);
Note: See TracChangeset for help on using the changeset viewer.