summaryrefslogtreecommitdiff
path: root/indra/llrender/llglstates.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-02-17 17:18:57 -0600
committerDave Parks <davep@lindenlab.com>2011-02-17 17:18:57 -0600
commit9e0ee4dff0109326c31425581437a44351d08344 (patch)
tree1a434993f91fc75ddff444fea2a8e3e2cf2b6f4a /indra/llrender/llglstates.h
parentcf728ab09ec12c73e95b8e2304a3b69c9460182e (diff)
SH-1006 Quick pass at cutting down the number of redundant GL calls based on data from gDEBugger.
Reviewed by Nyx.
Diffstat (limited to 'indra/llrender/llglstates.h')
-rw-r--r--indra/llrender/llglstates.h32
1 files changed, 8 insertions, 24 deletions
diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h
index d5a29dcd0c..e26aead676 100644
--- a/indra/llrender/llglstates.h
+++ b/indra/llrender/llglstates.h
@@ -238,9 +238,11 @@ public:
class LLGLSSpecular
{
public:
+ F32 mShininess;
LLGLSSpecular(const LLColor4& color, F32 shininess)
{
- if (shininess > 0.0f)
+ mShininess = shininess;
+ if (mShininess > 0.0f)
{
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color.mV);
S32 shiny = (S32)(shininess*128.f);
@@ -250,32 +252,14 @@ public:
}
~LLGLSSpecular()
{
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV);
- glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0);
+ if (mShininess > 0.f)
+ {
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV);
+ glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0);
+ }
}
};
//----------------------------------------------------------------------------
-
-class LLGLSBlendFunc : public LLGLSPipeline {
-protected:
- GLint mSavedSrc, mSavedDst;
- LLGLEnable mBlend;
-
-public:
- LLGLSBlendFunc(GLenum srcFunc, GLenum dstFunc) :
- mBlend(GL_BLEND)
- {
- glGetIntegerv(GL_BLEND_SRC, &mSavedSrc);
- glGetIntegerv(GL_BLEND_DST, &mSavedDst);
- glBlendFunc(srcFunc, dstFunc);
- }
-
- ~LLGLSBlendFunc(void) {
- glBlendFunc(mSavedSrc, mSavedDst);
- }
-};
-
-
#endif