#include <msp/gl/extensions/sgis_generate_mipmap.h>
#include <msp/strings/format.h>
#include "error.h"
+#include "resources.h"
#include "texture.h"
#include "texunit.h"
Texture::Loader::Loader(Texture &t):
- DataFile::ObjectLoader<Texture>(t)
+ DataFile::CollectionObjectLoader<Texture>(t, 0)
{
+ init();
+}
+
+Texture::Loader::Loader(Texture &t, Collection &c):
+ DataFile::CollectionObjectLoader<Texture>(t, &c)
+{
+ init();
+}
+
+void Texture::Loader::init()
+{
+ if(Resources *res = dynamic_cast<Resources *>(coll))
+ srgb = res->get_srgb_conversion();
+ else
+ srgb = false;
+
add("filter", &Loader::filter);
add("max_anisotropy", &Loader::max_anisotropy);
add("generate_mipmap", &Loader::generate_mipmap);