| 2247 | |
| 2248 | |
| 2249 | bool IMGUITextureLoader::DecTextureRef(TextureOpaqueHandle id, FixedString const& textureGuid) |
| 2250 | { |
| 2251 | if (!renderer_) { |
| 2252 | ERR("Unloading texture with no rendering backend?"); |
| 2253 | return false; |
| 2254 | } |
| 2255 | |
| 2256 | auto refs = refCounts_.try_get(textureGuid); |
| 2257 | if (!refs) { |
| 2258 | ERR("Trying to release reference to texture '%s' but it has no references?", textureGuid.GetString()); |
| 2259 | return false; |
| 2260 | } |
| 2261 | |
| 2262 | if (--refs->RefCount == 0) { |
| 2263 | refCounts_.remove(textureGuid); |
| 2264 | pendingUnloads_.set(textureGuid, TextureUnloadRequest{ id, DeleteAfterFrames }); |
| 2265 | } |
| 2266 | |
| 2267 | return true; |
| 2268 | } |
| 2269 | |
| 2270 | std::optional<TextureLoadResult> IMGUIManager::RegisterTexture(FixedString const& textureGuid) |
| 2271 | { |
no test coverage detected