improve the perfermance of clear background for camera

This commit is contained in:
Huabing.Xu 2015-05-18 10:31:17 +08:00
parent fbe49f538d
commit 384041a950
1 changed files with 1 additions and 1 deletions

View File

@ -396,7 +396,7 @@ void Camera::clearBackground(float depth)
quad.tr.texCoords = Tex2F(1,1); quad.tr.texCoords = Tex2F(1,1);
auto shader = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_CAMERA_CLEAR); auto shader = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_CAMERA_CLEAR);
auto programState = GLProgramState::create(shader); auto programState = GLProgramState::getOrCreateWithGLProgram(shader);
programState->setUniformFloat("depth", 1.0); programState->setUniformFloat("depth", 1.0);
programState->apply(Mat4()); programState->apply(Mat4());
GLshort indices[6] = {0, 1, 2, 3, 2, 1}; GLshort indices[6] = {0, 1, 2, 3, 2, 1};