#pragma once #include #include #include #include #include namespace evo::render { inline constexpr std::size_t max_rectangles = 4096; struct Color { std::uint8_t red{}, green{}, blue{}, alpha{255}; }; struct Rectangle { float x{}, y{}, width{}, height{}; Color color; }; enum class FrameError : std::uint8_t { too_many_primitives, invalid_geometry }; // Owns copied logical-window coordinates; never stores simulation/native handles. class Frame { public: [[nodiscard]] static std::expected create(std::span rectangles, Color background = {}); [[nodiscard]] std::span rectangles() const noexcept { return rectangles_; } [[nodiscard]] Color background() const noexcept { return background_; } private: Frame(std::span rectangles, Color background) : rectangles_(rectangles.begin(), rectangles.end()), background_{background} {} std::vector rectangles_; Color background_; }; } // namespace evo::render