Unofficial OpenGL Software Development Kit  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StbLoader.h
Go to the documentation of this file.
1 #ifndef GLIMG_STB_LOADER_H
2 #define GLIMG_STB_LOADER_H
3 
4 #include <string>
5 #include "ImageSet.h"
6 
13 namespace glimg
14 {
15  namespace loaders
16  {
22  namespace stb
23  {
26 
28  class StbLoaderException : public std::exception
29  {
30  public:
31 
32  virtual ~StbLoaderException() throw() {}
33 
34  virtual const char *what() const throw() {return message.c_str();}
35 
36  protected:
37  std::string message;
38  };
39 
42  {
43  public:
45  {
46  message = "The memory buffer could not be loaded by STB_image.";
47  }
48 
49  explicit UnableToLoadException(const std::string &filename)
50  {
51  message = "The file " + filename + " could not be loaded by STB_image.";
52  }
53  };
55 
71  ImageSet *LoadFromFile(const std::string &filename);
72 
74  ImageSet *LoadFromMemory(const unsigned char *buffer, size_t bufSize);
75  }
76  }
77 }
78 
79 
80 #endif //GLIMG_STB_LOADER_H