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() + r.height();
|
||||||
verts << r.x() + r.width() << r.y();
|
verts << r.x() + r.width() << r.y();
|
||||||
}
|
}
|
||||||
GLVertexBuffer vbo(GLVertexBuffer::Static);
|
GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer();
|
||||||
vbo.setUseColor(true);
|
vbo->reset();
|
||||||
vbo.setUseShader(true);
|
vbo->setUseColor(true);
|
||||||
vbo.setData(verts.count() / 2, 2, verts.data(), NULL);
|
vbo->setUseShader(true);
|
||||||
|
vbo->setData(verts.count() / 2, 2, verts.data(), NULL);
|
||||||
ShaderManager::instance()->pushShader(ShaderManager::ColorShader);
|
ShaderManager::instance()->pushShader(ShaderManager::ColorShader);
|
||||||
vbo.render(GL_TRIANGLES);
|
vbo->render(GL_TRIANGLES);
|
||||||
ShaderManager::instance()->popShader();
|
ShaderManager::instance()->popShader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue