MCPcopy Create free account
hub / github.com/OGRECave/ogre / setTexture

Method setTexture

OgreMain/src/OgreTextureUnitState.cpp:242–275  ·  view source on GitHub ↗

-----------------------------------------------------------------------

Source from the content-addressed store, hash-verified

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 {

Callers 15

createMaterialMethod · 0.80
loadImplMethod · 0.80
_create_image_backgroundFunction · 0.80
generateMethod · 0.80
preAddToRenderStateMethod · 0.80
setupContentMethod · 0.80
collectPassesMethod · 0.80
createTexturesMethod · 0.80
preAddToRenderStateMethod · 0.80
prepareCircleMaterialFunction · 0.80

Calls 7

setTextureAddressingModeFunction · 0.85
setTextureFilteringFunction · 0.85
getHashFunctionFunction · 0.85
getTextureTypeMethod · 0.80
_dirtyHashMethod · 0.80
isLoadedFunction · 0.50
resizeMethod · 0.45

Tested by 1

setupContentMethod · 0.64