]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texturing.h
Change Texturing to store index-texture pairs
[libs/gl.git] / source / texturing.h
index 2b409d64fb713ee221a4842110832258bd92f711..79647f1d95a5b0467a106ddac206066f28267111 100644 (file)
@@ -12,9 +12,15 @@ class Texture;
 class Texturing: public Bindable<Texturing>
 {
 private:
-       std::vector<const Texture *> attachments;
+       struct Attachment
+       {
+               unsigned unit;
+               const Texture *texture;
 
-       static bool legacy_used;
+               Attachment(unsigned, const Texture *);
+       };
+
+       std::vector<Attachment> attachments;
 
 public:
        ~Texturing();
@@ -26,13 +32,7 @@ private:
 public:
        const Texture *get_attached_texture(unsigned) const;
 
-private:
-       void bind_attachment(unsigned, bool) const;
-
-       static void unbind_attachment(unsigned);
-
-public:
-       void bind(bool = true) const;
+       void bind() const;
 
        static void unbind();
 };