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

Method createTextureGroup

source/application/StarRenderer_opengl.cpp:563–585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563TextureGroupPtr OpenGlRenderer::createTextureGroup(TextureGroupSize textureSize, TextureFiltering filtering) {
564 int maxTextureSize;
565 glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
566 maxTextureSize = min(maxTextureSize, (2 << 14));
567 // Large texture sizes are not always supported
568 if (textureSize == TextureGroupSize::Large && (m_limitTextureGroupSize || maxTextureSize < 4096))
569 textureSize = TextureGroupSize::Medium;
570
571 unsigned atlasNumCells;
572 if (textureSize == TextureGroupSize::Large)
573 atlasNumCells = 256;
574 else if (textureSize == TextureGroupSize::Medium)
575 atlasNumCells = 128;
576 else // TextureGroupSize::Small
577 atlasNumCells = 64;
578
579 Logger::info("detected supported OpenGL texture size {}, using atlasNumCells {}", maxTextureSize, atlasNumCells);
580
581 auto glTextureGroup = make_shared<GlTextureGroup>(atlasNumCells);
582 glTextureGroup->textureAtlasSet.textureFiltering = filtering;
583 m_liveTextureGroups.append(glTextureGroup);
584 return glTextureGroup;
585}
586
587RenderBufferPtr OpenGlRenderer::createRenderBuffer() {
588 return createGlRenderBuffer();

Callers 4

renderInitMethod · 0.80
EnvironmentPainterMethod · 0.80
TilePainterMethod · 0.80
renderInitMethod · 0.80

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected