void Shape::setVertexArray(const VertexArrayPtr& pVA) { pVA->startSubVA(m_SubVA); m_SubVA.appendVertexData(m_pVertexData); /* cerr << endl; cerr << "Global VA: " << endl; pVA->dump(); cerr << "Local vertex data: " << endl; m_pVertexData->dump(); */ }
void DivNode::preRender(const VertexArrayPtr& pVA, bool bIsParentActive, float parentEffectiveOpacity) { Node::preRender(pVA, bIsParentActive, parentEffectiveOpacity); if (getCrop() && getSize() != glm::vec2(0,0)) { pVA->startSubVA(m_ClipVA); glm::vec2 viewport = getSize(); m_ClipVA.appendPos(glm::vec2(0,0), glm::vec2(0,0), Pixel32(0,0,0,0)); m_ClipVA.appendPos(glm::vec2(0,viewport.y), glm::vec2(0,0), Pixel32(0,0,0,0)); m_ClipVA.appendPos(glm::vec2(viewport.x,0), glm::vec2(0,0), Pixel32(0,0,0,0)); m_ClipVA.appendPos(viewport, glm::vec2(0,0), Pixel32(0,0,0,0)); m_ClipVA.appendQuadIndexes(0, 1, 2, 3); } for (unsigned i = 0; i < getNumChildren(); i++) { getChild(i)->preRender(pVA, bIsParentActive, getEffectiveOpacity()); } }
void RasterNode::calcVertexArray(const VertexArrayPtr& pVA) { if (isVisible() && m_pSurface->isCreated()) { if (!m_bHasStdVertices) { pVA->startSubVA(*m_pSubVA); for (unsigned y = 0; y < m_TileVertices.size()-1; y++) { for (unsigned x = 0; x < m_TileVertices[0].size()-1; x++) { int curVertex = m_pSubVA->getNumVerts(); m_pSubVA->appendPos(m_TileVertices[y][x], m_TexCoords[y][x], m_Color); m_pSubVA->appendPos(m_TileVertices[y][x+1], m_TexCoords[y][x+1], m_Color); m_pSubVA->appendPos(m_TileVertices[y+1][x+1], m_TexCoords[y+1][x+1], m_Color); m_pSubVA->appendPos(m_TileVertices[y+1][x], m_TexCoords[y+1][x], m_Color); m_pSubVA->appendQuadIndexes( curVertex+1, curVertex, curVertex+2, curVertex+3); } } } } }