All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
EmscriptenPlatformAbstractionModule.h
1 // Copyright eeGeo Ltd (2012-2022), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IPlatformAbstractionModule.h"
6 #include "Types.h"
7 #include "Helpers.h"
8 #include "Web.h"
9 #include "Tasks.h"
10 #include "Concurrency.h"
11 #include "Rendering.h"
12 #include "EmscriptenMainThreadWorkPool.h"
13 #include "SceneBuilderModuleFactory.h"
14 
15 #include <string>
16 #include <set>
17 
18 
19 namespace Eegeo
20 {
21  namespace Emscripten
22  {
24  {
25  public:
27  Helpers::Jpeg::IJpegLoader& jpegLoader,
28  const std::string& apiKey,
29 #ifndef EEGEO_UNITY
30  int mapId
31 #else
32  const Unity::UnityCallbacks* pUnityCallbacks,
33  const std::string& assetsPath
34 #endif
35  );
36 
38 
39  Helpers::ITextureFileLoader& GetTextureFileLoader() const;
40  Web::IWebLoadRequestFactory& GetWebLoadRequestFactory() const;
41  Web::IWebLoadRequestFactory& GetPlatformWebLoadRequestFactory() const;
42  Web::IWebProxySettings& GetProxySettings() const;
43  Web::ISSLSettings& GetSSLSettings() const;
44  Helpers::IHttpCache& GetHttpCache() const;
45  Helpers::IFileIO& GetFileIO() const;
46  Helpers::UrlHelpers::IUrlEncoder& GetUrlEncoder() const;
47  Concurrency::Tasks::IGlTaskContextFactory& GetGlTaskContextFactory() const;
48  Eegeo::Web::IConnectivityService& GetConnectivityService() const;
49  Concurrency::Tasks::IWorkPool& GetWorkPool() const;
50 
51  void OnPause();
52  void OnResume();
53  void Update();
54 
55  void SetWebIOWorkPool(Concurrency::Tasks::IWorkPool* pWorkPool);
56  Modules::ISceneBuilderModuleFactory& GetSceneBuilderModuleFactory();
57  Rendering::AsyncTexturing::ITextureFactory& GetTextureFactory() const;
58 
59  private:
60  Helpers::UrlHelpers::IUrlEncoder* m_pUrlEncoder;
61  Web::IWebRequestService* m_pWebRequestService;
62  Web::IWebLoadRequestFactory* m_pWebLoadRequestFactory;
63  Web::IWebLoadRequestFactory* m_pPlatformWebLoadRequestFactory;
64  Helpers::IHttpCache* m_pHttpCache;
65  Helpers::IFileIO* m_pFileIO;
66  Eegeo::Web::SSLSettings* m_pSSLSettings;
67  Helpers::ITextureFileLoader* m_pTextureFileLoader;
68  Eegeo::Web::IConnectivityService* m_pConnectivityService;
69  Web::ManualProxyResolver* m_pManualProxyResolver;
70  Web::IPacResolver* m_pPacResolver;
71  Web::IProxyAutoConfigRunner* m_pDefaultPacRunner;
72  Web::IWebProxySettings* m_pWebProxySettings;
73  EmscriptenMainThreadWorkPool* m_pWorkPool;
74  Modules::SceneBuilderModuleFactory m_sceneBuilderModuleFactory;
76 #ifdef EEGEO_UNITY
77  Helpers::PNG::IPNGDecoder* m_pngLoader;
78 #endif
79  };
80  }
81 }