Logo Search packages:      
Sourcecode: libcaca version File versions  Download package

void caca_putchar ( int  x,
int  y,
char  c 
)

Print a character.

This function prints a character at the given coordinates, using the default foreground and background values. If the coordinates are outside the screen boundaries, nothing is printed.

Parameters:
x X coordinate.
y Y coordinate.
c The character to print.

Definition at line 370 of file graphics.c.

Referenced by caca_draw_bitmap(), caca_draw_sprite(), caca_draw_thin_box(), caca_fill_box(), caca_fill_triangle(), draw_solid_line(), and draw_thin_line().

{
#if defined(USE_CONIO)
    char *data;
#endif
    if(x < 0 || x >= (int)_caca_width ||
       y < 0 || y >= (int)_caca_height)
        return;

    switch(_caca_driver)
    {
#if defined(USE_SLANG)
    case CACA_DRIVER_SLANG:
        SLsmg_gotorc(y, x);
#if defined(OPTIMISE_SLANG_PALETTE)
        if(_caca_fgisbg)
            SLsmg_write_char(' ');
        else
#endif
            SLsmg_write_char(c);
        break;
#endif
#if defined(USE_NCURSES)
    case CACA_DRIVER_NCURSES:
        move(y, x);
        addch(c);
        break;
#endif
#if defined(USE_CONIO)
    case CACA_DRIVER_CONIO:
        data = conio_screen + 2 * (x + y * _caca_width);
        data[0] = c;
        data[1] = (_caca_bgcolor << 4) | _caca_fgcolor;
        break;
#endif
#if defined(USE_X11)
    case CACA_DRIVER_X11:
        x11_char[x + y * _caca_width] = c;
        x11_attr[x + y * _caca_width] = (_caca_bgcolor << 4) | _caca_fgcolor;
        break;
#endif
#if defined(USE_WIN32)
    case CACA_DRIVER_WIN32:
        win32_char[x + y * _caca_width] = c;
        win32_attr[x + y * _caca_width] = (_caca_bgcolor << 4) | _caca_fgcolor;
        break;
#endif
    default:
        break;
    }
}


Generated by  Doxygen 1.6.0   Back to index