MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / makeTextureInternal

Method makeTextureInternal

Source/Graphics/textures.cpp:1434–1459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1432}
1433
1434unsigned int Textures::makeTextureInternal(const TextureData& texture_data) {
1435 CHECK_GL_ERROR();
1436 unsigned which = AllocateFreeSlot();
1437
1438 TextureData* texture_data_ptr = new TextureData(texture_data);
1439 textures[which].Init();
1440 textures[which].sub_textures.resize(1);
1441 textures[which].sub_textures[0].texture_data = texture_data_ptr;
1442 textures[which].width = texture_data.GetWidth();
1443 textures[which].height = texture_data.GetHeight();
1444
1445 textures[which].wrap_s = m_wrap_s;
1446 textures[which].wrap_t = m_wrap_t;
1447 textures[which].min_filter = min_filter;
1448 textures[which].mag_filter = mag_filter;
1449
1450 textures[which].no_mipmap = true;
1451
1452 textures[which].internal_format = texture_data.GetGLInternalFormat();
1453 textures[which].format = texture_data.GetGLBaseFormat();
1454 textures[which].tex_target = GL_TEXTURE_2D;
1455
1456 TextureToVRAM(which);
1457
1458 return which;
1459}
1460
1461TextureRef Textures::makeTexture(const TextureData& texture_data) {
1462 PROFILED_TEXTURE_MUTEX_LOCK

Callers

nothing calls this directly

Calls 8

IsCompressedGLFormatFunction · 0.85
GetGLInternalFormatMethod · 0.80
GetGLBaseFormatMethod · 0.80
anisotropyMethod · 0.80
InitMethod · 0.45
resizeMethod · 0.45
GetWidthMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected