diff options
author | Dave Parks <davep@lindenlab.com> | 2011-08-08 15:29:23 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-08-08 15:29:23 -0500 |
commit | 14f6bbadef2c39e58a3b54c0c6212949acf50e45 (patch) | |
tree | 295c3bd149b343cd334885133f101963219d7f39 /indra/llrender/llrender.cpp | |
parent | 333608e889827342c79d3eee2006b1a704985740 (diff) |
SH-2242 Work in progress migrating to glVertexAttrib everywhere
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r-- | indra/llrender/llrender.cpp | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index d72918b15d..da85bc202c 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1580,6 +1580,105 @@ void LLRender::color3fv(const GLfloat* c) color4f(c[0],c[1],c[2],1); } +void LLRender::diffuseColor3f(F32 r, F32 g, F32 b) +{ + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + S32 loc = -1; + if (shader) + { + loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR); + } + + if (loc >= 0) + { + glVertexAttrib3fARB(loc, r,g,b); + } + else + { + glColor3f(r,g,b); + } +} + +void LLRender::diffuseColor3fv(const F32* c) +{ + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + S32 loc = -1; + if (shader) + { + loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR); + } + + if (loc >= 0) + { + glVertexAttrib3fvARB(loc, c); + } + else + { + glColor3fv(c); + } +} + +void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a) +{ + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + S32 loc = -1; + if (shader) + { + loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR); + } + + if (loc >= 0) + { + glVertexAttrib4fARB(loc, r,g,b,a); + } + else + { + glColor4f(r,g,b,a); + } + +} + +void LLRender::diffuseColor4fv(const F32* c) +{ + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + S32 loc = -1; + if (shader) + { + loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR); + } + + if (loc >= 0) + { + glVertexAttrib4fvARB(loc, c); + } + else + { + glColor4fv(c); + } +} + +void LLRender::diffuseColor4ubv(const U8* c) +{ + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + S32 loc = -1; + if (shader) + { + loc = shader->getAttribLocation(LLVertexBuffer::TYPE_COLOR); + } + + if (loc >= 0) + { + glVertexAttrib4ubvARB(loc, c); + } + else + { + glColor4ubv(c); + } +} + + + + void LLRender::debugTexUnits(void) { LL_INFOS("TextureUnit") << "Active TexUnit: " << mCurrTextureUnitIndex << LL_ENDL; |