MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / create

Method create

source/application/StarRenderer_opengl.cpp:730–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728}
729
730TexturePtr 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
744OpenGlRenderer::GlGroupedTexture::~GlGroupedTexture() {
745 if (parentAtlasTexture)

Callers

nothing calls this directly

Calls 5

atlasTextureSizeMethod · 0.80
addTextureMethod · 0.80
emptyMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected