00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _ABSTRACTRENDERER_
00019 #define _ABSTRACTRENDERER_
00020
00021 #include <string>
00022
00023 #include "util/Colour.h"
00024 #include "util/LineVertex.h"
00025 #include "util/Model.h"
00026 #include "util/Rect.h"
00027 #include "util/Vector2.h"
00028
00029 struct Sprite;
00030 class Vector2;
00031 class ResourceCache;
00032
00036 enum TEXTALIGNMENT
00037 {
00038 TEXTALIGNMENT_TOP = 0x01,
00039 TEXTALIGNMENT_BOTTOM = 0x02,
00040 TEXTALIGNMENT_LEFT = 0x04,
00041 TEXTALIGNMENT_RIGHT = 0x08,
00042 TEXTALIGNMENT_VCENTER = 0x10,
00043 TEXTALIGNMENT_HCENTER = 0x20
00044 };
00045
00054 class AbstractRenderer
00055 {
00056 public:
00060 virtual ~AbstractRenderer() { }
00061
00066 virtual void BeginRendering() = 0;
00067
00072 virtual void EndRendering() = 0;
00073
00080 virtual void SetClearColour(const Colour& c) = 0;
00081
00091 virtual void DrawLines(const LineVertex* pVertices, const int nNumPoints, const int nWidth, const float fTranslateX, const float fTranslateY, const float fRotation) = 0;
00092
00103 virtual void DrawSprite(const Sprite* pSprite, ResourceCache * const pResourceCache, const Vector2& position, const Vector2 & center, const float fRotation, const float fScaleX, const float fScaleY) = 0;
00104
00117 virtual void DrawString(const std::wstring& text, const std::string& font, const int nSize, const Vector2& position, const int nAlignment, const Colour& c, bool bBold, bool bItalic) = 0;
00118
00130 virtual void DrawText(const std::wstring& text, const std::string& font, const int nSize, const Rect& rect, const int nAlignment, Colour& c, bool bBold, bool bItalic) = 0;
00131
00139 virtual void DrawModel(const PTModel& model, const Vector2& translation, const float fRotation, const float fScale) = 0;
00140
00146 virtual bool CanRender() = 0;
00147
00152 virtual std::pair<int, int> GetResolution() = 0;
00153
00159 virtual void ClearArea(const Rect& rect, const Colour& c) = 0;
00160
00171 virtual int GetStringWidth(const std::wstring& textString, const std::string& font, const int nFontHeight, bool bBold, bool bItalic) = 0;
00172 };
00173
00174
00175 #endif