mirror of https://github.com/axmolengine/axmol.git
update vertex buffer to update color (#18283)
This commit is contained in:
parent
186e05f7c5
commit
bb21a206a9
|
@ -282,6 +282,13 @@ bool CameraBackgroundColorBrush::init()
|
|||
void CameraBackgroundColorBrush::setColor(const Color4F& color)
|
||||
{
|
||||
_quad.bl.colors = _quad.br.colors = _quad.tl.colors = _quad.tr.colors = Color4B(color);
|
||||
|
||||
if (_vertexBuffer)
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(_quad), &_quad, GL_STATIC_DRAW);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
}
|
||||
}
|
||||
|
||||
CameraBackgroundColorBrush* CameraBackgroundColorBrush::create(const Color4F& color, float depth)
|
||||
|
|
Loading…
Reference in New Issue