Ignore:
Timestamp:
Dec 16, 2007, 12:54:43 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Only call glutInit() once through the program's lifetime.
  • Free the internal font when closing the GL driver.
  • Hide the window when closing the GL driver, because freeglut's glutDestroyWindow() does not really closes the window.
File:
1 edited

Legend:

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

    r2138 r2141  
    4545 */
    4646
     47static int glut_init;
    4748static caca_display_t *gl_d; /* FIXME: we ought to get rid of this */
    4849
     
    140141    dp->drv.p->sh = ((float)dp->drv.p->font_height) / 16.0f;
    141142
    142     glutInit(&argc, argv);
     143    if(!glut_init)
     144    {
     145        glut_init = 1;
     146        glutInit(&argc, argv);
     147    }
    143148
    144149    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
     
    187192static int gl_end_graphics(caca_display_t *dp)
    188193{
     194    glutHideWindow();
    189195    glutDestroyWindow(dp->drv.p->window);
     196    cucul_free_font(dp->drv.p->f);
    190197    free(dp->drv.p->txid);
    191198    free(dp->drv.p);
Note: See TracChangeset for help on using the changeset viewer.