Use shared VBO for paintBackground
This commit is contained in:
parent
6cb3b95cc1
commit
a7dd31ef00
1 changed files with 6 additions and 5 deletions
|
@ -275,12 +275,13 @@ void SceneOpenGL::paintBackground(QRegion region)
|
|||
verts << r.x() + r.width() << r.y() + r.height();
|
||||
verts << r.x() + r.width() << r.y();
|
||||
}
|
||||
GLVertexBuffer vbo(GLVertexBuffer::Static);
|
||||
vbo.setUseColor(true);
|
||||
vbo.setUseShader(true);
|
||||
vbo.setData(verts.count() / 2, 2, verts.data(), NULL);
|
||||
GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer();
|
||||
vbo->reset();
|
||||
vbo->setUseColor(true);
|
||||
vbo->setUseShader(true);
|
||||
vbo->setData(verts.count() / 2, 2, verts.data(), NULL);
|
||||
ShaderManager::instance()->pushShader(ShaderManager::ColorShader);
|
||||
vbo.render(GL_TRIANGLES);
|
||||
vbo->render(GL_TRIANGLES);
|
||||
ShaderManager::instance()->popShader();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue