All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
VAOCache.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 //#ifdef EEGEO_IOS
6 
7 #include "Types.h"
8 #include "Rendering.h"
9 #include "Graphics.h"
10 #include <vector>
11 #include <utility>
12 
13 #define LOG_VAO_CACHE 0
14 
15 namespace Eegeo
16 {
17  namespace Rendering
18  {
24  class VAOCache : protected Eegeo::NonCopyable
25  {
26  public:
27  ~VAOCache();
28 
29  bool TryGetVAOForVertexBinding(const VertexLayouts::VertexBinding* pVertexBinding, GLuint* out_foundVAO) const;
30 
31  GLuint CreateVAOForVertexBinding(const VertexLayouts::VertexBinding* pVertexBinding);
32 
33  int GetNumOfVAOs() const
34  {
35  return static_cast<int>(m_vaosByVertexBinding.size());
36  }
37 
38  private:
39  typedef std::pair<const VertexLayouts::VertexBinding*, GLuint> TVertexBindingVAOPair;
40  typedef std::vector<TVertexBindingVAOPair> TVertexBindingToVAO;
41  TVertexBindingToVAO m_vaosByVertexBinding;
42  };
43  }
44 }
45 
46 //#endif