Laid out how I want the control panel to look but can't render the slides there until I get the parser nicer.

master
Zed A. Shaw 1 week ago
parent b3affcf9fa
commit 84dafe2f2e
  1. 5
      control.cpp
  2. 1
      control.hpp
  3. 1
      slides.cpp
  4. 3
      slides.hpp

@ -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<guecs::Text>(current, {L"Current Slide"});
$gui.set<guecs::Rectangle>(current, {});
auto next = $gui.entity("next");
$gui.set<guecs::Text>(next, {L"Next Slide"});
$gui.set<guecs::Rectangle>(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);
}

@ -2,6 +2,7 @@
#include "guecs/sfml/components.hpp"
#include "guecs/ui.hpp"
#include "slides.hpp"
struct ControlUI {
guecs::UI $gui;

@ -114,7 +114,6 @@ void SlidesUI::show_slide() {
void SlidesUI::render(sf::RenderWindow& window) {
$gui.render(window);
auto& slide = current();
slide.render(window);

@ -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);
};

Loading…
Cancel
Save