All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LocalAsyncTextureLoader.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "IAsyncTextureRequestor.h"
7 #include "IAsyncBufferTextureRequestor.h"
8 #include "IAsyncCubeTextureRequestor.h"
9 #include "Helpers.h"
10 #include "AsyncTexturing.h"
11 #include <string>
12 #include <vector>
13 
14 namespace Eegeo
15 {
16  namespace Rendering
17  {
18  namespace AsyncTexturing
19  {
21  {
22  public:
24  Eegeo::Helpers::ITextureFileLoader& textureFileLoader,
25  IAsyncTexture& placeholderTexture,
26  IAsyncTexture& placeholderCubeTexture,
27  ITextureFactory& textureFactory
28  );
29 
31 
32  IAsyncTexture& RequestTexture(const std::string& textureUrl,
33  IAsyncTextureObserver* pObserver,
34  bool generateMipMaps=false,
35  bool tryToUpdateIfModified=false);
36 
37  IAsyncTexture& RequestCubeTexture(const Helpers::CubeTextureName& cubeTextureName,
38  IAsyncTextureObserver* pObserver,
39  bool tryToUpdateIfModified=false);
40 
41  IAsyncTexture& RequestTextureFromBuffer(
42  std::vector<Byte>& buffer,
43  const std::string& textureName,
44  const std::string& fileExtension,
45  bool generateMipMaps=false);
46 
47  private:
48  Eegeo::Helpers::ITextureFileLoader& m_textureFileLoader;
49  IAsyncTexture& m_placeholderTexture;
50  IAsyncTexture& m_placeholderCubeTexture;
51  ITextureFactory& m_textureFactory;
52  };
53  }
54  }
55 }