Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DecalRData.h
Go to the documentation of this file.
1 /* Copyright (C) 2012 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"
23 #include "graphics/ShaderProgram.h"
24 #include "renderer/ShadowMap.h"
25 #include "renderer/VertexArray.h"
26 
27 class CModelDecal;
28 class CSimulation2;
29 
30 class CDecalRData : public CRenderData
31 {
32 public:
33  CDecalRData(CModelDecal* decal, CSimulation2* simulation);
34  ~CDecalRData();
35 
36  void Update(CSimulation2* simulation);
37 
38  static void RenderDecals(std::vector<CDecalRData*>& decals, const CShaderDefines& context,
39  ShadowMap* shadow, bool isDummyShader=false, const CShaderProgramPtr& dummy=CShaderProgramPtr());
40 
41  CModelDecal* GetDecal() { return m_Decal; }
42 
43 private:
44  void BuildArrays();
45 
47 
52 
54 
56 };
57 
58 #endif // INCLUDED_DECALRDATA
CSimulation2 * m_Simulation
Definition: DecalRData.h:55
VertexArray::Attribute m_UV
Definition: DecalRData.h:51
VertexArray::Attribute m_Position
Definition: DecalRData.h:49
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:50
CDecalRData(CModelDecal *decal, CSimulation2 *simulation)
Definition: DecalRData.cpp:41
Public API for simulation system.
Definition: Simulation2.h:46
A VertexArray that is specialised to handle 16-bit array indices.
Definition: VertexArray.h:212
void Update(CSimulation2 *simulation)
Definition: DecalRData.cpp:63
VertexArray m_Array
Definition: DecalRData.h:48
CModelDecal * m_Decal
Definition: DecalRData.h:53
CModelDecal * GetDecal()
Definition: DecalRData.h:41
VertexIndexArray m_IndexArray
Definition: DecalRData.h:46
Represents a mapping of name strings to value strings, for use with #if and #ifdef and similar condit...
void BuildArrays()
Definition: DecalRData.cpp:190
static void RenderDecals(std::vector< CDecalRData * > &decals, const CShaderDefines &context, ShadowMap *shadow, bool isDummyShader=false, const CShaderProgramPtr &dummy=CShaderProgramPtr())
Definition: DecalRData.cpp:73
shared_ptr< CShaderProgram > CShaderProgramPtr