Example #1
0
void Canvas::initPlayback(int multiSampleSamples)
{
    m_bIsPlaying = true;
    m_pRootNode->connectDisplay();
    m_MultiSampleSamples = multiSampleSamples;
    m_pVertexArray = VertexArrayPtr(new VertexArray(2000, 3000));
}
Example #2
0
void DivNode::connectDisplay()
{
    AreaNode::connectDisplay();
    for (unsigned i = 0; i < getNumChildren(); ++i) {
        getChild(i)->connectDisplay();
    }
    m_pClipVertexes = VertexArrayPtr(new VertexArray());
}
Example #3
0
void DivNode::disconnect(bool bKill)
{
    for (unsigned i = 0; i < getNumChildren(); ++i) {
        getChild(i)->disconnect(bKill);
    }
    if (m_pClipVertexes) {
        m_pClipVertexes = VertexArrayPtr();
    }
    AreaNode::disconnect(bKill);
}
Example #4
0
void Canvas::stopPlayback(bool bIsAbort)
{
    if (m_bIsPlaying) {
        if (!bIsAbort) {
            m_PlaybackEndSignal.emit();
        }
        m_pRootNode->disconnect(true);
        m_pRootNode = CanvasNodePtr();
        m_IDMap.clear();
        m_bIsPlaying = false;
        m_pVertexArray = VertexArrayPtr();
    }
}
Example #5
0
VertexArrayPtr RenderContext::createVertexArray(VertexDescription description, VertexBufferPtr buffer) {
  VertexArrayPtr vao = VertexArrayPtr(new VertexArray());
  vao->bind();
  buffer->bind();
  int offset = 0;
  for(VertexDescriptionElement e : description) {
    if(e.shaderAttribLocation() != -1) {
      glVertexAttribPointer(e.shaderAttribLocation(), e.numberOfComponents(), (int)e.type(), GL_FALSE, description.sizeInBytes(), (char*)nullptr + offset);
      glEnableVertexAttribArray(e.shaderAttribLocation());
    }
    offset += e.sizeInBytes();
  }
  buffer->release();
  vao->release();
  return vao;
}