Changeset 1044


Ignore:
Timestamp:
Sep 17, 2006, 3:12:28 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Coding style (ahaha vieux porc).
File:
1 edited

Legend:

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

    r1039 r1044  
    5858#endif
    5959static void _display(void);
    60 void gl_generate_glyph(uint32_t c, uint32_t tid, caca_display_t *dp);
    61 void gl_generate_unicode_glyph(uint32_t c, uint32_t tid, caca_display_t *dp);
     60static void gl_generate_glyph(uint32_t, uint32_t, caca_display_t *);
     61static void gl_generate_unicode_glyph(uint32_t, uint32_t, caca_display_t *);
    6262
    6363struct driver_private
     
    536536}
    537537
    538 
    539 /*
    540  * Driver initialisation
    541  */
    542 
    543 int gl_install(caca_display_t *dp)
    544 {
    545 #if defined(HAVE_GETENV) && defined(GLUT_XLIB_IMPLEMENTATION)
    546     if(!getenv("DISPLAY") || !*(getenv("DISPLAY")))
    547         return -1;
    548 #endif
    549 
    550     dp->drv.driver = CACA_DRIVER_GL;
    551 
    552     dp->drv.init_graphics = gl_init_graphics;
    553     dp->drv.end_graphics = gl_end_graphics;
    554     dp->drv.set_display_title = gl_set_display_title;
    555     dp->drv.get_display_width = gl_get_display_width;
    556     dp->drv.get_display_height = gl_get_display_height;
    557     dp->drv.display = gl_display;
    558     dp->drv.handle_resize = gl_handle_resize;
    559     dp->drv.get_event = gl_get_event;
    560     dp->drv.set_mouse = gl_set_mouse;
    561 
    562     return 0;
    563 }
    564 
    565 
    566 
    567 void gl_generate_glyph(uint32_t c, uint32_t tid, caca_display_t *dp) {
     538static void gl_generate_glyph(uint32_t c, uint32_t tid, caca_display_t *dp)
     539{
    568540    int s,d;
    569541    uint8_t *glyph8 =  calloc(dp->drv.p->font_width*dp->drv.p->font_height, 1);
     
    573545
    574546    /* Convert resulting 8bbp glyph to 32bits, 16x16*/
    575     for(s=0;s<(dp->drv.p->font_height<=16?dp->drv.p->font_height:16);s++) {
     547    for(s=0;s<(dp->drv.p->font_height<=16?dp->drv.p->font_height:16);s++)
     548    {
    576549        for(d=0;d<dp->drv.p->font_width;d++)
    577550        {
     
    597570}
    598571
    599 void gl_generate_unicode_glyph(uint32_t c, uint32_t tid, caca_display_t *dp) {
     572static void gl_generate_unicode_glyph(uint32_t c, uint32_t tid,
     573                                      caca_display_t *dp)
     574{
    600575    int s,d;
    601576    uint8_t *glyph8 =  calloc(dp->drv.p->font_width*dp->drv.p->font_height, 1);
     
    605580
    606581    /* Convert resulting 8bbp glyph to 32bits, 16x16*/
    607     for(s=0;s<(dp->drv.p->font_height<=16?dp->drv.p->font_height:16);s++) {
     582    for(s=0;s<(dp->drv.p->font_height<=16?dp->drv.p->font_height:16);s++)
     583    {
    608584        for(d=0;d<(dp->drv.p->font_width<=16?dp->drv.p->font_width:16);d++)
    609585        {
     
    629605}
    630606
    631 
    632 
    633 
    634 
     607/*
     608 * Driver initialisation
     609 */
     610
     611int gl_install(caca_display_t *dp)
     612{
     613#if defined(HAVE_GETENV) && defined(GLUT_XLIB_IMPLEMENTATION)
     614    if(!getenv("DISPLAY") || !*(getenv("DISPLAY")))
     615        return -1;
     616#endif
     617
     618    dp->drv.driver = CACA_DRIVER_GL;
     619
     620    dp->drv.init_graphics = gl_init_graphics;
     621    dp->drv.end_graphics = gl_end_graphics;
     622    dp->drv.set_display_title = gl_set_display_title;
     623    dp->drv.get_display_width = gl_get_display_width;
     624    dp->drv.get_display_height = gl_get_display_height;
     625    dp->drv.display = gl_display;
     626    dp->drv.handle_resize = gl_handle_resize;
     627    dp->drv.get_event = gl_get_event;
     628    dp->drv.set_mouse = gl_set_mouse;
     629
     630    return 0;
     631}
    635632
    636633#endif /* USE_GL */
Note: See TracChangeset for help on using the changeset viewer.