]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderpass.cpp
Refresh lighting and culling uniforms if the camera changes in pop_state
[libs/gl.git] / source / renderpass.cpp
index 158e9fc8390206aea6025f7fae37ab844048068c..45ed6af7b579e2071209590864535d474b1ae7f6 100644 (file)
@@ -6,7 +6,6 @@
 #include "program.h"
 #include "programdata.h"
 #include "renderer.h"
-#include "texenv.h"
 #include "texture.h"
 #include "texture2d.h"
 #include "texturing.h"
@@ -102,7 +101,10 @@ void RenderPass::Loader::init()
 void RenderPass::Loader::material_inline()
 {
        RefPtr<Material> mat = new Material;
-       load_sub(*mat);
+       if(coll)
+               load_sub(*mat, get_collection());
+       else
+               load_sub(*mat);
        obj.material = mat;
 }
 
@@ -148,22 +150,11 @@ void RenderPass::TextureLoader::finish()
 {
        if(tex)
        {
-               if(env)
-                       obj.attach(index, *tex, *env);
-               else
-                       obj.attach(index, *tex);
+               obj.attach(index, *tex);
                tex.release();
-               env.release();
        }
 }
 
-void RenderPass::TextureLoader::texenv()
-{
-       throw runtime_error("TexEnvs can't be loaded yet");
-       /*env = new TexEnv;
-       load_sub(*env);*/
-}
-
 void RenderPass::TextureLoader::texture(const string &name)
 {
        tex = &get_collection().get<Texture>(name);
@@ -173,7 +164,10 @@ void RenderPass::TextureLoader::texture(const string &name)
 void RenderPass::TextureLoader::texture2d()
 {
        tex = new Texture2D;
-       load_sub(static_cast<Texture2D &>(*tex));
+       if(coll)
+               load_sub(static_cast<Texture2D &>(*tex), get_collection());
+       else
+               load_sub(static_cast<Texture2D &>(*tex));
 }
 
 } // namespace GL