Pyrogenesis  trunk
DecalRData.h
Go to the documentation of this file.
1 /* Copyright (C) 2015 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INCLUDED_DECALRDATA
19 #define INCLUDED_DECALRDATA
20 
21 #include "graphics/Camera.h"
24 #include "renderer/VertexArray.h"
25 
26 class CModelDecal;
27 class CShaderDefines;
28 class CSimulation2;
29 class ShadowMap;
30 
31 class CDecalRData : public CRenderData
32 {
33 public:
34  CDecalRData(CModelDecal* decal, CSimulation2* simulation);
35  ~CDecalRData();
36 
37  void Update(CSimulation2* simulation);
38 
39  static void RenderDecals(std::vector<CDecalRData*>& decals, const CShaderDefines& context,
40  ShadowMap* shadow, bool isDummyShader=false, const CShaderProgramPtr& dummy=CShaderProgramPtr());
41 
42  CModelDecal* GetDecal() { return m_Decal; }
43 
44 private:
45  void BuildArrays();
46 
48 
54 
56 
58 };
59 
60 #endif // INCLUDED_DECALRDATA
Definition: DecalRData.h:31
CSimulation2 * m_Simulation
Definition: DecalRData.h:57
~CDecalRData()
Definition: DecalRData.cpp:63
VertexArray::Attribute m_UV
Definition: DecalRData.h:53
VertexArray::Attribute m_Position
Definition: DecalRData.h:50
Class ShadowMap: Maintain the shadow map texture and perform necessary OpenGL setup, including matrix calculations.
Definition: ShadowMap.h:39
VertexArray::Attribute m_DiffuseColor
Definition: DecalRData.h:52
CDecalRData(CModelDecal *decal, CSimulation2 *simulation)
Definition: DecalRData.cpp:41
Public API for simulation system.
Definition: Simulation2.h:47
A VertexArray that is specialised to handle 16-bit array indices.
Definition: VertexArray.h:214
VertexArray::Attribute m_Normal
Definition: DecalRData.h:51
void Update(CSimulation2 *simulation)
Definition: DecalRData.cpp:67
VertexArray m_Array
Definition: DecalRData.h:49
CModelDecal * m_Decal
Definition: DecalRData.h:55
Definition: RenderableObject.h:41
Definition: VertexArray.h:135
CModelDecal * GetDecal()
Definition: DecalRData.h:42
Definition: VertexArray.h:132
VertexIndexArray m_IndexArray
Definition: DecalRData.h:47
Represents a mapping of name strings to value strings, for use with #if and #ifdef and similar condit...
Definition: ShaderDefines.h:133
void BuildArrays()
Definition: DecalRData.cpp:195
Definition: Decal.h:50
static void RenderDecals(std::vector< CDecalRData * > &decals, const CShaderDefines &context, ShadowMap *shadow, bool isDummyShader=false, const CShaderProgramPtr &dummy=CShaderProgramPtr())
Definition: DecalRData.cpp:77
std::shared_ptr< CShaderProgram > CShaderProgramPtr
Definition: ShaderProgramPtr.h:25