Exemplo n.º 1
0
//===========================================================================
cBackground::cBackground()
{
    // create vertices at each corner
    m_vertexTL = newVertex(0.0, 1.0, 0.0);
    m_vertexTR = newVertex(1.0, 1.0, 0.0);
    m_vertexBL = newVertex(0.0, 0.0, 0.0);
    m_vertexBR = newVertex(1.0, 0.0, 0.0);

    cVertex* vertexTL = getVertex(m_vertexTL);
    cVertex* vertexTR = getVertex(m_vertexTR);
    cVertex* vertexBL = getVertex(m_vertexBL);
    cVertex* vertexBR = getVertex(m_vertexBR);

    // create triangles by connecting above vertices
    newTriangle(m_vertexTL, m_vertexBL, m_vertexBR);
    newTriangle(m_vertexTL, m_vertexBR, m_vertexTR);

    // adjust normal at each vertex
    cVector3d normal(0.0, 0.0, 1.0);
    vertexTL->m_normal = normal;
    vertexTR->m_normal = normal;
    vertexBL->m_normal = normal;
    vertexBR->m_normal = normal;

    // disable material properties, enable colors
    setUseMaterial(true);
    setUseVertexColors(true);
    setUseTransparency(false);
    setMaintainAspectRatio(true);

    // set default color
    cColorf color(1.0, 1.0, 1.0);
    setUniformColor(color);
}
Exemplo n.º 2
0
GUIFrame *GUIFrame::create(vec2 size)
{
    auto frame = new GUIFrame();
    frame->setUniformColor(vec4(33.0/255,33.0/255,37.0/255,1.0));
    frame->setContentSize(size);
    return frame;
}
Exemplo n.º 3
0
GUIFrame *GUIFrame::create(vec4 color, vec2 size)
{
    auto frame = new GUIFrame();
    frame->setUniformColor(color);
    frame->setContentSize(size);
    return frame;
}
Exemplo n.º 4
0
GUIFrame *GUIFrame::create(vec4 color)
{
    auto frame = new GUIFrame();
    frame->setUniformColor(color);
    return frame;
}