Ignore:
Timestamp:
Jul 17, 2012, 12:54:18 AM (10 years ago)
Author:
rez
Message:

glsl letterbox and round corner & some new fancy animation!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/render.cpp

    r1629 r1634  
    5353/* window variable */
    5454ivec2 screen_size;         // screen size
    55 vec3 screen_color = CR * vec3(48, 56, 64); // screen color
     55vec3 screen_color = CR * vec3(32, 32, 32); // screen color
    5656/* object variable */
    5757float main_angle = 0.0f;   // main angle
     
    230230{
    231231    screen_size = Video::GetSize();
    232     border = 10 * ratio_2d;
     232    border = 18 * ratio_2d;
    233233    border.y = border.x; // enabled to get same border everywhere
    234234    canvas_char = (screen_size - border * 2) / (font_size * ratio_2d);
     
    252252    m_shader_glow(true),
    253253    m_shader_fx(true),
    254     m_shader_postfx(true)
     254    m_shader_postfx(true),
     255    m_border(false)
    255256{
    256257    text_render = new TextRender(m_caca, font_size);
     
    376377    glMatrixMode(GL_MODELVIEW);
    377378    // draw border
    378     glDisable(GL_TEXTURE_2D);
    379     glDisable(GL_BLEND);
    380     glColor3f(1.0f,1.0f,1.0f);
    381     rectangle(border.x - ratio_2d.x, border.y - ratio_2d.y, canvas_size.x + ratio_2d.x * 2, ratio_2d.y);
    382     rectangle(border.x - ratio_2d.x, border.y, ratio_2d.x, canvas_size.y);
    383     rectangle(border.x + canvas_size.x, border.y, ratio_2d.x, canvas_size.y);
    384     rectangle(border.x - ratio_2d.x, border.y + canvas_size.y, canvas_size.x + ratio_2d.x * 2, ratio_2d.y);
    385     glEnable(GL_BLEND);
     379    if(m_border)
     380    {
     381        glDisable(GL_TEXTURE_2D);
     382        glDisable(GL_BLEND);
     383        glColor3f(1.0f,1.0f,1.0f);
     384        rectangle(border.x - ratio_2d.x, border.y - ratio_2d.y, canvas_size.x + ratio_2d.x * 2, ratio_2d.y);
     385        rectangle(border.x - ratio_2d.x, border.y, ratio_2d.x, canvas_size.y);
     386        rectangle(border.x + canvas_size.x, border.y, ratio_2d.x, canvas_size.y);
     387        rectangle(border.x - ratio_2d.x, border.y + canvas_size.y, canvas_size.x + ratio_2d.x * 2, ratio_2d.y);
     388        glEnable(GL_BLEND);
     389    }
    386390}
    387391
Note: See TracChangeset for help on using the changeset viewer.