#pragma once
#include <SFML/Graphics.hpp>
#include <optional>

class LowLevelDisplaySFML {
public:
    LowLevelDisplaySFML(int width, int height);
    bool init();
    void draw_buffer(const uint8_t* bit_buffer);
    void refresh();
    bool isOpen() const;
    std::optional<sf::Event> pollEvent();
    void close();
private:
    int width, height;
    sf::RenderWindow window;
    sf::Texture texture;
    std::optional<sf::Sprite> sprite;
    std::vector<uint8_t> framebuffer;
};
