All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TextRenderable.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "MeshRenderable.h"
6 #include "LayerIds.h"
7 #include "Rendering.h"
8 #include "VectorMath.h"
9 
10 namespace Eegeo
11 {
12  namespace Rendering
13  {
14  namespace Renderables
15  {
17  {
18  public:
20  LayerIds::Values layerId,
21  Materials::IMaterial* material,
22  const VertexLayouts::VertexBinding& vertexBinding,
23  Rendering::Mesh* pMesh,
24  const Eegeo::dv3& ecefPosition
25  );
26 
27  ~TextRenderable();
28 
29  v4 GetForegroundColour() const { return m_foregroundColour; }
30  v4 GetShadowColour() const { return m_shadowColour; }
31  v4 GetOutlineColour() const { return m_outlineColour; }
32  v3 GetScale() const { return m_scale; }
33  float GetAlpha() const { return m_fadeAlpha; }
34  float GetHaloWidth() const { return m_haloWidth; }
35  float GetHaloHardness() const { return m_haloHardness; }
36 
37  void SetForegroundColour(const v4& rgba) { m_foregroundColour = rgba; }
38  void SetShadowColour(const v4& rgba) { m_shadowColour = rgba; }
39  void SetOutlineColour(const v4& rgba) { m_outlineColour = rgba; }
40  void SetScale(v3 scale) { m_scale = scale; }
41  void SetAlpha(float alpha) { m_fadeAlpha = alpha; }
42  void SetHaloWidth(float haloWidth) { m_haloWidth = haloWidth; }
43  void SetHaloHardness(float haloHardness) { m_haloHardness = haloHardness; }
44  void SetIsSdf(bool isSdf) { m_isSdf = isSdf; }
45  bool IsHaloPass() const { return *m_pIsHaloPass; }
46 
47  void Render(Rendering::GLState& glState) const;
48  protected:
49  bool NeedsHaloPass() const;
50  Eegeo::v3 m_scale;
51  Eegeo::v4 m_foregroundColour;
52  Eegeo::v4 m_shadowColour;
53  Eegeo::v4 m_outlineColour;
54  float m_fadeAlpha;
55  float m_haloWidth;
56  float m_haloHardness;
57  bool m_isSdf;
58  bool* m_pIsHaloPass;
59  };
60  }
61  }
62 }