about summary refs log tree commit diff
path: root/src/engine/textrender.h
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2010-05-29 07:25:38 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2010-05-29 07:25:38 +0000
commit72c06a258940696093f255fb1061beb58e1cdd0b (patch)
tree36b9a7712eec2d4f07837eab9c38ef1c5af85319 /src/engine/textrender.h
parente56feb597bc743677633432f77513b02907fd169 (diff)
downloadzcatch-72c06a258940696093f255fb1061beb58e1cdd0b.tar.gz
zcatch-72c06a258940696093f255fb1061beb58e1cdd0b.zip
copied refactor to trunk
Diffstat (limited to 'src/engine/textrender.h')
-rw-r--r--src/engine/textrender.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/engine/textrender.h b/src/engine/textrender.h
new file mode 100644
index 00000000..7c7e036b
--- /dev/null
+++ b/src/engine/textrender.h
@@ -0,0 +1,60 @@
+#ifndef ENGINE_TEXTRENDER_H
+#define ENGINE_TEXTRENDER_H
+#include "kernel.h"
+
+enum
+{
+	TEXTFLAG_RENDER=1,
+	TEXTFLAG_ALLOW_NEWLINE=2,
+	TEXTFLAG_STOP_AT_END=4
+};
+
+class CFont;
+
+class CTextCursor
+{
+public:
+	int m_Flags;
+	int m_LineCount;
+	int m_CharCount;
+	
+	float m_StartX;
+	float m_StartY;
+	float m_LineWidth;
+	float m_X, m_Y;
+	
+	struct CFont *m_pFont;
+	float m_FontSize;
+};
+
+class ITextRender : public IInterface
+{
+	MACRO_INTERFACE("textrender", 0)
+public:
+	virtual void SetCursor(CTextCursor *pCursor, float x, float y, float FontSize, int Flags) = 0;
+	
+	virtual CFont *LoadFont(const char *pFilename) = 0;
+	virtual void DestroyFont(CFont *pFont) = 0;
+	
+	virtual void SetDefaultFont(struct CFont *pFont) = 0;
+
+	//
+	virtual void TextEx(CTextCursor *pCursor, const char *pText, int Length) = 0;
+	
+	// old foolish interface
+	virtual void TextColor(float r, float g, float b, float a) = 0;
+	virtual void Text(void *pFontSetV, float x, float y, float Size, const char *pText, int MaxWidth) = 0;
+	virtual float TextWidth(void *pFontSetV, float Size, const char *pText, int Length) = 0;
+	virtual float TextLineCount(void *pFontSetV, float Size, const char *pText, int LineWidth) = 0;
+};
+
+class IEngineTextRender : public ITextRender
+{
+	MACRO_INTERFACE("enginetextrender", 0)
+public:
+	virtual void Init() = 0;
+};
+
+extern IEngineTextRender *CreateEngineTextRender();
+
+#endif