Reworked the way shaders are configured to reduce the amount of times clicks on buttons cause the shared shaders to reset.
This commit is contained in:
parent
19b9a4affd
commit
84a5f06dac
5 changed files with 24 additions and 25 deletions
|
@ -82,7 +82,7 @@ namespace guecs {
|
|||
std::string name;
|
||||
};
|
||||
|
||||
struct Shader {
|
||||
struct Effect {
|
||||
float duration = 0.1f;
|
||||
std::string name{"ui_shader"};
|
||||
float $u_time_end = 0.0;
|
||||
|
@ -198,8 +198,8 @@ namespace guecs {
|
|||
void render_helper(sf::RenderWindow& window, DinkyECS::Entity ent, bool is_shape, T& target) {
|
||||
sf::Shader *shader_ptr = nullptr;
|
||||
|
||||
if($world.has<Shader>(ent)) {
|
||||
auto& shader = $world.get<Shader>(ent);
|
||||
if($world.has<Effect>(ent)) {
|
||||
auto& shader = $world.get<Effect>(ent);
|
||||
|
||||
if(shader.$active) {
|
||||
auto ptr = shader.checkout_ptr();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue