All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ShadowMaterial.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "IMaterial.h"
7 #include "Rendering.h"
8 #include "ColorShader.h"
9 #include "Lighting.h"
10 #include "VectorMathDecl.h"
11 #include "GlobalShadowing.h"
12 #include <string>
13 
14 namespace Eegeo
15 {
16  namespace Rendering
17  {
18  namespace Materials
19  {
20  class ShadowMaterial : protected Eegeo::NonCopyable, public IMaterial
21  {
22  public:
23  ShadowMaterial(const TMaterialId materialId,
24  const std::string& name,
25  Shaders::ColorShader& shader,
27  );
28 
29  const TMaterialId GetId() const { return m_id; }
30  const Shader& GetShader() const { return m_shader; }
31  const std::string& GetName() const { return m_name; }
32 
33  void SetState(Rendering::GLState& glState) const;
34 
35  void SetStatePerRenderable(const Rendering::RenderableBase* renderableBase, Rendering::GLState& glState) const;
36 
37  const v3& GetColor() const { return m_shadowing.GetShadowColor(); }
38 
39  protected:
40  const TMaterialId m_id;
41  const std::string m_name;
42  Shaders::ColorShader& m_shader;
44  };
45  }
46  }
47 }