Topic/atlas tex 2d (#1194)

Co-authored-by: mwilsnd <mwilsnd@gmail.com>
This commit is contained in:
Tim Sylvester
2023-06-02 08:11:12 -07:00
committed by Bart Louwers
parent e771363d4b
commit 4cac8a8dfb
43 changed files with 552 additions and 190 deletions

View File

@@ -96,14 +96,32 @@ std::optional<ImagePosition> RenderTile::getPattern(const std::string& pattern)
return renderData->getPattern(pattern);
}
const gfx::Texture& RenderTile::getGlyphAtlasTexture() const {
assert(renderData);
return renderData->getGlyphAtlasTexture();
static const gfx::Texture2DPtr noTexture;
bool RenderTile::hasGlyphAtlasTexture() const {
return renderData && renderData->getGlyphAtlasTexture();
}
const gfx::Texture& RenderTile::getIconAtlasTexture() const {
assert(renderData);
return renderData->getIconAtlasTexture();
const gfx::Texture2DPtr& RenderTile::getGlyphAtlasTexture() const {
return renderData ? renderData->getGlyphAtlasTexture() : noTexture;
}
gfx::TextureBinding RenderTile::getGlyphAtlasTextureBinding(gfx::TextureFilterType filter) const {
assert(renderData && renderData->getGlyphAtlasTexture());
return {getGlyphAtlasTexture()->getResource(), filter};
}
bool RenderTile::hasIconAtlasTexture() const {
return renderData && renderData->getIconAtlasTexture();
}
const gfx::Texture2DPtr& RenderTile::getIconAtlasTexture() const {
return renderData ? renderData->getIconAtlasTexture() : noTexture;
}
gfx::TextureBinding RenderTile::getIconAtlasTextureBinding(gfx::TextureFilterType filter) const {
assert(renderData && renderData->getIconAtlasTexture());
return {getIconAtlasTexture()->getResource(), filter};
}
void RenderTile::upload(gfx::UploadPass& uploadPass) const {