#include "program.h"
#include "programdata.h"
#include "renderer.h"
-#include "texenv.h"
#include "texture.h"
#include "texture2d.h"
#include "texturing.h"
back_faces(other.back_faces)
{ }
+RenderPass &RenderPass::operator=(const RenderPass &other)
+{
+ shprog = other.shprog;
+ shdata = other.shdata ? new ProgramData(*other.shdata) : 0;
+ material = other.material;
+ texturing = other.texturing ? new Texturing(*other.texturing) : 0;
+ tex_names = other.tex_names;
+ back_faces = other.back_faces;
+ return *this;
+}
+
RenderPass::~RenderPass()
{
delete texturing;
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;
}
{
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);
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