aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lldynamictexture.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-01-11 16:10:39 -0600
committerJacek Antonelli2009-01-11 16:10:43 -0600
commita87e38229921b48c32187c672a942516722f1b52 (patch)
tree9e1dc0bc2318a9c6fa454bdb6d873a6af0e0ce3c /linden/indra/newview/lldynamictexture.cpp
parentSecond Life viewer sources 1.22.4-RC (diff)
downloadmeta-impy-a87e38229921b48c32187c672a942516722f1b52.zip
meta-impy-a87e38229921b48c32187c672a942516722f1b52.tar.gz
meta-impy-a87e38229921b48c32187c672a942516722f1b52.tar.bz2
meta-impy-a87e38229921b48c32187c672a942516722f1b52.tar.xz
Second Life viewer sources 1.22.5-RC
Diffstat (limited to 'linden/indra/newview/lldynamictexture.cpp')
-rw-r--r--linden/indra/newview/lldynamictexture.cpp45
1 files changed, 41 insertions, 4 deletions
diff --git a/linden/indra/newview/lldynamictexture.cpp b/linden/indra/newview/lldynamictexture.cpp
index 9ce4515..8801d72 100644
--- a/linden/indra/newview/lldynamictexture.cpp
+++ b/linden/indra/newview/lldynamictexture.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2001-2008, Linden Research, Inc. 7 * Copyright (c) 2001-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -112,7 +112,7 @@ void LLDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum prima
112// llinfos << "ALLOCATING " << (mWidth*mHeight*mComponents)/1024 << "K" << llendl; 112// llinfos << "ALLOCATING " << (mWidth*mHeight*mComponents)/1024 << "K" << llendl;
113 mTexture->createGLTexture(0, raw_image); 113 mTexture->createGLTexture(0, raw_image);
114 mTexture->setClamp(mClamp, mClamp); 114 mTexture->setClamp(mClamp, mClamp);
115 mTexture->setInitialized(false); 115 mTexture->setGLTextureCreated(false);
116} 116}
117 117
118//----------------------------------------------------------------------------- 118//-----------------------------------------------------------------------------
@@ -197,6 +197,7 @@ BOOL LLDynamicTexture::updateAllInstances()
197 } 197 }
198 198
199 BOOL result = FALSE; 199 BOOL result = FALSE;
200 BOOL ret = FALSE ;
200 for( S32 order = 0; order < ORDER_COUNT; order++ ) 201 for( S32 order = 0; order < ORDER_COUNT; order++ )
201 { 202 {
202 for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin(); 203 for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
@@ -211,9 +212,10 @@ BOOL LLDynamicTexture::updateAllInstances()
211 212
212 gGL.color4f(1,1,1,1); 213 gGL.color4f(1,1,1,1);
213 dynamicTexture->preRender(); // Must be called outside of startRender() 214 dynamicTexture->preRender(); // Must be called outside of startRender()
214 215 result = FALSE;
215 if (dynamicTexture->render()) 216 if (dynamicTexture->render())
216 { 217 {
218 ret = TRUE ;
217 result = TRUE; 219 result = TRUE;
218 sNumRenders++; 220 sNumRenders++;
219 } 221 }
@@ -225,7 +227,19 @@ BOOL LLDynamicTexture::updateAllInstances()
225 } 227 }
226 } 228 }
227 229
228 return result; 230 return ret;
231}
232
233//virtual
234void LLDynamicTexture::restoreGLTexture()
235{
236 generateGLTexture() ;
237}
238
239//virtual
240void LLDynamicTexture::destroyGLTexture()
241{
242 releaseGLTexture() ;
229} 243}
230 244
231//----------------------------------------------------------------------------- 245//-----------------------------------------------------------------------------
@@ -234,6 +248,15 @@ BOOL LLDynamicTexture::updateAllInstances()
234//----------------------------------------------------------------------------- 248//-----------------------------------------------------------------------------
235void LLDynamicTexture::destroyGL() 249void LLDynamicTexture::destroyGL()
236{ 250{
251 for( S32 order = 0; order < ORDER_COUNT; order++ )
252 {
253 for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
254 iter != LLDynamicTexture::sInstances[order].end(); ++iter)
255 {
256 LLDynamicTexture *dynamicTexture = *iter;
257 dynamicTexture->destroyGLTexture() ;
258 }
259 }
237} 260}
238 261
239//----------------------------------------------------------------------------- 262//-----------------------------------------------------------------------------
@@ -242,4 +265,18 @@ void LLDynamicTexture::destroyGL()
242//----------------------------------------------------------------------------- 265//-----------------------------------------------------------------------------
243void LLDynamicTexture::restoreGL() 266void LLDynamicTexture::restoreGL()
244{ 267{
268 if (gGLManager.mIsDisabled)
269 {
270 return ;
271 }
272
273 for( S32 order = 0; order < ORDER_COUNT; order++ )
274 {
275 for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
276 iter != LLDynamicTexture::sInstances[order].end(); ++iter)
277 {
278 LLDynamicTexture *dynamicTexture = *iter;
279 dynamicTexture->restoreGLTexture() ;
280 }
281 }
245} 282}