| 728 | } |
| 729 | |
| 730 | TexturePtr OpenGlRenderer::GlTextureGroup::create(Image const& texture) { |
| 731 | // If the image is empty, or would not fit in the texture atlas with border |
| 732 | // pixels, just create a regular texture |
| 733 | Vec2U atlasTextureSize = textureAtlasSet.atlasTextureSize(); |
| 734 | if (texture.empty() || texture.width() + 2 > atlasTextureSize[0] || texture.height() + 2 > atlasTextureSize[1]) |
| 735 | return createGlTexture(texture, TextureAddressing::Clamp, textureAtlasSet.textureFiltering); |
| 736 | |
| 737 | auto glGroupedTexture = make_ref<GlGroupedTexture>(); |
| 738 | glGroupedTexture->parentGroup = shared_from_this(); |
| 739 | glGroupedTexture->parentAtlasTexture = textureAtlasSet.addTexture(texture); |
| 740 | |
| 741 | return glGroupedTexture; |
| 742 | } |
| 743 | |
| 744 | OpenGlRenderer::GlGroupedTexture::~GlGroupedTexture() { |
| 745 | if (parentAtlasTexture) |
nothing calls this directly
no test coverage detected