]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texture.cpp
Move the whole-texture image call and raw data loading to base class
[libs/gl.git] / source / core / texture.cpp
index 78053386a1e15e80ca2414d1d6261e19e4ac73ca..175e76a2365688c8aef1f30592759d8addbefab1 100644 (file)
@@ -92,6 +92,7 @@ Texture::Loader::Loader(Texture &t, Collection *c):
        add("generate_mipmap", &Loader::generate_mipmap);
        add("image_data", &Loader::image_data);
        add("mipmap_levels", &Loader::mipmap_levels);
+       add("raw_data", &Loader::raw_data);
 }
 
 void Texture::Loader::finish()
@@ -143,5 +144,13 @@ void Texture::Loader::mipmap_levels(unsigned l)
        levels = l;
 }
 
+void Texture::Loader::raw_data(const string &data)
+{
+       if(obj.manager)
+               obj.set_manager(0);
+
+       obj.image(0, data.data());
+}
+
 } // namespace GL
 } // namespace Msp