Add Texture2D and use it in PatternAtlas (#1183)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
mwilsnd
2023-05-30 11:30:18 -05:00
committed by Bart Louwers
parent a06145fe92
commit a745329eb1
18 changed files with 443 additions and 11 deletions

View File

@@ -108,6 +108,11 @@ public:
void setVertexAttrName(std::string value) { vertexAttrName = std::move(value); }
void setColorAttrName(std::string value) { colorAttrName = std::move(value); }
/// @brief Attach the given texture at the given sampler location.
/// @param texture Texture2D instance
/// @param location A sampler location in the shader being used.
void setTexture(const std::shared_ptr<gfx::Texture2D>& texture, int32_t location);
/// Set the matrix applied to new drawables
void setMatrix(mat4 value) { matrix = value; }
@@ -169,6 +174,7 @@ protected:
std::vector<UniqueDrawable> drawables;
ColorAttrMode colorAttrMode = ColorAttrMode::PerVertex;
VertexAttributeArray vertexAttrs;
gfx::Drawable::Textures textures;
struct Impl;
std::unique_ptr<Impl> impl;