-----------------------------------------------------------------------
| 240 | } |
| 241 | //----------------------------------------------------------------------- |
| 242 | void TextureUnitState::setTexture( const TexturePtr& texPtr) |
| 243 | { |
| 244 | if (!texPtr) |
| 245 | { |
| 246 | OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, |
| 247 | "Texture Pointer is empty.", |
| 248 | "TextureUnitState::setTexture"); |
| 249 | } |
| 250 | |
| 251 | setContentType(CONTENT_NAMED); |
| 252 | mTextureLoadFailed = false; |
| 253 | |
| 254 | if (texPtr->getTextureType() == TEX_TYPE_EXTERNAL_OES) |
| 255 | { |
| 256 | setTextureAddressingMode( TAM_CLAMP ); |
| 257 | setTextureFiltering(FT_MIP, FO_NONE); |
| 258 | } |
| 259 | |
| 260 | mFramePtrs.resize(1); |
| 261 | mFramePtrs[0] = texPtr; |
| 262 | |
| 263 | mCurrentFrame = 0; |
| 264 | |
| 265 | // Load immediately ? |
| 266 | if (isLoaded()) |
| 267 | { |
| 268 | _load(); // reload |
| 269 | } |
| 270 | // Tell parent to recalculate hash |
| 271 | if( Pass::getHashFunction() == Pass::getBuiltinHashFunction( Pass::MIN_TEXTURE_CHANGE ) ) |
| 272 | { |
| 273 | mParent->_dirtyHash(); |
| 274 | } |
| 275 | } |
| 276 | //----------------------------------------------------------------------- |
| 277 | void TextureUnitState::setContentType(TextureUnitState::ContentType ct) |
| 278 | { |