All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BlueSphereViewResources.h
1 #pragma once
2 
3 #include "BlueSphere.h"
4 #include "Types.h"
5 #include "Rendering.h"
6 #include "AsyncTexturing.h"
7 #include "Helpers.h"
8 #include "BlueSphereEvents.h"
9 
10 #include <vector>
11 #include <map>
12 
13 namespace Eegeo
14 {
15  namespace BlueSphere
16  {
18  {
19  public:
20 
21  static BlueSphereViewResources* Create(
22  IBlueSphereResourceLoadCompletedEvent& blueSphereResourceLoadCompletedEvent
23  );
24 
26 
27  void SetLoadSucceeded();
28  void SetLoadFailed();
29  bool IsLoaded() const { return m_isLoaded; }
30 
31  void SetMaterialsContainer(BlueSphereViewMaterialsContainer* pBlueSphereViewMaterialsContainer);
32  bool HasMaterialsContainer() const;
33  BlueSphereViewMaterialsContainer& GetMaterialsContainer() const;
34 
35  void AddRenderable(BlueSphereRenderable::Type renderableType, BlueSphereMeshRenderable* pRenderable);
36  bool HasRenderable(BlueSphereRenderable::Type renderableType) const;
37  BlueSphereMeshRenderable& GetRenderable(BlueSphereRenderable::Type renderableType) const;
38 
39  void AddMesh(Eegeo::Rendering::Mesh* pMesh);
40 
41  private:
43  IBlueSphereResourceLoadCompletedEvent& blueSphereResourceLoadCompletedEvent
44  );
45 
46  void DestroyRenderables();
47  void DestroyMeshes();
48 
49  IBlueSphereResourceLoadCompletedEvent& m_blueSphereResourceLoadCompletedEvent;
50 
51  BlueSphereViewMaterialsContainer* m_pBlueSphereViewMaterialsContainer;
52  std::map<BlueSphereRenderable::Type, BlueSphereMeshRenderable*> m_renderables;
53  std::vector<Eegeo::Rendering::Mesh*> m_meshes;
54  bool m_isLoaded;
55 
56  };
57  }
58 }