]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resources.cpp
Move texture sampler state to a separate object
[libs/gl.git] / source / resources.cpp
index 8aecb933cadc3ce2585799b31c9ce14bca5ae70a..dd9a3c68c3543b549f425a863a842ad2d35bcc04 100644 (file)
@@ -132,15 +132,16 @@ Texture2D *Resources::create_texture2d(const string &name)
 
                RefPtr<Texture2D> tex = new Texture2D(resource_manager);
 
+               Sampler &samp = tex->get_default_sampler();
                if(is_mipmapped(default_tex_filter))
                {
                        tex->set_auto_generate_mipmap(true);
-                       tex->set_mag_filter(LINEAR);
+                       samp.set_mag_filter(LINEAR);
                }
                else
-                       tex->set_mag_filter(default_tex_filter);
-               tex->set_min_filter(default_tex_filter);
-               tex->set_max_anisotropy(default_tex_anisotropy);
+                       samp.set_mag_filter(default_tex_filter);
+               samp.set_min_filter(default_tex_filter);
+               samp.set_max_anisotropy(default_tex_anisotropy);
 
                if(resource_manager)
                        resource_manager->set_resource_location(*tex, *this, name);