All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Texture.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "RefcountedAsyncTexture.h"
7 #include "GLHelpers.h"
8 #include <string>
9 
10 namespace Eegeo
11 {
12  namespace Rendering
13  {
14  namespace AsyncTexturing
15  {
16  class Texture : protected Eegeo::NonCopyable, public RefcountedAsyncTexture<Texture>
17  {
18  public:
19  static Texture* Create(const std::string& textureUrl, const Helpers::GLHelpers::TextureInfo& textureInfo, bool hasMipMaps);
20  static Texture* CreateNull();
21 
22  Texture(const std::string& textureUrl, const Helpers::GLHelpers::TextureInfo& textureInfo, bool hasMipMaps);
23 
24  const std::string GetUrl() const;
25  const Helpers::GLHelpers::TextureInfo& GetTextureInfo() const;
26  void DestroyTexture();
27  bool IsLoaded() const;
28  bool IsComplete() const;
29  bool HasMipMaps() const { return m_hasMipmaps; }
30 
31  protected:
32 
33  virtual void DeleteGraphicsApiTexture();
34  virtual ~Texture();
35 
36  Helpers::GLHelpers::TextureInfo m_textureInfo;
37 
38  private:
39 
40  std::string m_textureUrl;
41  bool m_isLoaded;
42  bool m_hasMipmaps;
43  };
44 
45 
46  }
47  }
48 }