index(i)
{
add("texture", &TextureLoader::texture);
- add("texture2d", &TextureLoader::texture2d);
-}
-
-void RenderPass::TextureLoader::finish()
-{
- if(tex)
- {
- obj.attach(index, *tex);
- tex.release();
- }
}
void RenderPass::TextureLoader::texture(const string &name)
{
- tex = &get_collection().get<Texture>(name);
- tex.keep();
-}
-
-void RenderPass::TextureLoader::texture2d()
-{
- tex = new Texture2D;
- if(coll)
- load_sub(static_cast<Texture2D &>(*tex), get_collection());
- else
- load_sub(static_cast<Texture2D &>(*tex));
+ obj.attach(index, get_collection().get<Texture>(name));
}
} // namespace GL
/**
Encapsulates the data that determines the appearance of a rendered surface.
This includes shader and data for it, material and texturing.
-
-XXX Does not delete inline texture from datafiles properly
*/
class RenderPass
{
{
private:
unsigned index;
- RefPtr<Texture> tex;
public:
TextureLoader(Texturing &, unsigned, Collection *);
private:
- virtual void finish();
-
void texture(const std::string &);
- void texture2d();
};
RefPtr<const Program> shprog;