sdlterm/demo.cc
changeset 52 50a1857557da
parent 51 dce7325109c1
child 57 911927edbdde
equal deleted inserted replaced
51:dce7325109c1 52:50a1857557da
    17 void Application::init()
    17 void Application::init()
    18 {
    18 {
    19     term.resize(800, 600);
    19     term.resize(800, 600);
    20     term.select_font("font/DejaVuSansMono.ttf", "font/DejaVuSansMono-Bold.ttf", 12);
    20     term.select_font("font/DejaVuSansMono.ttf", "font/DejaVuSansMono-Bold.ttf", 12);
    21     term.erase();
    21     term.erase();
    22     term.set_attr( term.prepare_attr(14, 1, 1) );
       
    23 
    22 
    24     char hello[] = "Hello World!";
    23     char hello[] = "Hello World!";
    25     for (char *c = hello; *c; c++)
    24     for (int bg = 0; bg < 16; bg++)
    26     {
    25     {
    27         term.putch(5 + (c - hello), 5, *c);
    26         for (int fg = 0; fg < 16; fg++)
       
    27         {
       
    28             for (char *c = hello; *c; c++)
       
    29             {
       
    30                 term.set_attr( term.prepare_attr(fg, bg, 1) );
       
    31                 term.putch(5 + 6 * bg + (c - hello), 5 + fg, *c);
       
    32             }
       
    33         }
    28     }
    34     }
    29     term.commit();
    35     term.commit();
    30 }
    36 }
    31 
    37 
    32 
    38