]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderpass.h
Make RenderPass use a Texturing for textures
[libs/gl.git] / source / renderpass.h
index 10960b3f37cb1b082d0cf26d20404514297982b8..acbe29491cf9f493477663f8f51954ef63de2605 100644 (file)
@@ -18,11 +18,15 @@ namespace GL {
 class Material;
 class Program;
 class ProgramData;
+class TexEnv;
 class Texture;
+class Texturing;
 
 /**
 Encapsulates the data that determines the appearance of a rendered surface.
-This includes shader and data for it, material and textures.
+This includes shader and data for it, material and texturing.
+
+XXX Does not delete inline texture from datafiles properly
 */
 class RenderPass: public Bindable<RenderPass>
 {
@@ -43,30 +47,27 @@ public:
        };
 
 private:
-       struct TextureSlot
+       struct TextureLoader: public DataFile::CollectionObjectLoader<Texturing>
        {
-               class Loader: public DataFile::CollectionObjectLoader<TextureSlot>
-               {
-               public:
-                       Loader(TextureSlot &);
-                       Loader(TextureSlot &, Collection &);
-
-               private:
-                       void init();
-                       void texture(const std::string &);
-                       void texture2d();
-               };
-
+       private:
                unsigned index;
-               RefPtr<const Texture> texture;
+               RefPtr<Texture> tex;
+               RefPtr<TexEnv> env;
+
+       public:
+               TextureLoader(Texturing &, unsigned, Collection *);
+       private:
+               virtual void finish();
 
-               TextureSlot(unsigned);
+               void texenv();
+               void texture(const std::string &);
+               void texture2d();
        };
 
        Program *shprog;
        ProgramData *shdata;
        RefPtr<const Material> material;
-       std::vector<TextureSlot> textures;
+       Texturing *texturing;
 
        RenderPass &operator=(const RenderPass &);
 public: