Better design that has a render/update cycle for components.

This commit is contained in:
Zed A. Shaw 2026-04-20 16:02:13 -04:00
parent 48b672eec4
commit 2dbfac27c6
5 changed files with 38 additions and 21 deletions

View file

@ -61,6 +61,7 @@ namespace guecs {
void init(lel::Cell& cell);
void render(sf::RenderTarget& window, sf::Shader *shader_ptr);
void update();
};
// BUG: meter needs a backing rectangle of one color for the full bar, then
@ -72,17 +73,16 @@ namespace guecs {
int padding = THEME.PADDING;
bool vertical = false;
Rectangle bar{padding, color};
// this is set automatically if a Rectangle is configured for the cell
Rectangle backing_rect{padding, color};
size_t $cell_x = 0;
size_t $cell_y = 0;
size_t $cell_w = 0;
size_t $cell_h = 0;
void init(lel::Cell& cell, guecs::Rectangle &bg);
void init(lel::Cell& cell);
void render(sf::RenderTarget& window, sf::Shader *shader_ptr);
void update_percent(float pct);
void update();
};
struct Effect {