Пример #1
0
void CUIWnd::Render() {
    GG::Pt ul = UpperLeft();
    GG::Pt lr = LowerRight();
    GG::Pt cl_ul = ClientUpperLeft();
    GG::Pt cl_lr = ClientLowerRight();

    if (!m_minimized) {
        AngledCornerRectangle(ul, lr, ClientUI::WndColor(), ClientUI::WndOuterBorderColor(),
                              OUTER_EDGE_ANGLE_OFFSET, 1, false, !m_resizable); // show notched bottom-right corner if not resizable, pointed corner if resizable

        // use GL to draw the lines
        glDisable(GL_TEXTURE_2D);

        // draw inner border, including extra resize-tab lines
        glBegin(GL_LINE_STRIP);
            glColor(ClientUI::WndInnerBorderColor());
            glVertex(cl_ul.x, cl_ul.y);
            glVertex(cl_lr.x, cl_ul.y);
            if (m_resizable) {
                glVertex(cl_lr.x, cl_lr.y - INNER_BORDER_ANGLE_OFFSET);
                glVertex(cl_lr.x - INNER_BORDER_ANGLE_OFFSET, cl_lr.y);
            } else {
                glVertex(cl_lr.x, cl_lr.y);
            }
            glVertex(cl_ul.x, cl_lr.y);
            glVertex(cl_ul.x, cl_ul.y);
        glEnd();
        if (m_resizable) {
            glBegin(GL_LINES);
                // draw the extra lines of the resize tab
                GG::Clr tab_lines_colour = m_mouse_in_resize_tab ? ClientUI::WndInnerBorderColor() : ClientUI::WndOuterBorderColor();
                glColor(tab_lines_colour);

                glVertex(cl_lr.x, cl_lr.y - RESIZE_HASHMARK1_OFFSET);
                glVertex(cl_lr.x - RESIZE_HASHMARK1_OFFSET, cl_lr.y);

                glVertex(cl_lr.x, cl_lr.y - RESIZE_HASHMARK2_OFFSET);
                glVertex(cl_lr.x - RESIZE_HASHMARK2_OFFSET, cl_lr.y);
            glEnd();
        }
        glEnable(GL_TEXTURE_2D);
    } else {
        GG::FlatRectangle(ul, lr, ClientUI::WndColor(), ClientUI::WndOuterBorderColor(), 1);
    }

    GG::BeginScissorClipping(ul, lr);
    glColor(ClientUI::TextColor());
    boost::shared_ptr<GG::Font> font = ClientUI::GetTitleFont();
    font->RenderText(GG::Pt(ul.x + BORDER_LEFT, ul.y + TITLE_OFFSET), Name());
    GG::EndScissorClipping();
}
void GraphicalSummaryWnd::Render()
{
    GG::Pt one(GG::X(2), GG::Y1);
    AngledCornerRectangle(UpperLeft(), LowerRight() - one, ClientUI::CtrlColor(), GG::CLR_ZERO,
                          8, 1, false, true);
}