FIFE
2008.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
All
Classes
Namespaces
Functions
Variables
Enumerations
Enumerator
Pages
rendererbase.h
1
/***************************************************************************
2
* Copyright (C) 2005-2008 by the FIFE team *
3
* http://www.fifengine.de *
4
* This file is part of FIFE. *
5
* *
6
* FIFE is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Lesser General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2.1 of the License, or (at your option) any later version. *
10
* *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14
* Lesser General Public License for more details. *
15
* *
16
* You should have received a copy of the GNU Lesser General Public *
17
* License along with this library; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20
***************************************************************************/
21
22
#ifndef FIFE_RENDERERBASE_H
23
#define FIFE_RENDERERBASE_H
24
25
// Standard C++ library includes
26
#include <list>
27
#include <vector>
28
29
// 3rd party library includes
30
31
// FIFE includes
32
// These includes are split up in two parts, separated by one empty line
33
// First block: files included from the FIFE root src directory
34
// Second block: files included from the same folder
35
36
#include "renderitem.h"
37
38
namespace
FIFE {
39
class
Camera;
40
class
Layer;
41
class
Map;
42
class
Instance;
43
class
RenderBackend;
44
45
class
RendererBase;
50
class
IRendererListener
{
51
public
:
52
virtual
~
IRendererListener
() {}
53
56
virtual
void
onRendererPipelinePositionChanged
(
RendererBase
* renderer) = 0;
57
60
virtual
void
onRendererEnabledChanged
(
RendererBase
* renderer) = 0;
61
};
62
66
class
IRendererContainer
{
67
public
:
68
virtual
~
IRendererContainer
() {}
69
72
virtual
RendererBase
*
getRenderer
(
const
std::string& renderername) = 0;
73
};
74
78
class
RendererBase
{
79
public
:
84
RendererBase
(
RenderBackend
* renderbackend,
int
position);
85
88
RendererBase
(
const
RendererBase
& old);
89
92
virtual
RendererBase
*
clone
() = 0;
93
96
virtual
~RendererBase
() {};
97
109
virtual
void
render
(
Camera
* cam,
Layer
* layer, RenderList& instances) = 0;
110
113
virtual
std::string
getName
() = 0;
114
117
int
getPipelinePosition
()
const
{
return
m_pipeline_position; }
118
124
void
setPipelinePosition
(
int
position);
125
128
virtual
void
setEnabled
(
bool
enabled);
129
132
virtual
void
reset
() {}
133
136
bool
isEnabled
()
const
{
return
m_enabled; }
137
140
void
setRendererListener
(
IRendererListener
* listener) { m_listener = listener; }
141
144
void
addActiveLayer
(
Layer
* layer);
145
148
void
removeActiveLayer
(
Layer
* layer);
149
152
void
clearActiveLayers
();
153
156
void
activateAllLayers
(
Map
* elevation);
157
160
bool
isActivedLayer
(
Layer
* layer);
161
164
std::list<Layer*>
getActiveLayers
()
const
{
return
m_active_layers;}
165
166
167
protected
:
168
RendererBase
();
169
170
std::list<Layer*> m_active_layers;
171
RenderBackend
* m_renderbackend;
172
173
private
:
174
bool
m_enabled;
175
int
m_pipeline_position;
176
IRendererListener
* m_listener;
177
};
178
}
179
180
#endif
engine
core
view
rendererbase.h
Generated on Fri Jun 8 2012 20:34:15 for FIFE by
1.8.1