Refactoring the GUECS UI::render and the components so that it's just calling a .render on each one. This will then let me allow registering any components people want.
This commit is contained in:
parent
a9e219ea96
commit
4d71f552aa
7 changed files with 108 additions and 69 deletions
|
@ -21,6 +21,7 @@ namespace guecs {
|
|||
|
||||
void init(lel::Cell &cell, shared_ptr<sf::Font> font_ptr);
|
||||
void update(const std::wstring& new_content);
|
||||
void render(sf::RenderWindow& window, sf::Shader *shader_ptr);
|
||||
};
|
||||
|
||||
struct Label : public Textual {
|
||||
|
@ -49,6 +50,7 @@ namespace guecs {
|
|||
|
||||
void init(lel::Cell &cell);
|
||||
void update(const string& new_name);
|
||||
void render(sf::RenderWindow& window, sf::Shader *shader_ptr);
|
||||
};
|
||||
|
||||
struct Rectangle {
|
||||
|
@ -59,6 +61,7 @@ namespace guecs {
|
|||
shared_ptr<sf::RectangleShape> shape = nullptr;
|
||||
|
||||
void init(lel::Cell& cell);
|
||||
void render(sf::RenderWindow& window, sf::Shader *shader_ptr);
|
||||
};
|
||||
|
||||
struct Meter {
|
||||
|
@ -67,7 +70,8 @@ namespace guecs {
|
|||
Rectangle bar;
|
||||
|
||||
void init(lel::Cell& cell);
|
||||
void render(lel::Cell& cell);
|
||||
void init(lel::Cell& cell, Rectangle& bg);
|
||||
void render(lel::Cell& cell, sf::RenderWindow& window, sf::Shader *shader_ptr);
|
||||
};
|
||||
|
||||
struct Effect {
|
||||
|
@ -82,8 +86,9 @@ namespace guecs {
|
|||
void init(lel::Cell &cell);
|
||||
void run();
|
||||
void stop();
|
||||
void step();
|
||||
shared_ptr<sf::Shader> checkout_ptr();
|
||||
void render();
|
||||
sf::Shader* get_shader(bool is_shape);
|
||||
|
||||
};
|
||||
|
||||
struct Sound {
|
||||
|
@ -111,5 +116,6 @@ namespace guecs {
|
|||
Background() {}
|
||||
|
||||
void init();
|
||||
void render(sf::RenderWindow& window);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue