All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LocalAsyncTextureBase.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "IAsyncTexture.h"
7 #include "RefcountedAsyncTexture.h"
8 #include "GLHelpers.h"
9 #include "Web.h"
10 #include "AsyncTexturing.h"
11 #include "ITextureFileLoader.h"
12 #include "CubeFaceFileNames.h"
13 #include <string>
14 #include "Rendering.h"
15 #include "AsyncTextureLoadResult.h"
16 
17 namespace Eegeo
18 {
19  namespace Rendering
20  {
21  namespace AsyncTexturing
22  {
23  class LocalAsyncTextureBase : protected Eegeo::NonCopyable, public RefcountedAsyncTexture<LocalAsyncTextureBase>
24  {
25  public:
27  IAsyncTexture& initialTexture,
28  const std::string& url,
29  bool generateMipMaps,
30  IAsyncTextureObserver* pObserver,
31  ITextureFactory& textureFactory
32  );
33 
34  virtual const std::string GetUrl() const;
35  virtual const Helpers::GLHelpers::TextureInfo& GetTextureInfo() const;
36  virtual void DestroyTexture();
37  virtual bool IsLoaded() const;
38  virtual bool IsComplete() const;
39  virtual bool HasMipMaps() const { return m_generateMipMaps; }
40 
41  protected:
42 
43  virtual ~LocalAsyncTextureBase();
44  void OnTextureAsyncLoadComplete(const Rendering::AsyncTexturing::AsyncTextureLoadResult& result);
45 
46  IAsyncTextureLoad* m_pLoad;
47  IAsyncTextureObserver* m_pObserver;
49  bool m_loaded;
50  bool m_generateMipMaps;
51  std::string m_url;
52  IAsyncTexture* m_pTexture;
53  ITextureFactory& m_textureFactory;
54  };
55  }
56  }
57 }