CAssetManager.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionCore.h>
5 #include <ionGraphics.h>
6 #include <ionWindow.h>
7 #include <ionScene.h>
8 
9 
10 namespace ion
11 {
12 
13  class CAssetManager : public Singleton<CAssetManager>
14  {
15 
16  public:
17 
19 
20  SharedPointer<Graphics::IShader> LoadShader(string const & Name);
21  CImage * LoadImage(string const & FileName);
26  string const & FileNameLeft,
27  string const & FileNameRight,
28  string const & FileNameUp,
29  string const & FileNameDown,
30  string const & FileNameFront,
31  string const & FileNameBack,
33  Scene::CSimpleMesh * LoadMesh(string const & FileName);
34  Scene::CSimpleMesh * LoadMeshMerged(string const & FileName);
35  vector<Scene::CSimpleMesh *> LoadMeshes(string const & FileName);
36 
37  void AddAssetPath(string const & Path);
38  void SetTexturePath(string const & Path);
39  void SetShaderPath(string const & Path);
40  void SetMeshPath(string const & Path);
41 
42  string ParseShaderSource(string const & FileName, string const & RelativeDirectory);
43 
44  protected:
45 
47 
48  vector<string> AssetPaths;
49  string TexturePath = "Textures/";
50  string ShaderPath = "Shaders/";
51  string MeshPath = "Meshes/";
52 
53  private:
54 
55  friend class Singleton<CAssetManager>;
57  {}
58 
59  };
60 
61 }
SharedPointer< Graphics::ITextureCubeMap > LoadCubeMapTexture(string const &FileNameLeft, string const &FileNameRight, string const &FileNameUp, string const &FileNameDown, string const &FileNameFront, string const &FileNameBack, Graphics::ITexture::EMipMaps const MipMaps=Graphics::ITexture::EMipMaps::True)
Definition: CAssetManager.cpp:352
Definition: CSimpleMesh.h:33
CImage * LoadImage(string const &FileName)
Definition: CAssetManager.cpp:154
SharedPointer< Graphics::ITexture3D > Load3DTexture(const std::vector< std::string > &fileName, Graphics::ITexture::EMipMaps const MipMaps=Graphics::ITexture::EMipMaps::True)
Definition: CAssetManager.cpp:206
void Init(CGraphicsAPI *GraphicsAPI)
Definition: CAssetManager.cpp:78
Scene::CSimpleMesh * LoadMesh(string const &FileName)
Definition: CAssetManager.cpp:404
void SetTexturePath(string const &Path)
Definition: CAssetManager.cpp:512
Wraps a pointer to a singleton object.
Definition: SingletonPointer.h:13
void SetShaderPath(string const &Path)
Definition: CAssetManager.cpp:517
SharedPointer< Graphics::ITexture2D > LoadTexture(string const &FileName, Graphics::ITexture::EMipMaps const MipMaps=Graphics::ITexture::EMipMaps::True)
Definition: CAssetManager.cpp:176
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
string MeshPath
Definition: CAssetManager.h:51
EMipMaps
Definition: ITexture.h:59
Base class for Singleton design pattern implementation.
Definition: Singleton.h:13
string ShaderPath
Definition: CAssetManager.h:50
void SetMeshPath(string const &Path)
Definition: CAssetManager.cpp:522
SharedPointer< Graphics::ITexture2DArray > Load2DTextureArray(const std::vector< std::string > &fileName, Graphics::ITexture::EMipMaps const MipMaps=Graphics::ITexture::EMipMaps::True)
Definition: CAssetManager.cpp:279
vector< string > AssetPaths
Definition: CAssetManager.h:48
vector< Scene::CSimpleMesh * > LoadMeshes(string const &FileName)
Definition: CAssetManager.cpp:475
SingletonPointer< CGraphicsAPI > GraphicsAPI
Definition: CAssetManager.h:46
Definition: CImage.h:11
string TexturePath
Definition: CAssetManager.h:49
Scene::CSimpleMesh * LoadMeshMerged(string const &FileName)
Definition: CAssetManager.cpp:438
string ParseShaderSource(string const &FileName, string const &RelativeDirectory)
Definition: CAssetManager.cpp:9
std::shared_ptr< T > SharedPointer
Definition: ionSmartPointer.h:25
Definition: CGraphicsAPI.h:53
SharedPointer< Graphics::IShader > LoadShader(string const &Name)
Definition: CAssetManager.cpp:81
void AddAssetPath(string const &Path)
Definition: CAssetManager.cpp:507
Definition: CAssetManager.h:13