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

Method createOrRetrieve

OgreMain/src/OgreTextureManager.cpp:93–115  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

91 }
92 //-----------------------------------------------------------------------
93 TextureManager::ResourceCreateOrRetrieveResult TextureManager::createOrRetrieve(
94 const String &name, const String& group, bool isManual, ManualResourceLoader* loader,
95 const NameValuePairList* createParams, TextureType texType, int numMipmaps, Real gamma,
96 bool isAlpha, PixelFormat desiredFormat, bool hwGamma)
97 {
98 ResourceCreateOrRetrieveResult res =
99 Ogre::ResourceManager::createOrRetrieve(name, group, isManual, loader, createParams);
100 // Was it created?
101 if(res.second)
102 {
103 TexturePtr tex = static_pointer_cast<Texture>(res.first);
104 tex->setTextureType(texType);
105 tex->setNumMipmaps((numMipmaps == MIP_DEFAULT)? mDefaultNumMipmaps :
106 static_cast<uint32>(numMipmaps));
107 tex->setGamma(gamma);
108 OGRE_IGNORE_DEPRECATED_BEGIN
109 tex->setTreatLuminanceAsAlpha(isAlpha);
110 OGRE_IGNORE_DEPRECATED_END
111 tex->setFormat(desiredFormat);
112 tex->setHardwareGammaEnabled(hwGamma);
113 }
114 return res;
115 }
116 //-----------------------------------------------------------------------
117 TexturePtr TextureManager::prepare(const String &name, const String& group, TextureType texType,
118 int numMipmaps, Real gamma, bool isAlpha,

Callers

nothing calls this directly

Calls 3

setNumMipmapsMethod · 0.80
setGammaMethod · 0.80

Tested by

no test coverage detected