X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexturing.h;h=cba77e3fb3e49a57e4ca98f7bb698f7ddf7f8489;hb=56133280d92c08c1c649a725260a6c4d5afb5e75;hp=c51782bbf237959558af379998d5f4bab504d962;hpb=abc16c5ab0fff0945d724febe9d5d3889fb8a6ce;p=libs%2Fgl.git diff --git a/source/texturing.h b/source/texturing.h index c51782bb..cba77e3f 100644 --- a/source/texturing.h +++ b/source/texturing.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_TEXTURING_H_ #define MSP_GL_TEXTURING_H_ @@ -14,7 +7,6 @@ Distributed under the LGPL namespace Msp { namespace GL { -class TexEnv; class Texture; class Texturing: public Bindable @@ -22,10 +14,10 @@ class Texturing: public Bindable private: struct Attachment { - const Texture *tex; - const TexEnv *env; + unsigned unit; + const Texture *texture; - Attachment(); + Attachment(unsigned, const Texture *); }; std::vector attachments; @@ -33,16 +25,14 @@ private: 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();