diff options
Diffstat (limited to 'linden/indra/llrender/llimagegl.h')
-rw-r--r-- | linden/indra/llrender/llimagegl.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/linden/indra/llrender/llimagegl.h b/linden/indra/llrender/llimagegl.h index dbe11da..e8c0a4a 100644 --- a/linden/indra/llrender/llimagegl.h +++ b/linden/indra/llrender/llimagegl.h | |||
@@ -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 |
@@ -90,6 +90,7 @@ public: | |||
90 | 90 | ||
91 | void setSize(S32 width, S32 height, S32 ncomponents); | 91 | void setSize(S32 width, S32 height, S32 ncomponents); |
92 | 92 | ||
93 | BOOL createGLTexture() ; | ||
93 | BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S32 usename = 0); | 94 | BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S32 usename = 0); |
94 | BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, S32 usename = 0); | 95 | BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, S32 usename = 0); |
95 | void setImage(const LLImageRaw* imageraw); | 96 | void setImage(const LLImageRaw* imageraw); |
@@ -113,6 +114,8 @@ public: | |||
113 | S32 getDiscardLevel() const { return mCurrentDiscardLevel; } | 114 | S32 getDiscardLevel() const { return mCurrentDiscardLevel; } |
114 | S32 getMaxDiscardLevel() const { return mMaxDiscardLevel; } | 115 | S32 getMaxDiscardLevel() const { return mMaxDiscardLevel; } |
115 | 116 | ||
117 | S32 getCurrentWidth() const { return mWidth ;} | ||
118 | S32 getCurrentHeight() const { return mHeight ;} | ||
116 | S32 getWidth(S32 discard_level = -1) const; | 119 | S32 getWidth(S32 discard_level = -1) const; |
117 | S32 getHeight(S32 discard_level = -1) const; | 120 | S32 getHeight(S32 discard_level = -1) const; |
118 | U8 getComponents() const { return mComponents; } | 121 | U8 getComponents() const { return mComponents; } |
@@ -134,8 +137,8 @@ public: | |||
134 | void setTarget(const LLGLenum target, const LLTexUnit::eTextureType bind_target); | 137 | void setTarget(const LLGLenum target, const LLTexUnit::eTextureType bind_target); |
135 | 138 | ||
136 | LLTexUnit::eTextureType getTarget(void) const { return mBindTarget; } | 139 | LLTexUnit::eTextureType getTarget(void) const { return mBindTarget; } |
137 | bool isInitialized(void) const { return mInitialized; } | 140 | bool isGLTextureCreated(void) const { return mGLTextureCreated ; } |
138 | void setInitialized (bool initialized) { mInitialized = initialized; } | 141 | void setGLTextureCreated (bool initialized) { mGLTextureCreated = initialized; } |
139 | 142 | ||
140 | BOOL getUseMipMaps() const { return mUseMipMaps; } | 143 | BOOL getUseMipMaps() const { return mUseMipMaps; } |
141 | void setUseMipMaps(BOOL usemips) { mUseMipMaps = usemips; } | 144 | void setUseMipMaps(BOOL usemips) { mUseMipMaps = usemips; } |
@@ -147,6 +150,8 @@ public: | |||
147 | void updatePickMask(S32 width, S32 height, const U8* data_in); | 150 | void updatePickMask(S32 width, S32 height, const U8* data_in); |
148 | BOOL getMask(const LLVector2 &tc); | 151 | BOOL getMask(const LLVector2 &tc); |
149 | 152 | ||
153 | void checkTexSize() const ; | ||
154 | |||
150 | protected: | 155 | protected: |
151 | void init(BOOL usemipmaps); | 156 | void init(BOOL usemipmaps); |
152 | virtual void cleanup(); // Clean up the LLImageGL so it can be reinitialized. Be careful when using this in derived class destructors | 157 | virtual void cleanup(); // Clean up the LLImageGL so it can be reinitialized. Be careful when using this in derived class destructors |
@@ -164,21 +169,20 @@ private: | |||
164 | S8 mHasExplicitFormat; // If false (default), GL format is f(mComponents) | 169 | S8 mHasExplicitFormat; // If false (default), GL format is f(mComponents) |
165 | S8 mAutoGenMips; | 170 | S8 mAutoGenMips; |
166 | 171 | ||
172 | bool mGLTextureCreated ; | ||
173 | LLGLuint mTexName; | ||
174 | U16 mWidth; | ||
175 | U16 mHeight; | ||
176 | S8 mCurrentDiscardLevel; | ||
177 | |||
167 | protected: | 178 | protected: |
168 | LLGLenum mTarget; // Normally GL_TEXTURE2D, sometimes something else (ex. cube maps) | 179 | LLGLenum mTarget; // Normally GL_TEXTURE2D, sometimes something else (ex. cube maps) |
169 | LLTexUnit::eTextureType mBindTarget; // Normally TT_TEXTURE, sometimes something else (ex. cube maps) | 180 | LLTexUnit::eTextureType mBindTarget; // Normally TT_TEXTURE, sometimes something else (ex. cube maps) |
170 | bool mInitialized; | 181 | |
171 | |||
172 | LLGLuint mTexName; | ||
173 | |||
174 | LLGLboolean mIsResident; | 182 | LLGLboolean mIsResident; |
175 | |||
176 | U16 mWidth; | ||
177 | U16 mHeight; | ||
178 | 183 | ||
179 | S8 mComponents; | 184 | S8 mComponents; |
180 | S8 mMaxDiscardLevel; | 185 | S8 mMaxDiscardLevel; |
181 | S8 mCurrentDiscardLevel; | ||
182 | S8 mDontDiscard; // Keep full res version of this image (for UI, etc) | 186 | S8 mDontDiscard; // Keep full res version of this image (for UI, etc) |
183 | 187 | ||
184 | S8 mClampS; // Need to save clamp state | 188 | S8 mClampS; // Need to save clamp state |
@@ -209,6 +213,7 @@ public: | |||
209 | static U32 sUniqueCount; // Tracks number of unique texture binds for current frame | 213 | static U32 sUniqueCount; // Tracks number of unique texture binds for current frame |
210 | static BOOL sGlobalUseAnisotropic; | 214 | static BOOL sGlobalUseAnisotropic; |
211 | 215 | ||
216 | static S32 sMaxTextureSize ; | ||
212 | #if DEBUG_MISS | 217 | #if DEBUG_MISS |
213 | BOOL mMissed; // Missed on last bind? | 218 | BOOL mMissed; // Missed on last bind? |
214 | BOOL getMissed() const { return mMissed; }; | 219 | BOOL getMissed() const { return mMissed; }; |