All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DebugTextRendererEcef.h
1 // Copyright (c) 2014 eeGeo. All rights reserved.
2 
3 #pragma once
4 
5 #include "VectorMath.h"
6 #include "Fonts.h"
7 #include "Rendering.h"
8 #include "Streaming.h"
9 #include "DynamicBuffer.h"
10 #include "AllVertexTypes.h"
11 #include "Camera.h"
12 #include "IMaterial.h"
13 #include "BatchedTextRenderable.h"
14 #include "IRenderableFilter.h"
15 
16 #include <string>
17 #include <deque>
18 
19 
20 namespace Eegeo
21 {
22  namespace DebugRendering
23  {
24  namespace Renderers
25  {
27  {
28  struct DebugTextEcef
29  {
30  dv3 Origin;
31  v4 Color;
32  std::string Text;
33  float Size;
34  float Lifetime;
35  };
36 
37  public:
39  const Fonts::FontInstance& fontInstance,
40  const Text::BatchedTextAppearance& defaultTextAppearance);
41 
43 
44  void DrawText(
45  const dv3& ecefCenter,
46  const std::string text,
47  const float size,
48  const float lifetime = 0.0f
49  );
50 
51  void Update(float dt, const Camera::RenderCamera& renderCamera);
52 
53  void GenerateGeometry(const Camera::RenderCamera& renderCamera);
54 
55  void SetDepthEnabled(const bool depthEnabled);
56 
57  private:
58 
59  void GenerateGeometryForSingleInstance(const DebugTextEcef& data, const Camera::RenderCamera& renderCamera);
60 
61  Text::IScreenTextRenderer& m_screenTextRenderer;
62 
63  const Fonts::FontInstance& m_fontInstance;
64 
65  const Text::BatchedTextAppearance m_defaultTextAppearance;
66 
67  bool m_depthTest;
68  std::deque<DebugTextEcef> m_drawData;
69  };
70  }
71  }
72 }