annotate engine/core/view/renderers/genericrenderer.i @ 29:0cb049f291e1

make members private and prefix with m_
author spq@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 11 Jul 2008 13:00:10 +0000
parents 788cb9525b2f
children 75b6394ced14
rev   line source
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
1 %module fife
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
2 %{
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
3 #include "view/renderers/genericrenderer.h"
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
4 %}
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
5
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
6 namespace FIFE {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
7 class RenderBackend;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
8
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
9 class GenericRendererNode {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
10 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
11 GenericRendererNode(Instance* attached_instance, Location* relative_location, const Point &relative_point = Point(0,0));
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
12 GenericRendererNode(Instance* attached_instance, const Point &relative_point = Point(0,0));
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
13 GenericRendererNode(Location* attached_location, const Point &relative_point = Point(0,0));
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
14 GenericRendererNode(const Point &attached_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
15 ~GenericRendererNode();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
16
26
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
17 void setAttached(Instance* attached_instance, Location* relative_location, const Point &relative_point);
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
18 void setAttached(Instance* attached_instance, Location* relative_location);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
19 void setAttached(Instance* attached_instance, const Point &relative_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
20 void setAttached(Instance* attached_instance);
26
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
21 void setAttached(Location* attached_location, const Point &relative_point);
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
22 void setAttached(Location* attached_location);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23 void setAttached(const Point &attached_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
24
26
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
25 void setRelative(Location* relative_location);
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
26 void setRelative(Location* relative_location, Point relative_point);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
27 void setRelative(const Point &relative_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
28
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
29 Instance* getAttachedInstance();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
30 Location* getAttachedLocation();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
31 Point getAttachedPoint();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
32
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
33 Location* getOffsetLocation();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
34 Point getOffsetPoint();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
35
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
36 Instance* getInstance();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
37 Location* getLocation();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
38 Point getPoint();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
39
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
40 Point getCalculatedPoint(Camera* cam, Layer* layer, std::vector<Instance*>& instances);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
41 private:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
42 Instance* m_instance;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
43 Location* m_location;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
44 Point m_point;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
45 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
46 class GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
47 public:
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
48 virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {};
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
49 virtual ~GenericRendererElementInfo() {};
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
50 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
51
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
52 class GenericRendererLineInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
53 public:
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
54 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
55 GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
56 virtual ~GenericRendererLineInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
57 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
58 GenericRendererNode m_edge1;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
59 GenericRendererNode m_edge2;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
60 uint8_t m_red;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
61 uint8_t m_green;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
62 uint8_t m_blue;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
63 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
64 class GenericRendererPointInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
65 public:
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
66 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
67 GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
68 virtual ~GenericRendererPointInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
69 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
70 GenericRendererNode m_anchor;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
71 uint8_t m_red;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
72 uint8_t m_green;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
73 uint8_t m_blue;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
74 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
75 class GenericRendererQuadInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
76 public:
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
77 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
78 GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
79 virtual ~GenericRendererQuadInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
80 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
81 GenericRendererNode m_edge1;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
82 GenericRendererNode m_edge2;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
83 GenericRendererNode m_edge3;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
84 GenericRendererNode m_edge4;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
85 uint8_t m_red;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
86 uint8_t m_green;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
87 uint8_t m_blue;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
88 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
89 class GenericRendererImageInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
90 public:
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
91 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
92 GenericRendererImageInfo(GenericRendererNode n, int image);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
93 virtual ~GenericRendererImageInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
94 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
95 GenericRendererNode m_anchor;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
96 int m_image;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
97 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
98 class GenericRendererAnimationInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
99 public:
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
100 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
101 GenericRendererAnimationInfo(GenericRendererNode n, int animation);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
102 virtual ~GenericRendererAnimationInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
103 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
104 GenericRendererNode m_anchor;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
105 int m_animation;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
106 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
107 class GenericRendererTextInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
108 public:
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
109 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
110 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
111 virtual ~GenericRendererTextInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
112 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
113 GenericRendererNode m_anchor;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
114 AbstractFont* m_font;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
115 std::string m_text;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
116 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
117 class GenericRenderer: public RendererBase {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
118 public:
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
119 GenericRenderer(RenderBackend* renderbackend, int position, ImagePool* imagepool, AnimationPool* animpool);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
120 ~GeometricRenderer();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
121 std::string getName();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
122 static GenericRenderer* getInstance(IRendererContainer* cnt);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
123 void addLine(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
124 void addPoint(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
125 void addQuad(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
126 void addText(GenericRendererNode n, AbstractFont* font, std::string text);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
127 void addImage(GenericRendererNode n, int image);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
128 void addAnimation(GenericRendererNode n, int animation);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
129 void removeAll();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
130 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
131 }