Bezos2 is my latest version of the Bezos learning project that uses raw OpenGL and C++ with Lua.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#pragma once
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <any>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include "image.hpp"
|
|
|
|
|
|
|
|
|
|
enum class NodeType {
|
|
|
|
|
TEXT,
|
|
|
|
|
H1,
|
|
|
|
|
IMAGE,
|
|
|
|
|
UL,
|
|
|
|
|
ERROR,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Color {
|
|
|
|
|
uint8_t r;
|
|
|
|
|
uint8_t g;
|
|
|
|
|
uint8_t b;
|
|
|
|
|
uint8_t a;
|
|
|
|
|
|
|
|
|
|
Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) :
|
|
|
|
|
r(r), g(g), b(g), a(a)
|
|
|
|
|
{}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Node {
|
|
|
|
|
NodeType type = NodeType::ERROR;
|
|
|
|
|
std::string content = "";
|
|
|
|
|
std::unordered_map<std::string, std::any> config{};
|
|
|
|
|
std::shared_ptr<Image> image = nullptr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Slide {
|
|
|
|
|
std::vector<Node> content{};
|
|
|
|
|
std::unordered_map<std::string, std::any> config{};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Deck {
|
|
|
|
|
std::vector<Slide> slides{};
|
|
|
|
|
std::unordered_map<std::string, std::any> config{};
|
|
|
|
|
};
|