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

Method checkTexture

UnitTests/UnitTest_TextureAnimations/MyGUI_RTTLayerNode.cpp:212–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210 }
211
212 void RTTLayerNode::checkTexture()
213 {
214 if (mTextureSize.width < mCurrentCoord.width || mTextureSize.height < mCurrentCoord.height)
215 {
216 //RenderManager& render = RenderManager::getInstance();
217
218 if (mTexture != nullptr)
219 {
220 MyGUI::RenderManager::getInstance().destroyTexture(mTexture);
221 mTexture = nullptr;
222 }
223
224 if (mCurrentCoord.width > 0 && mCurrentCoord.height > 0)
225 {
226 mTextureSize.set(
227 MyGUI::Bitwise::firstPO2From(mCurrentCoord.width),
228 MyGUI::Bitwise::firstPO2From(mCurrentCoord.height));
229 mTexture =
230 MyGUI::RenderManager::getInstance().createTexture(utility::toString((size_t)this, "_texture_node"));
231 mTexture->createManual(
232 mTextureSize.width,
233 mTextureSize.height,
234 TextureUsage::RenderTarget,
235 PixelFormat::R8G8B8A8);
236 }
237 }
238 }
239
240 void RTTLayerNode::outOfDate(RenderItem* _item)
241 {

Callers

nothing calls this directly

Calls 6

firstPO2FromFunction · 0.85
toStringFunction · 0.85
destroyTextureMethod · 0.45
setMethod · 0.45
createTextureMethod · 0.45
createManualMethod · 0.45

Tested by

no test coverage detected