]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.cpp
Make the use of DevIL optional
[libs/gl.git] / source / texture2d.cpp
index fbf86a43b77fe79dc2f81120a98b516aeea05b85..8a93d031b6fd36a781ab5916e7019ba6036b0388 100644 (file)
@@ -81,6 +81,8 @@ Texture2D::Loader::Loader(Texture2D &t):
        Texture::Loader(t)
 {
        add("image_data", &Loader::image_data);
+       add("raw_data", &Loader::raw_data);
+       add("storage", &Loader::storage);
 }
 
 void Texture2D::Loader::image_data(const string &data)
@@ -91,5 +93,16 @@ void Texture2D::Loader::image_data(const string &data)
        static_cast<Texture2D &>(tex).image(img);
 }
 
+void Texture2D::Loader::raw_data(const string &data)
+{
+       Texture2D &t2d=static_cast<Texture2D &>(tex);;
+       t2d.image(0, t2d.ifmt, GL_UNSIGNED_BYTE, data.data());
+}
+
+void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigned b)
+{
+       static_cast<Texture2D &>(tex).storage(fmt, w, h, b);
+}
+
 } // namespace GL
 } // namespace Msp