All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BatchedTextAppearance.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Text.h"
6 #include "VectorMath.h"
7 #include "Types.h"
8 #include "Graphics.h"
9 
10 namespace Eegeo
11 {
12  namespace Text
13  {
14 
16  {
17  public:
18  static BatchedTextAppearance BuildDefault();
19 
20  BatchedTextAppearance(float size,
21  const v4& glyphColor,
22  const v4& outlineColor,
23  const v4& haloColor,
24  float haloWidth,
25  float haloHardness,
26  bool depthTest,
27  bool stencilTest,
28  GLenum stencilFunc,
29  int stencilRef,
30  u32 stencilMask,
31  bool stencilMaskedStyleEnabled,
32  GLenum stencilMaskedStyleStencilFunc,
33  const v4& stencilMaskedGlyphColor,
34  const v4& stencilMaskedHaloColor
35  );
36 
37  bool operator !=(const BatchedTextAppearance& rhs) const;
38  bool operator ==(const BatchedTextAppearance& rhs) const;
39 
40  float GetSize() const { return m_size; }
41  v4 GetGlyphColor() const { return m_glyphColor; }
42  v4 GetOutlineColor() const { return m_outlineColor; }
43  v4 GetHaloColor() const { return m_haloColor; }
44  float GetHaloWidth() const { return m_haloWidth; }
45  float GetHaloHardness() const { return m_haloHardness; }
46  bool IsDepthTest() const { return m_depthTest; }
47  bool IsStencilTest() const { return m_stencilTest; }
48  GLenum GetStencilFunc() const { return m_stencilFunc; }
49  int GetStencilRef() const { return m_stencilRef; }
50  u32 GetStencilMask() const { return m_stencilMask; }
51  bool NeedsHalo() const { return m_haloWidth > 0.f; }
52 
53 
54  bool IsStencilMaskedStyleEnabled() const { return m_stencilMaskedStyleEnabled; }
55  GLenum GetStencilMaskedStyleStencilFunc() const { return m_stencilMaskedStyleStencilFunc; }
56  v4 GetStencilMaskedGlyphColor() const { return m_stencilMaskedGlyphColor; }
57  v4 GetStencilMaskedHaloColor() const { return m_stencilMaskedHaloColor; }
58 
59 
60  private:
61  v4 m_glyphColor;
62  v4 m_outlineColor;
63  v4 m_haloColor;
64  v4 m_stencilMaskedGlyphColor;
65  v4 m_stencilMaskedHaloColor;
66  float m_size;
67  float m_haloWidth;
68  float m_haloHardness;
69  int m_stencilRef;
70  u32 m_stencilMask;
71  GLenum m_stencilFunc;
72  GLenum m_stencilMaskedStyleStencilFunc;
73  bool m_depthTest;
74  bool m_stencilTest;
75  bool m_stencilMaskedStyleEnabled;
76  };
77  }
78 }