return;
Renderer::Push push(renderer);
- renderer.set_shader_program(pass->get_shader_program(), pass->get_shader_data());
- renderer.set_material(pass->get_material());
- renderer.set_texturing(pass->get_texturing());
+ pass->apply(renderer);
setup_render(renderer, tag);
meshes.front()->draw(renderer);
return;
Renderer::Push push(renderer);
- renderer.set_shader_program(pass->get_shader_program(), pass->get_shader_data());
- renderer.set_material(pass->get_material());
- renderer.set_texturing(pass->get_texturing());
+ pass->apply(renderer);
setup_render(renderer, tag);
inst.setup_render(renderer, tag);
#include "renderpass.h"
#include "program.h"
#include "programdata.h"
+#include "renderer.h"
#include "texenv.h"
#include "texture.h"
#include "texture2d.h"
return i->second;
}
+void RenderPass::apply(Renderer &renderer) const
+{
+ renderer.set_texturing(texturing);
+ renderer.set_material(material.get());
+ renderer.set_shader_program(shprog, shdata.get());
+}
+
RenderPass::Loader::Loader(RenderPass &p):
DataFile::CollectionObjectLoader<RenderPass>(p, 0)
class Material;
class Program;
class ProgramData;
+class Renderer;
class TexEnv;
class Texture;
class Texturing;
void set_texture(unsigned, const Texture *);
const Texturing *get_texturing() const { return texturing; }
int get_texture_index(const std::string &) const;
+
+ void apply(Renderer &) const;
};
} // namespace GL