summaryrefslogtreecommitdiff
path: root/indra/llrender/llglstates.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-05-02 14:52:12 -0500
committerDave Parks <davep@lindenlab.com>2011-05-02 14:52:12 -0500
commita25f8987032afede673b818fe7544975eba036b5 (patch)
treecfa15a82661d407fd9f2031e7dfd6f7e0be48bb2 /indra/llrender/llglstates.h
parentb9bb792c478d703c6442351ecb563c0a67f77111 (diff)
parent43083743747bece13301e2789ab36ed7e4886aba (diff)
merge
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