MCPcopy Create free account
hub / github.com/MyGUI/mygui / loadFromFile

Method loadFromFile

Platforms/Ogre/OgrePlatform/src/MyGUI_OgreTexture.cpp:206–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204 }
205
206 void OgreTexture::loadFromFile(const std::string& _filename)
207 {
208 setUsage(TextureUsage::Default);
209
210 auto createResult = Ogre::TextureManager::getSingleton().createOrRetrieve(
211 _filename,
212 OgreDataManager::getInstance().getGroup(),
213 false,
214 nullptr,
215 nullptr,
216 Ogre::TEX_TYPE_2D,
217 0);
218 if (!createResult.second)
219 {
220 MYGUI_PLATFORM_LOG(Error, "Texture '" + _filename + "' not found, set default texture");
221 }
222 else
223 {
224 mTexture = std::static_pointer_cast<Ogre::Texture>(createResult.first);
225 if (!mTexture->isLoaded())
226 mTexture->load();
227 }
228
229 setFormatByOgreTexture();
230 }
231
232 void OgreTexture::setFormatByOgreTexture()
233 {

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected