]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture.h
Require mspgbase now that Image was moved there
[libs/gl.git] / source / texture.h
index 6c3541d446ef01d817ae88e3611d3dccb0a05f9e..6dd729b4d23a546f0c50bc92a4aa2cb73291652d 100644 (file)
@@ -8,7 +8,9 @@ Distributed under the LGPL
 #ifndef MSP_GL_TEXTURE_H_
 #define MSP_GL_TEXTURE_H_
 
-#include <GL/gl.h>
+#include <istream>
+#include <msp/datafile/loader.h>
+#include "gl.h"
 #include "types.h"
 
 namespace Msp {
@@ -24,6 +26,9 @@ enum TextureFilter
        LINEAR_MIPMAP_LINEAR   = GL_LINEAR_MIPMAP_LINEAR
 };
 
+std::istream &operator>>(std::istream &, TextureFilter &);
+
+
 /**
 Base class for textures.  This class only defines operations common for all
 texture types and is not instantiable.  For specifying images for textures, see
@@ -31,6 +36,19 @@ one of the dimensioned texture classes.
 */
 class Texture
 {
+protected:
+       class Loader: public DataFile::Loader
+       {
+       protected:
+               Texture &tex;
+
+       public:
+               Loader(Texture &);
+               void min_filter(TextureFilter);
+               void mag_filter(TextureFilter);
+               void generate_mipmap(bool);
+       };
+
 public:
        ~Texture();