Ocular Engine
TextureResourceLoader.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_GRAPHICS_TEXTURE_RESOURCE_LOADER__H__
19 #define __H__OCULAR_GRAPHICS_TEXTURE_RESOURCE_LOADER__H__
20 
21 #include "Resources/ResourceLoader.hpp"
22 #include "Math/Color.hpp"
23 #include "Common.hpp"
24 
25 #include <vector>
26 
27 //------------------------------------------------------------------------------------------
28 
33 namespace Ocular
34 {
39  namespace Graphics
40  {
52  {
53  public:
54 
55  TextureResourceLoader(std::string const& extension);
56  virtual ~TextureResourceLoader();
57 
58  virtual bool loadResource(Core::Resource* &resource, Core::File const& file, std::string const& mappingName) override;
59 
60  protected:
61 
71  virtual bool readFile(Core::File const& file, std::vector<Core::Color>& pixels, unsigned& width, unsigned& height) = 0;
72 
83  virtual bool createResource(Core::Resource* &resource, Core::File const& file, std::vector<Core::Color> const& pixels, unsigned const& width, unsigned const& height);
84 
93  virtual void loadFileIntoBuffer(Core::File const& file, std::vector<unsigned char>& buffer, Endianness fileEndianness);
94 
95  private:
96  };
97  }
101 }
106 //------------------------------------------------------------------------------------------
107 
108 #endif
Endianness
Definition: Common.hpp:89
virtual void loadFileIntoBuffer(Core::File const &file, std::vector< unsigned char > &buffer, Endianness fileEndianness)
Definition: TextureResourceLoader.cpp:158
virtual bool readFile(Core::File const &file, std::vector< Core::Color > &pixels, unsigned &width, unsigned &height)=0
Definition: ResourceLoader.hpp:55
Definition: TextureResourceLoader.hpp:51
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
virtual bool createResource(Core::Resource *&resource, Core::File const &file, std::vector< Core::Color > const &pixels, unsigned const &width, unsigned const &height)
Definition: TextureResourceLoader.cpp:94
Definition: File.hpp:41
virtual bool loadResource(Core::Resource *&resource, Core::File const &file, std::string const &mappingName) override
Definition: TextureResourceLoader.cpp:50
Definition: Resource.hpp:46