]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resources.cpp
Remove the obsolete storage statement with border
[libs/gl.git] / source / resources.cpp
index 2fd6950370df6580fe08cdf54139bef9b6d50316..c30426633e60746756428951c8e907e82829c690 100644 (file)
@@ -1,4 +1,5 @@
 #include <msp/fs/utils.h>
+#include <msp/gl/extensions/sgis_generate_mipmap.h>
 #include "animation.h"
 #include "armature.h"
 #include "font.h"
@@ -11,6 +12,7 @@
 #include "resourcemanager.h"
 #include "resources.h"
 #include "technique.h"
+#include "texture1d.h"
 #include "texture2d.h"
 #include "texturecube.h"
 
@@ -20,7 +22,7 @@ namespace Msp {
 namespace GL {
 
 Resources::Resources():
-       default_tex_filter(LINEAR_MIPMAP_LINEAR),
+       default_tex_filter(SGIS_generate_mipmap ? LINEAR_MIPMAP_LINEAR : LINEAR),
        srgb_conversion(false),
        resource_manager(0)
 {
@@ -34,7 +36,9 @@ Resources::Resources():
        add_type<Pose>().keyword("pose");
        add_type<Program>().keyword("shader");
        add_type<Technique>().suffix(".tech").keyword("technique");
+       add_type<Texture1D>().base<Texture>().suffix(".tex1d").keyword("texture1d");
        add_type<Texture2D>().base<Texture>().suffix(".tex2d").suffix(".png").suffix(".jpg").keyword("texture2d").creator(&Resources::create_texture2d);
+       add_type<Texture3D>().base<Texture>().suffix(".tex3d").keyword("texture3d");
        add_type<TextureCube>().base<Texture>().suffix(".texcb").keyword("texture_cube");
 }
 
@@ -92,7 +96,6 @@ Texture2D *Resources::create_texture2d(const string &name)
                        tex->set_mag_filter(default_tex_filter);
                tex->set_min_filter(default_tex_filter);
 
-               // TODO Somehow pass the srgb flag if a resource manager is in use
                if(resource_manager)
                        resource_manager->set_resource_location(*tex, *this, name);
                else