X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Frender%2Frenderer.h;h=603866073c7e81f6edac092d6db169d7c7a98051;hp=f8d297289085557c31cfc866ed1e1b2b2d5d952d;hb=6f39983060a27634c012f66c82fea0d09fea9774;hpb=3af09f06e9f69532e5adfe6bcd9a7b2d1aea6d5b diff --git a/source/render/renderer.h b/source/render/renderer.h index f8d29728..60386607 100644 --- a/source/render/renderer.h +++ b/source/render/renderer.h @@ -64,13 +64,22 @@ public: }; private: + struct BoundTexture + { + Tag tag; + mutable int unit; + const Texture *texture; + const Sampler *sampler; + int replaced; + + BoundTexture(); + }; + struct State { const Camera *camera; Matrix modelview_matrix; - const Texture *texture; - const Sampler *sampler; - const Texturing *texturing; + unsigned texture_count; unsigned lowest_effect_texunit; const Material *material; const Lighting *lighting; @@ -99,6 +108,7 @@ private: unsigned char changed; std::vector state_stack; State *state; + std::vector texture_stack; ProgramData standard_shdata; std::vector shdata_stack; std::set excluded; @@ -126,9 +136,17 @@ public: /** Returns the current modelview matrix. */ const Matrix &get_matrix() const { return state->modelview_matrix; } - void set_texture(const Texture *, const Sampler * = 0); - void set_texturing(const Texturing *); - unsigned allocate_effect_texunit(); + void set_texture(Tag, const Texture *, const Sampler * = 0); +private: + void set_texture(Tag, int, const Texture *, const Sampler *); + void flush_textures(); +public: +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + DEPRECATED void set_texture(const Texture *, const Sampler * = 0); + DEPRECATED void set_texturing(const Texturing *); + DEPRECATED unsigned allocate_effect_texunit(); +#pragma GCC diagnostic pop void set_material(const Material *); void set_lighting(const Lighting *);