namespace Msp {
namespace GL {
-class TexEnv;
class Texture;
class Texturing: public Bindable<Texturing>
private:
struct Attachment
{
- const Texture *tex;
- const TexEnv *env;
+ unsigned unit;
+ const Texture *texture;
- Attachment();
+ Attachment(unsigned, const Texture *);
};
std::vector<Attachment> attachments;
public:
~Texturing();
+ int find_free_unit(const std::string & = std::string()) const;
void attach(unsigned, const Texture &);
- void attach(unsigned, const Texture &, const TexEnv &);
void detach(unsigned);
private:
- void set_attachment(unsigned, const Texture *, const TexEnv *);
- void bind_attachment(unsigned) const;
-
- static void unbind_attachment(unsigned);
-
+ void set_attachment(unsigned, const Texture *);
public:
+ const Texture *get_attached_texture(unsigned) const;
+
void bind() const;
static void unbind();