Renderer of ANSI codes to SFML is now working. Does seem to be a little slow but that'll be easy to fix later.

This commit is contained in:
Zed A. Shaw 2024-11-02 03:53:33 -04:00
parent ae484bf425
commit a36b187879
8 changed files with 96 additions and 62 deletions

View file

@ -2,6 +2,6 @@
#include <string_view>
#include <SFML/Graphics.hpp>
typedef std::function<void(sf::Color bgcolor, sf::Color color, char ch)> WriteCB;
typedef std::function<void(sf::Color bgcolor, sf::Color color, wchar_t ch)> WriteCB;
bool parse_ansi(std::string_view codes, sf::Color default_fg, sf::Color default_bg, WriteCB write);
bool parse_ansi(std::wstring_view codes, sf::Color default_fg, sf::Color default_bg, WriteCB write);