22 #ifndef FIFE_TARGETRENDERER_H
23 #define FIFE_TARGETRENDERER_H
33 #include "view/renderers/offrenderer.h"
38 friend class TargetRenderer;
44 void addLine(
const std::string &group, Point n1, Point n2, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255);
45 void addPoint(
const std::string &group, Point n, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255);
46 void addTriangle(
const std::string &group, Point n1, Point n2, Point n3, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255);
47 void addQuad(
const std::string &group, Point n1, Point n2, Point n3, Point n4, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255);
48 void addVertex(
const std::string &group, Point n, int32_t size, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255);
49 void addText(
const std::string &group, Point n, IFont* font,
const std::string &text);
50 void addImage(
const std::string &group, Point n, ImagePtr image);
51 void addAnimation(
const std::string &group, Point n, AnimationPtr animation);
52 void resizeImage(
const std::string &group, Point n, ImagePtr image, int32_t width, int32_t height);
53 void removeAll(
const std::string &group);
57 ImagePtr getTarget() {
return m_target; }
59 RenderTarget(RenderBackend* rb,
const std::string& name, uint32_t width, uint32_t height);
60 RenderTarget(RenderBackend* rb, ImagePtr& image);
63 RenderTarget(
const RenderTarget& rhs);
64 RenderTarget& operator=(
const RenderTarget& rhs);
66 std::map<std::string, std::vector<OffRendererElementInfo*> > m_groups;
67 RenderBackend* m_renderbackend;
70 typedef SharedPtr<RenderTarget> RenderTargetPtr;
72 class TargetRenderer {
77 TargetRenderer(RenderBackend* renderbackend);
81 virtual ~TargetRenderer();
85 RenderTargetPtr createRenderTarget(
const std::string& name, uint32_t width, uint32_t height);
86 RenderTargetPtr createRenderTarget(ImagePtr& image);
92 void setRenderTarget(
const std::string& targetname,
bool discard, int32_t ndraws = 0);
98 int32_t lasttime_draw;
99 RenderTargetPtr target;
102 typedef std::map<std::string, RenderJob> RenderJobMap;
103 RenderJobMap m_targets;
104 RenderBackend* m_renderbackend;
credit to phoku for his NodeDisplay example which the visitor code is adapted from ( he coded the qua...