| 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 | { |
nothing calls this directly
no test coverage detected