All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
EmscriptenAsyncCubeTextureLoad.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IAsyncTextureLoad.h"
6 #include "Helpers.h"
7 #include "Types.h"
8 #include "GLHelpers.h"
9 #include "ICallback.h"
10 #include "AsyncTexturing.h"
11 #include <string>
12 #include <vector>
13 
14 namespace Eegeo
15 {
16  namespace Emscripten
17  {
19  {
21  std::vector<const std::vector<Byte>*> m_cubeFaceBuffers;
22  void* m_pUserData;
23  GLuint m_textureId;
24  bool m_cancelled;
25  bool m_started;
26  int m_mapId;
27  bool m_mapExists;
28 
30  Helpers::ITextureFileLoader& textureLoader,
32  const std::vector<const std::vector<Byte>*>& cubeFaceBuffers,
33  void* pUserData,
34  int mapId);
35 
37 
38  public:
39 
40  static EmscriptenAsyncCubeTextureLoad& Build(
41  Helpers::ITextureFileLoader& textureLoader,
43  const std::vector<const std::vector<Byte>*>& cubeFaceBuffers,
44  void* pUserData,
45  int mapId);
46 
47  virtual void Begin();
48 
49  virtual void Cancel();
50 
51  void BeginAsyncTextureDecode();
52 
53  void HandleTextureDecodingComplete(GLuint textureId, bool success, int width, int height, bool mapWasRemoved);
54  };
55  }
56 }