]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture.h
Move extension requirements from ProgramData to UniformBlock
[libs/gl.git] / source / texture.h
index 6b8117fe4f7d11b1c385e174cb343da29f48d909..477eaca382fa55dbe6ab1925fb62677db1ed72c1 100644 (file)
@@ -8,6 +8,8 @@
 namespace Msp {
 namespace GL {
 
+class Resources;
+
 enum TextureFilter
 {
        /// No filtering
@@ -66,11 +68,17 @@ wrapping is applied.  The default for all directions is REPEAT.
 class Texture
 {
 protected:
-       class Loader: public DataFile::ObjectLoader<Texture>
+       class Loader: public DataFile::CollectionObjectLoader<Texture>
        {
+       protected:
+               bool srgb;
+
        public:
                Loader(Texture &);
+               Loader(Texture &, Collection &);
        private:
+               void init();
+
                void filter(TextureFilter);
                void generate_mipmap(bool);
                void mag_filter(TextureFilter);
@@ -149,11 +157,11 @@ public:
        GLenum get_target() const { return target; }
        unsigned get_id() const { return id; }
 
-       void bind() const;
+       void bind() const { bind_to(0); }
        void bind_to(unsigned) const;
 
-       static const Texture *current();
-       static void unbind();
+       static const Texture *current(unsigned = 0);
+       static void unbind() { unbind_from(0); }
        static void unbind_from(unsigned);
 };