diff options
| author | Mark Palange <palange@lindenlab.com> | 2009-01-13 03:46:56 +0000 |
|---|---|---|
| committer | Mark Palange <palange@lindenlab.com> | 2009-01-13 03:46:56 +0000 |
| commit | 446c55538e1fb12d8a1feb541edf99c16bb29121 (patch) | |
| tree | 022ca3c10bd2e0326098719cdffb65f9465ab08f /indra/newview/lldynamictexture.cpp | |
| parent | 5476aca88e4b34d4d145f3a0b04fce95402c7b1f (diff) | |
svn merge -r106055-107012 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer_1-22/
merge RC5 changes into trunk, plus add'l localization xml (all newly added) files that should have been added with RC0-RC4 merge, but weren't.
Diffstat (limited to 'indra/newview/lldynamictexture.cpp')
| -rw-r--r-- | indra/newview/lldynamictexture.cpp | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index b03306fa90..6951f3a96a 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -113,7 +113,7 @@ void LLDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum prima // llinfos << "ALLOCATING " << (mWidth*mHeight*mComponents)/1024 << "K" << llendl; mTexture->createGLTexture(0, raw_image); mTexture->setClamp(mClamp, mClamp); - mTexture->setInitialized(false); + mTexture->setGLTextureCreated(false); } //----------------------------------------------------------------------------- @@ -198,6 +198,7 @@ BOOL LLDynamicTexture::updateAllInstances() } BOOL result = FALSE; + BOOL ret = FALSE ; for( S32 order = 0; order < ORDER_COUNT; order++ ) { for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin(); @@ -212,9 +213,10 @@ BOOL LLDynamicTexture::updateAllInstances() gGL.color4f(1,1,1,1); dynamicTexture->preRender(); // Must be called outside of startRender() - + result = FALSE; if (dynamicTexture->render()) { + ret = TRUE ; result = TRUE; sNumRenders++; } @@ -226,7 +228,19 @@ BOOL LLDynamicTexture::updateAllInstances() } } - return result; + return ret; +} + +//virtual +void LLDynamicTexture::restoreGLTexture() +{ + generateGLTexture() ; +} + +//virtual +void LLDynamicTexture::destroyGLTexture() +{ + releaseGLTexture() ; } //----------------------------------------------------------------------------- @@ -235,6 +249,15 @@ BOOL LLDynamicTexture::updateAllInstances() //----------------------------------------------------------------------------- void LLDynamicTexture::destroyGL() { + for( S32 order = 0; order < ORDER_COUNT; order++ ) + { + for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin(); + iter != LLDynamicTexture::sInstances[order].end(); ++iter) + { + LLDynamicTexture *dynamicTexture = *iter; + dynamicTexture->destroyGLTexture() ; + } + } } //----------------------------------------------------------------------------- @@ -243,4 +266,18 @@ void LLDynamicTexture::destroyGL() //----------------------------------------------------------------------------- void LLDynamicTexture::restoreGL() { + if (gGLManager.mIsDisabled) + { + return ; + } + + for( S32 order = 0; order < ORDER_COUNT; order++ ) + { + for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin(); + iter != LLDynamicTexture::sInstances[order].end(); ++iter) + { + LLDynamicTexture *dynamicTexture = *iter; + dynamicTexture->restoreGLTexture() ; + } + } } |
