41#ifndef RENDER2DSENTENCE_H
42#define RENDER2DSENTENCE_H
91 bool Is_Font(
const char *font_name,
int point_size,
bool is_bold );
100 void Blit_Char( WCHAR ch,
uint16 *dest_ptr,
int dest_stride,
int x,
int y );
107 void Create_GDI_Font(
const char *font_name );
108 void Free_GDI_Font(
void );
110 void Update_Current_Buffer(
int char_width );
113 void Grow_Unicode_Array( WCHAR ch );
114 void Free_Character_Arrays(
void );
129 HBITMAP OldGDIBitmap;
132 uint8 * GDIBitmapBits;
151 virtual void Reset (
void);
165 Centered = isCentered;
211 struct SentenceDataStruct {
216 bool operator== (
const SentenceDataStruct &src) {
return false; }
217 bool operator!= (
const SentenceDataStruct &src) {
return true; }
220 struct PendingSurfaceStruct {
221 SurfaceClass * Surface;
222 DynamicVectorClass<Render2DClass *> Renderers;
224 bool operator== (
const PendingSurfaceStruct &src) {
return false; }
225 bool operator!= (
const PendingSurfaceStruct &src) {
return true; }
228 struct RendererDataStruct {
229 Render2DClass * Renderer;
230 SurfaceClass * Surface;
232 bool operator== (
const RendererDataStruct &src) {
return false; }
233 bool operator!= (
const RendererDataStruct &src) {
return true; }
239 void Reset_Sentence_Data (
void);
240 void Build_Textures (
void);
241 void Record_Sentence_Chunk (
void);
242 void Allocate_New_Surface (
const WCHAR *text,
bool justCalcExtents =
false);
243 void Release_Pending_Surfaces (
void);
244 void Build_Sentence_Centered (
const WCHAR *text,
int *hkX,
int *hkY);
245 Vector2 Build_Sentence_Not_Centered (
const WCHAR *text,
int *hkX,
int *hkY,
bool justCalcExtents =
false );
249 DynamicVectorClass<SentenceDataStruct> SentenceData;
250 DynamicVectorClass<PendingSurfaceStruct> PendingSurfaces;
251 DynamicVectorClass<RendererDataStruct> Renderers;
252 FontCharsClass * Font;
253 Vector2 BaseLocation;
256 Vector2i TextureOffset;
260 SurfaceClass * CurSurface;
265 RectClass DrawExtents;
266 bool IsClippedEnabled;
268 bool useHardWordWrap;
272 TextureClass * CurTexture;
#define W3DMPO_GLUE(ARGCLASS)
uint16 Buffer[CHAR_BUFFER_LEN]
int Get_Char_Height(void)
void Initialize_GDI_Font(const char *font_name, int point_size, bool is_bold)
const char * Get_Name(void)
void Blit_Char(WCHAR ch, uint16 *dest_ptr, int dest_stride, int x, int y)
FontCharsClass * AlternateUnicodeFont
int Get_Extra_Overlap(void)
bool Is_Font(const char *font_name, int point_size, bool is_bold)
int Get_Char_Spacing(WCHAR ch)
int Get_Char_Width(WCHAR ch)
bool Is_Clipping_Enabled(void) const
void Set_Base_Location(const Vector2 &loc)
Vector2 Get_Formatted_Text_Extents(const WCHAR *text)
void Build_Sentence(const WCHAR *text, int *hkX, int *hkY)
const RectClass & Get_Draw_Extents(void)
void Set_Mono_Spaced(bool onoff)
void Set_Clipping_Rect(const RectClass &rect)
Render2DSentenceClass(void)
void Enable_Clipping(bool onoff)
Vector2 Get_Text_Extents(const WCHAR *text)
void Set_Font(FontCharsClass *font)
FontCharsClass * Peek_Font(void)
void Draw_Sentence(uint32 color=0xFFFFFFFF)
void Set_Texture_Size_Hint(int hint)
void Set_Hot_Key_Parse(bool parseHotKey)
void Set_Shader(ShaderClass shader)
ShaderClass Get_Shader(void) const
int Get_Texture_Size_Hint(void) const
bool Set_Wrapping_Width(float width)
void Set_Location(const Vector2 &loc)
void Set_Use_Hard_Word_Wrap(bool useHardWrap)
bool Set_Word_Wrap_Centered(bool isCentered)