30 #if defined(_WIN32) && defined(HR_ENGINE_SHARED) 32 # define MR_DllDeclare __declspec( dllexport ) 34 # define MR_DllDeclare __declspec( dllimport ) 37 # define MR_DllDeclare 79 font(font), width(width), height(height) { }
103 virtual MR_UInt32 CountTextures()
const = 0;
115 virtual void Prepare(
const std::string &s,
TypeLine *rects =
nullptr) = 0;
129 virtual void Render(
const TypeLine &s,
const Color color,
int x,
int y,
130 boost::optional<size_t> caret = {}) = 0;
140 double scale = 1.0) = 0;
167 return static_cast<bool>(typeCase);
178 boost::optional<size_t> caret = {})
181 typeCase->Render(*
this, color, x, y, caret);
187 std::vector<std::pair<GlyphEntry*, SDL_Rect>>
glyphs;
GlyphEntry()
Definition: TypeCase.h:53
MR_UInt32 cp
The Unicode character point represented by this glyph.
Definition: TypeCase.h:59
const int height
Definition: TypeCase.h:145
Describes a font used for the UI.
Definition: UiFont.h:44
Character-by-character text renderer.
Definition: TypeCase.h:69
const UiFont font
Definition: TypeCase.h:143
TypeLine()
Definition: TypeCase.h:159
void Render(const Color color, int x, int y, boost::optional< size_t > caret={})
Render this line using the owning TypeCase.
Definition: TypeCase.h:177
unsigned int page
Index of the texture that contains the character.
Definition: TypeCase.h:61
std::vector< std::pair< GlyphEntry *, SDL_Rect > > glyphs
Definition: TypeCase.h:187
int GetWidth() const
Retrieve the width of each of the backing textures.
Definition: TypeCase.h:91
bool IsPrepared() const
Check if this instance has been prepared.
Definition: TypeCase.h:166
int advance
The width of the glyph when placed next to other glyphs.
Definition: TypeCase.h:60
SDL_Rect srcRect
The bounds of the glyph in the texture.
Definition: TypeCase.h:62
int GetHeight() const
Retrieve the height of each of the backing textures.
Definition: TypeCase.h:97
int width
Definition: TypeCase.h:188
virtual ~TypeCase()
Definition: TypeCase.h:82
A line of text, prepared by a TypeCase.
Definition: TypeCase.h:156
bool IsInitialized() const
Definition: TypeCase.h:56
int idx
Definition: SdlDisplay.cpp:254
int height
Definition: TypeCase.h:189
std::shared_ptr< TypeCase > typeCase
Definition: TypeCase.h:186
Definition: Announcement.h:24
uint32_t MR_UInt32
Definition: MR_Types.h:44
#define MR_DllDeclare
Definition: TypeCase.h:37
TypeCase(const UiFont &font, int width, int height)
Constructor.
Definition: TypeCase.h:78
A single glyph in the backing texture.
Definition: TypeCase.h:50
const int width
Definition: TypeCase.h:144