1 /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2 /* If you are missing that file, acquire a complete release at teeworlds.com. */
3 #ifndef ENGINE_TEXTRENDER_H
4 #define ENGINE_TEXTRENDER_H
10 TEXTFLAG_ALLOW_NEWLINE
=2,
11 TEXTFLAG_STOP_AT_END
=4
33 class ITextRender
: public IInterface
35 MACRO_INTERFACE("textrender", 0)
37 virtual void SetCursor(CTextCursor
*pCursor
, float x
, float y
, float FontSize
, int Flags
) = 0;
39 virtual CFont
*LoadFont(const char *pFilename
) = 0;
40 virtual void DestroyFont(CFont
*pFont
) = 0;
42 virtual void SetDefaultFont(CFont
*pFont
) = 0;
45 virtual void TextEx(CTextCursor
*pCursor
, const char *pText
, int Length
) = 0;
47 // old foolish interface
48 virtual void TextColor(float r
, float g
, float b
, float a
) = 0;
49 virtual void TextOutlineColor(float r
, float g
, float b
, float a
) = 0;
50 virtual void Text(void *pFontSetV
, float x
, float y
, float Size
, const char *pText
, int MaxWidth
) = 0;
51 virtual float TextWidth(void *pFontSetV
, float Size
, const char *pText
, int Length
) = 0;
52 virtual int TextLineCount(void *pFontSetV
, float Size
, const char *pText
, float LineWidth
) = 0;
55 class IEngineTextRender
: public ITextRender
57 MACRO_INTERFACE("enginetextrender", 0)
59 virtual void Init() = 0;
62 extern IEngineTextRender
*CreateEngineTextRender();