All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PackedDiffuseMaterial.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 "Lighting.h"
9 #include "Rendering.h"
10 #include "PackedDiffuseShader.h"
11 #include "TextureMinifyType.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,
29  Rendering::TextureMinifyType textureMinifyType,
30  bool useAlternativeAmbient,
31  bool textureRepeat
32  );
33 
34  bool IsUsingAlternativeAmbient() const { return m_useAlternativeAmbient; }
35  void UseAlternativeAmbient(bool useAlternativeAmbient) { m_useAlternativeAmbient = useAlternativeAmbient; }
36 
37  const TMaterialId GetId() const { return m_id; }
38  const Shader& GetShader() const { return m_shader; }
39  const std::string& GetName() const { return m_name; }
40 
41  void SetDiffuseTexture(Rendering::AsyncTexturing::IAsyncTexture& textureId) { m_textureId = &textureId; }
42  Rendering::AsyncTexturing::IAsyncTexture& GetTextureId() const { return *m_textureId; }
43 
44  void SetState(Rendering::GLState& glState) const;
45 
46  void SetStatePerRenderable(const Rendering::RenderableBase* renderableBase, Rendering::GLState& glState) const;
47 
48  protected:
49  const TMaterialId m_id;
50  const std::string m_name;
52  const Lighting::GlobalLighting& m_lighting;
54  Rendering::TextureMinifyType m_textureMinifyType;
55  bool m_textureRepeat;
56  bool m_useAlternativeAmbient;
57  };
58  }
59  }
60 }