All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PackedDiffuseFoggedMaterial.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "IDiffuseMaterial.h"
7 #include "IdTypes.h"
8 #include "Rendering.h"
9 #include "Lighting.h"
10 #include "PackedDiffuseFoggedShader.h"
11 #include "PackedFoggedMaterial.h"
12 #include <string>
13 
14 namespace Eegeo
15 {
16  namespace Rendering
17  {
18  namespace Materials
19  {
21  {
22  public:
24  const TMaterialId materialId,
25  const std::string& name,
27  const Lighting::GlobalLighting& lighting,
28  const Lighting::GlobalFogging& fogging,
30  Rendering::TextureMinifyType textureMinifyType,
31  bool useAlternativeAmbient,
32  bool textureRepeat
33  );
34 
35  bool IsUsingAlternativeAmbient() const { return m_subMaterial.IsUsingAlternativeAmbient(); }
36  void UseAlternativeAmbient(bool useAlternativeAmbient) { m_subMaterial.UseAlternativeAmbient(useAlternativeAmbient); }
37 
38  void SetDiffuseTexture(Rendering::AsyncTexturing::IAsyncTexture& textureId) { m_textureId = &textureId; }
39  Rendering::AsyncTexturing::IAsyncTexture& GetTextureId() const { return *m_textureId; }
40 
41  const TMaterialId GetId() const { return m_subMaterial.GetId(); }
42  const Shaders::PackedDiffuseFoggedShader& GetShader() const { return m_subMaterial.GetShader(); }
43  const std::string& GetName() const { return m_subMaterial.GetName(); }
44 
45  void SetState(Rendering::GLState& glState) const;
46  void SetStatePerRenderable(const Rendering::RenderableBase* renderableBase, Rendering::GLState& glState) const;
47 
48  private:
49  PackedFoggedMaterial m_subMaterial;
51  };
52  }
53  }
54 }