]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.cpp
Move texture sampler state to a separate object
[libs/gl.git] / source / texture2d.cpp
index abdfe0d1569ca50d7f06e15531e5e01997cb47bc..78011d3046ea5fb8189f823096fa8d730c651033 100644 (file)
@@ -191,6 +191,7 @@ void Texture2D::unload()
        allocated = 0;
        // TODO check which params actually need refreshing
        dirty_params = -1;
+       default_sampler.unload();
 }
 
 
@@ -210,6 +211,7 @@ void Texture2D::Loader::init()
 {
        add("raw_data", &Loader::raw_data);
        add("storage", &Loader::storage);
+       add("storage", &Loader::storage_levels);
 }
 
 void Texture2D::Loader::raw_data(const string &data)
@@ -222,6 +224,11 @@ void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h)
        obj.storage(fmt, w, h);
 }
 
+void Texture2D::Loader::storage_levels(PixelFormat fmt, unsigned w, unsigned h, unsigned l)
+{
+       obj.storage(fmt, w, h, l);
+}
+
 
 Texture2D::AsyncLoader::AsyncLoader(Texture2D &t, IO::Seekable &i):
        texture(t),