All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SdfTextMaterial.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 "SdfTextShader.h"
8 #include "IdTypes.h"
9 #include "VectorMathDecl.h"
10 #include <string>
11 #include "AsyncTexturing.h"
12 
13 namespace Eegeo
14 {
15  namespace Rendering
16  {
17  namespace Materials
18  {
19  class SdfTextMaterial : protected Eegeo::NonCopyable, public IMaterial
20  {
21  public:
22  SdfTextMaterial(const TMaterialId materialId,
23  const std::string& name,
24  Shaders::SdfTextShader& shader,
26  bool depthTest,
27  float sdfSpread,
28  float textureSize,
29  float fontPixelSize
30  );
31 
32  ~SdfTextMaterial();
33 
34  const TMaterialId GetId() const { return m_id; }
35  const Shader& GetShader() const { return m_shader; }
36  const std::string& GetName() const { return m_name; }
37 
38  void SetState(Rendering::GLState& glState) const;
39 
40  void SetStatePerRenderable(const Rendering::RenderableBase* pRenderableBase, Rendering::GLState& glState) const;
41 
42  protected:
43  const TMaterialId m_id;
44  const std::string m_name;
45  Shaders::SdfTextShader& m_shader;
47  const float m_sdfSpread;
48  const float m_textureSize;
49  const float m_fontPixelSize;
50  const bool m_depthTest;
51  };
52  }
53  }
54 }