1 #ifndef OSDCONSOLERENDERER_HH
2 #define OSDCONSOLERENDERER_HH
15 #include <string_view>
29 unsigned screenW,
unsigned screenH,
bool openGL);
33 [[nodiscard]]
int initFontAndGetColumns();
34 [[nodiscard]]
int getRows();
43 void setActive(
bool active);
45 bool updateConsoleRect();
46 void loadFont (std::string_view value);
47 void loadBackground(std::string_view value);
48 byte getVisibility()
const;
50 int cx,
int cy,
byte alpha, uint32_t rgb);
51 [[nodiscard]]
gl::ivec2 getTextPos(
int cursorX,
int cursorY)
const;
54 [[nodiscard]] std::tuple<bool, BaseImage*, unsigned> getFromCache(
55 std::string_view text, uint32_t rgb);
56 void insertInCache(std::string text, uint32_t rgb,
57 std::unique_ptr<BaseImage>
image,
unsigned width);
62 CP_TOPLEFT, CP_TOP, CP_TOPRIGHT,
63 CP_LEFT, CP_CENTER, CP_RIGHT,
64 CP_BOTTOMLEFT, CP_BOTTOM, CP_BOTTOMRIGHT
67 struct TextCacheElement {
68 TextCacheElement(std::string text_, uint32_t rgb_,
69 std::unique_ptr<BaseImage> image_,
unsigned width_)
70 : text(std::move(text_)),
image(std::move(image_))
71 , rgb(rgb_), width(width_) {}
74 std::unique_ptr<BaseImage>
image;
78 using TextCache = std::list<TextCacheElement>;
84 const unsigned screenW;
85 const unsigned screenH;
90 TextCache::iterator cacheHint;
98 std::unique_ptr<BaseImage> backgroundImage;
100 uint64_t lastBlinkTime;
104 unsigned lastCursorX;
105 unsigned lastCursorY;
Represents the output window/screen of openMSX.
A Setting with an integer value.
Interface for display layers.
OSDConsoleRenderer(Reactor &reactor, CommandConsole &console, unsigned screenW, unsigned screenH, bool openGL)
~OSDConsoleRenderer() override
Generic Gang-of-Four Observer class, templatized edition.
A frame buffer where pixels can be written to.
Contains the main loop of openMSX.
This file implemented 3 utility functions: