diff --git a/control.cpp b/control.cpp index c027096..c884e32 100644 --- a/control.cpp +++ b/control.cpp @@ -15,6 +15,7 @@ ControlUI::ControlUI(sf::RenderWindow& presenter) : $presenter(presenter) { + $gui.position(0, 0, CONTROL_WIDTH, CONTROL_HEIGHT); $gui.layout( "[status|=%(100,100)current]" @@ -31,11 +32,9 @@ void ControlUI::init() { auto current = $gui.entity("current"); $gui.set(current, {L"Current Slide"}); - $gui.set(current, {}); auto next = $gui.entity("next"); $gui.set(next, {L"Next Slide"}); - $gui.set(next, {}); $gui.init(); @@ -52,8 +51,8 @@ void ControlUI::render(sf::RenderWindow& window) { $status->update(fmt::format(L"pos={},{}\nsize={},{}", pos.x, pos.y, size.x, size.y)); - window.clear(); + $gui.render(window); } diff --git a/control.hpp b/control.hpp index baf632a..aa305ad 100644 --- a/control.hpp +++ b/control.hpp @@ -2,6 +2,7 @@ #include "guecs/sfml/components.hpp" #include "guecs/ui.hpp" +#include "slides.hpp" struct ControlUI { guecs::UI $gui; diff --git a/slides.cpp b/slides.cpp index bbad3bd..4b5e76a 100644 --- a/slides.cpp +++ b/slides.cpp @@ -114,7 +114,6 @@ void SlidesUI::show_slide() { void SlidesUI::render(sf::RenderWindow& window) { $gui.render(window); - auto& slide = current(); slide.render(window); diff --git a/slides.hpp b/slides.hpp index 60c1345..be30c8e 100644 --- a/slides.hpp +++ b/slides.hpp @@ -14,6 +14,9 @@ struct Slide { bool $initialized = false; Slide(const std::string& title, const std::string& content, nlohmann::json& config); + + Slide() {} + void init(lel::Cell& cell); void render(sf::RenderWindow& window); };