]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture.h
Get rid of the typedefs for fundamental types
[libs/gl.git] / source / texture.h
index 6dd729b4d23a546f0c50bc92a4aa2cb73291652d..848517eb45c99da20a67c8261ed81488b7902ea3 100644 (file)
@@ -9,9 +9,8 @@ Distributed under the LGPL
 #define MSP_GL_TEXTURE_H_
 
 #include <istream>
-#include <msp/datafile/loader.h>
+#include <msp/datafile/objectloader.h>
 #include "gl.h"
-#include "types.h"
 
 namespace Msp {
 namespace GL {
@@ -37,11 +36,8 @@ one of the dimensioned texture classes.
 class Texture
 {
 protected:
-       class Loader: public DataFile::Loader
+       class Loader: public DataFile::ObjectLoader<Texture>
        {
-       protected:
-               Texture &tex;
-
        public:
                Loader(Texture &);
                void min_filter(TextureFilter);
@@ -53,16 +49,18 @@ public:
        ~Texture();
 
        void bind() const;
+       void bind_to(unsigned) const;
        void parameter(GLenum, int);
        void parameter(GLenum, float);
        void set_min_filter(TextureFilter f) { parameter(GL_TEXTURE_MIN_FILTER, f); }
        void set_mag_filter(TextureFilter f) { parameter(GL_TEXTURE_MAG_FILTER, f); }
        GLenum get_target() const            { return target; }
-       uint  get_id() const                 { return id; }
+       unsigned  get_id() const                 { return id; }
 
        static void unbind();
+       static void unbind_from(unsigned);
 protected:
-       uint   id;
+       unsigned   id;
        GLenum target;
 
        Texture();