1#ifndef OSDCONSOLERENDERER_HH
2#define OSDCONSOLERENDERER_HH
29 int screenW,
int 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_TOP_LEFT, CP_TOP, CP_TOP_RIGHT,
63 CP_LEFT, CP_CENTER, CP_RIGHT,
64 CP_BOTTOM_LEFT, CP_BOTTOM, CP_BOTTOM_RIGHT
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>;
90 TextCache::iterator cacheHint;
98 std::unique_ptr<BaseImage> backgroundImage;
100 uint64_t lastBlinkTime;
101 uint64_t activeTime{0};
104 unsigned lastCursorX{0};
105 unsigned lastCursorY{0};
Represents the output window/screen of openMSX.
A Setting with an integer value.
Interface for display layers.
OSDConsoleRenderer(Reactor &reactor, CommandConsole &console, int screenW, int 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: