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

Method setTextureSize

UnitTests/UnitTest_RTTLayer/MyGUI_RTTLayer.cpp:65–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 void RTTLayer::setTextureSize(const IntSize& _size)
66 {
67 if (mTextureSize == _size)
68 return;
69
70 mTextureSize = _size;
71 if (mTexture)
72 {
73 MyGUI::RenderManager::getInstance().destroyTexture(mTexture);
74 mTexture = nullptr;
75 }
76
77 MYGUI_ASSERT(
78 mTextureSize.width && mTextureSize.height,
79 "RTTLayer texture size must have non-zero width and height");
80 std::string name =
81 mTextureName.empty() ? MyGUI::utility::toString((size_t)this, getClassTypeName()) : mTextureName;
82 mTexture = MyGUI::RenderManager::getInstance().createTexture(name);
83 mTexture->createManual(
84 mTextureSize.width,
85 mTextureSize.height,
86 MyGUI::TextureUsage::RenderTarget,
87 MyGUI::PixelFormat::R8G8B8A8);
88
89 mOutOfDateRtt = true;
90 }
91
92 void RTTLayer::setTextureName(std::string_view _name)
93 {

Callers

nothing calls this directly

Calls 6

toStringFunction · 0.85
getClassTypeNameFunction · 0.85
destroyTextureMethod · 0.45
emptyMethod · 0.45
createTextureMethod · 0.45
createManualMethod · 0.45

Tested by

no test coverage detected