Ignore:
Timestamp:
Mar 24, 2006, 10:48:20 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Allow the driver initialisation to fail, for instance when $DISPLAY = "".
File:
1 edited

Legend:

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

    r681 r684  
    107107    gl_kk = kk;
    108108
     109#if defined(HAVE_GETENV)
    109110    geometry = getenv("CACA_GEOMETRY");
    110111    if(geometry && *geometry)
    111112        sscanf(geometry, "%ux%u", &width, &height);
     113#endif
    112114
    113115    if(width && height)
     
    446448 */
    447449
    448 void gl_init_driver(caca_t *kk)
    449 {
     450int gl_install(caca_t *kk)
     451{
     452#if defined(HAVE_GETENV) && defined(GLUT_XLIB_IMPLEMENTATION)
     453    if(!getenv("DISPLAY") || !*(getenv("DISPLAY")))
     454        return -1;
     455#endif
     456
    450457    kk->drv.driver = CACA_DRIVER_GL;
    451458
     
    458465    kk->drv.handle_resize = gl_handle_resize;
    459466    kk->drv.get_event = gl_get_event;
     467
     468    return 0;
    460469}
    461470
Note: See TracChangeset for help on using the changeset viewer.