annotate engine/core/view/renderers/genericrenderer.h @ 27:788cb9525b2f

add image and text renderer to generic renderer
author spq@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 11 Jul 2008 11:57:48 +0000
parents 70f41ea8e7db
children 0cb049f291e1
rev   line source
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
1 /***************************************************************************
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
2 * Copyright (C) 2005-2008 by the FIFE Team *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
3 * http://www.fifengine.de *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
4 * This file is part of FIFE. *
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 * FIFE is free software; you can redistribute it and/or modify *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
9 * (at your option) any later version. *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
10 * *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful, *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
14 * GNU General Public License for more details. *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
15 * *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
17 * along with this program; if not, write to the *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
18 * Free Software Foundation, Inc., *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
20 ***************************************************************************/
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
21
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
22 #ifndef FIFE_GENERICRENDERER_H
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23 #define FIFE_GENERICRENDERER_H
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
24
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
25 // Standard C++ library includes
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
26
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
27 // 3rd party library includes
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 // FIFE includes
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
30 // These includes are split up in two parts, separated by one empty line
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
31 // First block: files included from the FIFE root src directory
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
32 // Second block: files included from the same folder
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
33 #include "view/rendererbase.h"
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
34
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
35 namespace FIFE {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
36 class RenderBackend;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
37 class AbstractFont;
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
38 class ImagePool;
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
39 class AnimationPool;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
40
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
41 class GenericRendererNode {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
42 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
43 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
44 GenericRendererNode(Instance* attached_instance, const Point &relative_point = Point(0,0));
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
45 GenericRendererNode(Location* attached_location, const Point &relative_point = Point(0,0));
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
46 GenericRendererNode(const Point &attached_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
47 ~GenericRendererNode();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
48
26
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
49 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
50 void setAttached(Instance* attached_instance, Location* relative_location);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
51 void setAttached(Instance* attached_instance, const Point &relative_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
52 void setAttached(Instance* attached_instance);
26
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
53 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
54 void setAttached(Location* attached_location);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
55 void setAttached(const Point &attached_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
56
26
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
57 void setRelative(Location* relative_location);
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
58 void setRelative(Location* relative_location, Point relative_point);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
59 void setRelative(const Point &relative_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
60
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
61 Instance* getAttachedInstance();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
62 Location* getAttachedLocation();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
63 Point getAttachedPoint();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
64
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
65 Location* getOffsetLocation();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
66 Point getOffsetPoint();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
67
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
68 Instance* getInstance();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
69 Location* getLocation();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
70 Point getPoint();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
71
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
72 Point getCalculatedPoint(Camera* cam, Layer* layer, std::vector<Instance*>& instances);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
73 private:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
74 Instance* m_instance;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
75 Location* m_location;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
76 Point m_point;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
77 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
78 class GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
79 public:
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
80 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
81 virtual ~GenericRendererElementInfo() {};
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
82 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
83
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
84 class GenericRendererLineInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
85 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
86 GenericRendererNode n1;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
87 GenericRendererNode n2;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
88 uint8_t r;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
89 uint8_t g;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
90 uint8_t b;
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
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 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
93 virtual ~GenericRendererLineInfo() {};
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
94 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
95 class GenericRendererPointInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
96 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
97 GenericRendererNode n;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
98 uint8_t r;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
99 uint8_t g;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
100 uint8_t b;
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
101 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
102 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
103 virtual ~GenericRendererPointInfo() {};
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
104 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
105 class GenericRendererQuadInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
106 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
107 GenericRendererNode n1;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
108 GenericRendererNode n2;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
109 GenericRendererNode n3;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
110 GenericRendererNode n4;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
111 uint8_t r;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
112 uint8_t g;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
113 uint8_t b;
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
114 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
115 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
116 virtual ~GenericRendererQuadInfo() {};
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
117 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
118 class GenericRendererImageInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
119 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
120 GenericRendererNode n;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
121 int image;
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
122 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
123 GenericRendererImageInfo(GenericRendererNode n, int image);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
124 virtual ~GenericRendererImageInfo() {};
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
125 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
126 class GenericRendererAnimationInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
127 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
128 GenericRendererNode n;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
129 int animation;
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
130 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
131 GenericRendererAnimationInfo(GenericRendererNode n, int animation);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
132 virtual ~GenericRendererAnimationInfo() {};
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
133 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
134 class GenericRendererTextInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
135 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
136 GenericRendererNode n;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
137 AbstractFont* font;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
138 std::string text;
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
139 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
140 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
141 virtual ~GenericRendererTextInfo() {};
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
142 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
143 class GenericRenderer: public RendererBase {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
144 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
145 /** constructor.
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
146 * @param renderbackend to use
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
147 * @param position position for this renderer in rendering pipeline
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
148 */
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
149 GenericRenderer(RenderBackend* renderbackend, int position, ImagePool* imagepool, AnimationPool* animpool);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
150
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
151 GenericRenderer(const GenericRenderer& old);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
152
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
153 RendererBase* clone();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
154
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
155 /** Destructor.
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
156 */
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
157 virtual ~GenericRenderer();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
158 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
159 std::string getName() { return "GenericRenderer"; }
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
160
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
161 /** Gets instance for interface access
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
162 */
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
163 static GenericRenderer* getInstance(IRendererContainer* cnt);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
164
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
165 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
166 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
167 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
168 void addText(GenericRendererNode n, AbstractFont* font, std::string text);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
169 void addImage(GenericRendererNode n, int image);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
170 void addAnimation(GenericRendererNode n, int animation);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
171 void removeAll();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
172
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
173 private:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
174 std::vector<GenericRendererElementInfo*> m_infos;
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
175 ImagePool* m_imagepool;
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
176 AnimationPool* m_animationpool;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
177 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
178
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
179 }
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
180
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
181 #endif