]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.h
Support embedding textures in datafiles
[libs/gl.git] / source / texture2d.h
index 251561b99490c5ca93166bd9679e121a3fbc92d2..b62466cb0a75bc524cf11a484567bfe17eb02625 100644 (file)
@@ -9,17 +9,29 @@ Distributed under the LGPL
 #define MSP_GL_TEXTURE2D_H_
 
 #include <string>
+#include <msp/datafile/loader.h>
 #include "pixelformat.h"
 #include "texture.h"
 
 namespace Msp {
 namespace GL {
 
+class Image;
+
 /**
 Two-dimensional texture class.  This is the most common type of texture.
 */
 class Texture2D: public Texture
 {
+public:
+       class Loader: public Texture::Loader
+       {
+       public:
+               Loader(Texture2D &);
+       private:
+               void image_data(const std::string &);
+       };
+
 private:
        PixelFormat ifmt;
        sizei width;
@@ -56,6 +68,9 @@ public:
 
        sizei get_width() const  { return width; }
        sizei get_height() const { return height; }
+
+private:
+       void image(const Image &);
 };
 
 } // namespace GL