All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BatchedSpriteRenderable.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "RenderableBase.h"
6 #include "Rendering.h"
7 #include "Camera.h"
8 #include "DynamicBuffer.h"
9 #include "AllVertexTypes.h"
10 #include "IdTypes.h"
11 
12 namespace Eegeo
13 {
14  namespace Rendering
15  {
16  namespace Renderables
17  {
18  namespace BatchedSpriteAnchor
19  {
20  enum Values
21  {
22  Centre,
23  Bottom
24  };
25  }
26 
28  {
29  public:
31  LayerIds::Values layerId,
32  Materials::IMaterial* pMaterial,
33  const VertexLayouts::VertexBinding& vertexBinding,
34  Rendering::GlBufferPool& glBufferPool,
35  BatchedSpriteAnchor::Values anchor);
36 
38 
39  void AddSprite(const Camera::RenderCamera& camera, const dv3& ecefPosition, const Eegeo::v2& uvsMin, const Eegeo::v2& uvsMax, const v4& color, const Eegeo::v2& dimensionsInMeters);
40 
41  void Render(GLState& glState) const;
42 
43  void Reset();
44 
45  private:
47  TIndexBufferId m_glIndexBuffer;
48  BatchedSpriteAnchor::Values m_anchor;
49  u32 m_spriteCount;
50  GlBufferPool& m_glBufferPool;
51  };
52  }
53  }
54 }