Added reading texture map input from file so we can give custom names to the entries.

This commit is contained in:
2024-09-19 15:23:17 +02:00
parent cf4d4cb8a6
commit c469772afa
6 changed files with 39 additions and 12 deletions

View File

@@ -49,15 +49,9 @@ for shader_file in shader_files:
spv = env.SpirV(source = shader_file, target=f'{shader_file}.spv')
env.Default(spv)
ui_textures = Split("""
#assets/fonts/symtex.png
#assets/bitmaps/cube.png
#assets/bitmaps/sdl.png
""")
pack = env.PackTextures(
target = '#assets/bitmaps/ui.png',
source = ui_textures
source = ['#assets/bitmaps/ui_elements.txt']
)
env.Default(pack)

View File

@@ -99,7 +99,7 @@ void UIRenderer::init(Application& application)
.textureHeight = textureArgs.height
});
auto itEntry = mTextureAtlas.entries.find("assets/fonts/symtex.png");
auto itEntry = mTextureAtlas.entries.find("symtex_glyphs");
if (itEntry == mTextureAtlas.entries.end())
{
throw std::runtime_error("Texture atlas is missing entry for the font.");