Ocular Engine
TextureResourceSaver.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_GRAPHICS_TEXTURE_RESOURCE_SAVER__H__
19 #define __H__OCULAR_GRAPHICS_TEXTURE_RESOURCE_SAVER__H__
20 
21 #include "Resources/ResourceSaver.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  TextureResourceSaver(std::string const& extension);
56  virtual ~TextureResourceSaver();
57 
58  virtual bool saveResource(Core::Resource* resource, Core::File const& file);
59 
60  protected:
61 
78  virtual bool saveFile(Core::File const& file, std::vector<Core::Color> const& pixels, unsigned const width, unsigned const height) = 0;
79 
88  virtual bool isFileValid(Core::File& file);
89 
98  virtual bool isResourceValid(Core::Resource* resource);
99 
100  private:
101  };
102  }
106 }
111 //------------------------------------------------------------------------------------------
112 
113 #endif
virtual bool saveResource(Core::Resource *resource, Core::File const &file)
Definition: TextureResourceSaver.cpp:47
virtual bool isResourceValid(Core::Resource *resource)
Definition: TextureResourceSaver.cpp:125
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
virtual bool saveFile(Core::File const &file, std::vector< Core::Color > const &pixels, unsigned const width, unsigned const height)=0
Definition: File.hpp:41
virtual bool isFileValid(Core::File &file)
Definition: TextureResourceSaver.cpp:88
Definition: ResourceSaver.hpp:49
Definition: TextureResourceSaver.hpp:51
Definition: Resource.hpp:46