X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Frenderer.h;h=1a84d8bf8507c50d596bc3d1490a289f8c2f5855;hb=acb4aba95c22fa7c72eeef10befd611570d35182;hp=f8d297289085557c31cfc866ed1e1b2b2d5d952d;hpb=233dff2a6c552e08da832496aecd88ef4f8948f1;p=libs%2Fgl.git diff --git a/source/render/renderer.h b/source/render/renderer.h index f8d29728..1a84d8bf 100644 --- a/source/render/renderer.h +++ b/source/render/renderer.h @@ -64,13 +64,30 @@ public: }; private: + struct BoundTexture + { + Tag tag; + mutable int unit; + const Texture *texture; + const Sampler *sampler; + int replaced; + + BoundTexture(); + }; + + struct BoundProgramData + { + const ProgramData *shdata; + mutable unsigned generation; + + BoundProgramData(const ProgramData *); + }; + 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,8 +116,9 @@ private: unsigned char changed; std::vector state_stack; State *state; + std::vector texture_stack; ProgramData standard_shdata; - std::vector shdata_stack; + std::vector shdata_stack; std::set excluded; public: @@ -126,9 +144,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 *);