Skip to content

Commit

Permalink
Merge pull request #59 from hotstreams/feature/add-decal-instance-set…
Browse files Browse the repository at this point in the history
…-material

add DecalInstance::setMaterial()
  • Loading branch information
hotstreams authored Jun 10, 2024
2 parents 2b0f9d9 + 7403012 commit 74d1737
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/limitless/instances/decal_instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace Limitless {
void updateBoundingBox() noexcept override;
std::unique_ptr<Instance> clone() noexcept override;

void setMaterial(std::shared_ptr<ms::Material> new_material);

void draw(Context& ctx, const Assets& assets, ShaderType shader_type, ms::Blending blending, const UniformSetter& uniform_set) override;
};
}
4 changes: 4 additions & 0 deletions src/limitless/instances/decal_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ void DecalInstance::draw(Context &ctx, const Assets &assets, ShaderType shader_t
model->getMeshes()[0]->draw();
}

void DecalInstance::setMaterial(std::shared_ptr<ms::Material> new_material) {
material = std::make_shared<ms::Material>(*new_material);
}

void DecalInstance::updateBoundingBox() noexcept {

}
Expand Down

0 comments on commit 74d1737

Please sign in to comment.