-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007-2008, 2010-2011 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#ifndef MSP_GL_RENDERPASS_H_
#define MSP_GL_RENDERPASS_H_
class Material;
class Program;
class ProgramData;
-class TexEnv;
+class Renderer;
class Texture;
class Texturing;
void material_inline();
void material(const std::string &);
void texunit(unsigned);
+ void texunit_named(unsigned, const std::string &);
void uniforms();
};
private:
unsigned index;
RefPtr<Texture> tex;
- RefPtr<TexEnv> env;
public:
TextureLoader(Texturing &, unsigned, Collection *);
private:
virtual void finish();
- void texenv();
void texture(const std::string &);
void texture2d();
};
- Program *shprog;
- ProgramData *shdata;
+ const Program *shprog;
+ RefPtr<const ProgramData> shdata;
RefPtr<const Material> material;
Texturing *texturing;
+ std::map<std::string, unsigned> tex_names;
+ bool back_faces;
RenderPass &operator=(const RenderPass &);
public:
RenderPass(const RenderPass &);
~RenderPass();
+ void set_shader_program(const Program *, const ProgramData *);
const Program *get_shader_program() const { return shprog; }
- const ProgramData *get_shader_data() const { return shdata; }
+ const ProgramData *get_shader_data() const { return shdata.get(); }
void set_material(const Material *);
const Material *get_material() const { return material.get(); }
void set_texture(unsigned, const Texture *);
const Texturing *get_texturing() const { return texturing; }
+ int get_texture_index(const std::string &) const;
+ void set_back_faces(bool);
+ bool get_back_faces() const { return back_faces; }
+
+ void apply(Renderer &) const;
};
} // namespace GL