23#define KTECH_DEFINITION
24#include "../ktech.hpp"
25#undef KTECH_DEFINITION
26#include "../basic/point.hpp"
27#include "../basic/upoint.hpp"
47 static void Log(
const std::string& text,
RGB color);
49 void PrintStartupNotice(
const std::string& title,
const std::string& years,
const std::string& author,
const std::string& programName)
const;
64 HANDLE m_stdoutHandle;
66 CONSOLE_SCREEN_BUFFER_INFO m_csbi;
72 winsize m_terminalSize;
74 std::vector<Cell> m_image;
75 std::string m_stringImage;
76 static constexpr size_t printSequenceLength = 39;
81 void PopulateForegroundColor(
size_t& dst,
const RGB& src);
82 void PopulateBackgroundColor(
size_t& dst,
const RGB& src);
83 void PopulateCharacter(
size_t& dst,
size_t src);
84 void PopulateEndOfLine(
size_t& dst);
Complete engine containing all engine components.
Definition engine.hpp:41
Engine component responsible for outputting rendered images.
Definition output.hpp:42
const UPoint resolution
The size of the image buffer (viewport).
Definition output.hpp:44
void Print()
Print the internal image buffer.
Definition output.cpp:264
void PrintStartupNotice(const std::string &title, const std::string &years, const std::string &author, const std::string &programName) const
Print a copyright notice.
Definition output.cpp:87
void Clear()
Clear the image buffer.
Definition output.cpp:131
static void Log(const std::string &text, RGB color)
Print colored log text to the terminal.
Definition output.cpp:43
void Draw(const std::vector< Cell > &sourceImage, UPoint resolution, Point position=Point(0, 0), UPoint start=UPoint(0, 0), UPoint end=UPoint(0, 0), uint8_t alpha=std::numeric_limits< uint8_t >::max())
Draw a Cell-based image .
Definition output.cpp:153
auto ShouldRenderThisTick() -> bool
Check whether things changed and require a new render.
Definition output.cpp:357
auto ShouldPrintThisTick() const -> bool
Check whether the terminal changed and requires a new print.
Definition output.cpp:407
std::vector< std::string > outputOnQuit
Vector of strings to print when the game quits (specifically, in Output::~Output()).
Definition output.hpp:45
2D vector, mostly used to store positions and directions.
Definition point.hpp:30
24-bit color, able of representing 16,777,216 (2^24) different colors.
Definition rgb.hpp:29
Unsigned 2D vector, mostly used to store sizes and 2D indexes.
Definition upoint.hpp:29