update_parameter(MAG_FILTER);
}
+void Texture::set_filter(TextureFilter f)
+{
+ set_min_filter(f);
+ set_mag_filter(f==NEAREST ? NEAREST : LINEAR);
+}
+
void Texture::set_max_anisotropy(float a)
{
if(a<1.0f)
Texture::Loader::Loader(Texture &t):
DataFile::ObjectLoader<Texture>(t)
{
+ add("filter", &Loader::filter);
add("max_anisotropy", &Loader::max_anisotropy);
add("generate_mipmap", &Loader::generate_mipmap);
add("mag_filter", &Loader::mag_filter);
add("wrap_t", &Loader::wrap_t);
}
+void Texture::Loader::filter(TextureFilter f)
+{
+ obj.set_filter(f);
+}
+
void Texture::Loader::generate_mipmap(bool gm)
{
obj.set_generate_mipmap(gm);
public:
Loader(Texture &);
private:
+ void filter(TextureFilter);
void generate_mipmap(bool);
void mag_filter(TextureFilter);
void max_anisotropy(float);
public:
void set_min_filter(TextureFilter);
void set_mag_filter(TextureFilter);
+
+ /** Sets filter for both minification and magnification. Since mipmapping
+ is not applicable to magnification, LINEAR is used instead. */
+ void set_filter(TextureFilter);
+
void set_max_anisotropy(float);
/** Sets the wrapping mode for all coordinates. */