]> git.tdb.fi Git - libs/gl.git/commitdiff
Remove some deprecated stuff that's getting in the way
authorMikko Rasa <tdb@tdb.fi>
Thu, 12 Aug 2021 11:35:45 +0000 (14:35 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 12 Aug 2021 19:32:18 +0000 (22:32 +0300)
19 files changed:
source/materials/basicmaterial.cpp
source/materials/basicmaterial.h
source/materials/material.cpp
source/materials/material.h
source/materials/pbrmaterial.cpp
source/materials/pbrmaterial.h
source/materials/renderpass.cpp
source/materials/renderpass.h
source/materials/unlitmaterial.cpp
source/materials/unlitmaterial.h
source/render/instancescene.cpp [deleted file]
source/render/instancescene.h [deleted file]
source/render/object.cpp
source/render/objectinstance.h
source/render/renderable.h
source/render/renderer.cpp
source/render/renderer.h
source/render/texturing.cpp [deleted file]
source/render/texturing.h [deleted file]

index 30202a568f62a7964700f7f765cc3af84c3350f6..49a7476489e3f5af42997ee5b0176fd540b50771 100644 (file)
@@ -41,19 +41,6 @@ void BasicMaterial::fill_program_info(string &module_name, map<string, int> &spe
        spec_values["use_reflectivity_map"] = (reflectivity.texture!=0);
 }
 
        spec_values["use_reflectivity_map"] = (reflectivity.texture!=0);
 }
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void BasicMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shdata) const
-{
-       attach_texture_to(diffuse.texture, texturing, tex_shdata, "diffuse_map");
-       attach_texture_to(specular.texture, texturing, tex_shdata, "specular_map");
-       attach_texture_to(normal.texture, texturing, tex_shdata, "normal_map");
-       attach_texture_to(emission.texture, texturing, tex_shdata, "emission_map");
-       attach_texture_to(shininess.texture, texturing, tex_shdata, "shininess_map");
-       attach_texture_to(reflectivity.texture, texturing, tex_shdata, "reflectivity_map");
-}
-#pragma GCC diagnostic pop
-
 const Texture *BasicMaterial::get_texture(Tag tag) const
 {
        if(tag==texture_tags[0])
 const Texture *BasicMaterial::get_texture(Tag tag) const
 {
        if(tag==texture_tags[0])
index bf4a1c1c5d16bccbec28edbf0f63fd018041f338..a5a8a43f31472c9e9e5f9c4fd320a77cba42e53c 100644 (file)
@@ -39,8 +39,6 @@ protected:
        virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
 
 public:
        virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
 
 public:
-       DEPRECATED virtual void attach_textures_to(Texturing &, ProgramData &) const;
-
        virtual const Tag *get_texture_tags() const { return texture_tags; }
        virtual const Texture *get_texture(Tag) const;
 
        virtual const Tag *get_texture_tags() const { return texture_tags; }
        virtual const Texture *get_texture(Tag) const;
 
index b2ee973ad11c0b8d55fc4d6ea14dabaebf31a3a8..2d7e448788e0d81612bb191c7b4733b793e2c6c1 100644 (file)
@@ -4,7 +4,6 @@
 #include "gl.h"
 #include "pbrmaterial.h"
 #include "resources.h"
 #include "gl.h"
 #include "pbrmaterial.h"
 #include "resources.h"
-#include "texturing.h"
 #include "uniform.h"
 #include "unlitmaterial.h"
 
 #include "uniform.h"
 #include "unlitmaterial.h"
 
@@ -47,29 +46,6 @@ const Program *Material::create_compatible_shader(const map<string, int> &extra_
        return shprog;
 }
 
        return shprog;
 }
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void Material::attach_texture_to(const Texture *tex, Texturing &texturing, ProgramData &tex_shdata, const string &name) const
-{
-       if(!tex)
-               return;
-
-       int unit = -1;
-
-       if(const Uniform *uni = tex_shdata.find_uniform(name))
-               if(const Uniform1i *uni_int = dynamic_cast<const Uniform1i *>(uni))
-                       unit = uni_int->get();
-
-       if(unit<0)
-               unit = texturing.find_free_unit(name);
-       if(unit<0)
-               throw runtime_error("no free texunit");
-
-       texturing.attach(unit, *tex, sampler);
-       tex_shdata.uniform(name, unit);
-}
-#pragma GCC diagnostic pop
-
 void Material::set_debug_name(const string &name)
 {
 #ifdef DEBUG
 void Material::set_debug_name(const string &name)
 {
 #ifdef DEBUG
index a5ee59e5ee1ecb9b181e53ffda03bf5562d0d8dd..43da2542612d7ba50bbb4f4e0d2ee886f7a48483 100644 (file)
@@ -11,8 +11,6 @@
 namespace Msp {
 namespace GL {
 
 namespace Msp {
 namespace GL {
 
-class Texturing;
-
 class Material
 {
 private:
 class Material
 {
 private:
@@ -105,11 +103,6 @@ public:
        /** Returns the uniforms for the material. */
        const ProgramData &get_shader_data() const { return shdata; }
 
        /** Returns the uniforms for the material. */
        const ProgramData &get_shader_data() const { return shdata; }
 
-protected:
-       DEPRECATED void attach_texture_to(const Texture *, Texturing &, ProgramData &, const std::string &) const;
-public:
-       DEPRECATED virtual void attach_textures_to(Texturing &, ProgramData &) const = 0;
-
        virtual const Tag *get_texture_tags() const = 0;
        virtual const Texture *get_texture(Tag) const = 0;
        const Sampler *get_sampler() const { return sampler; }
        virtual const Tag *get_texture_tags() const = 0;
        virtual const Texture *get_texture(Tag) const = 0;
        const Sampler *get_sampler() const { return sampler; }
index 76683e9f65d51a1e57e67ed66d85919475ee42d5..082218161dd3067846bf42463729323b2fa27f4d 100644 (file)
@@ -74,19 +74,6 @@ void PbrMaterial::fill_program_info(string &module_name, map<string, int> &spec_
        spec_values["use_emission_map"] = (emission.texture!=0);
 }
 
        spec_values["use_emission_map"] = (emission.texture!=0);
 }
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void PbrMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shdata) const
-{
-       attach_texture_to(base_color.texture, texturing, tex_shdata, "base_color_map");
-       attach_texture_to(metalness.texture, texturing, tex_shdata, "metalness_map");
-       attach_texture_to(roughness.texture, texturing, tex_shdata, "roughness_map");
-       attach_texture_to(normal.texture, texturing, tex_shdata, "normal_map");
-       attach_texture_to(occlusion.texture, texturing, tex_shdata, "occlusion_map");
-       attach_texture_to(emission.texture, texturing, tex_shdata, "emission_map");
-}
-#pragma GCC diagnostic pop
-
 const Texture *PbrMaterial::get_texture(Tag tag) const
 {
        if(tag==texture_tags[0])
 const Texture *PbrMaterial::get_texture(Tag tag) const
 {
        if(tag==texture_tags[0])
index 7c0d545936db21b5464c20bf60512f3566b94ae2..dadda9b52358c0b029f46971fcf4d2da73d088f1 100644 (file)
@@ -45,8 +45,6 @@ protected:
        virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
 
 public:
        virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
 
 public:
-       DEPRECATED virtual void attach_textures_to(Texturing &, ProgramData &) const;
-
        virtual const Tag *get_texture_tags() const { return texture_tags; }
        virtual const Texture *get_texture(Tag) const;
 
        virtual const Tag *get_texture_tags() const { return texture_tags; }
        virtual const Texture *get_texture(Tag) const;
 
index 4ab72b568d32a9704c1c56ff90dab503e7b8a297..475f3ed8797c4e6a0bbbda0b7d28938539be9d34 100644 (file)
@@ -9,7 +9,6 @@
 #include "renderer.h"
 #include "texture.h"
 #include "texture2d.h"
 #include "renderer.h"
 #include "texture.h"
 #include "texture2d.h"
-#include "texturing.h"
 #include "uniform.h"
 
 using namespace std;
 #include "uniform.h"
 
 using namespace std;
index d149a7d029dd17d552c862b35f5e5c3e98094b44..d5587c25677f140c287e5cfdba75b1d750ef4526 100644 (file)
@@ -13,7 +13,6 @@ class ProgramData;
 class Renderer;
 class Sampler;
 class Texture;
 class Renderer;
 class Sampler;
 class Texture;
-class Texturing;
 
 /**
 Encapsulates the data that determines the appearance of a rendered surface.
 
 /**
 Encapsulates the data that determines the appearance of a rendered surface.
@@ -106,7 +105,6 @@ public:
        void set_texture(Tag, const Texture *, const Sampler * = 0);
        Tag get_texture_tag(const std::string &) const;
        DEPRECATED void set_texture(unsigned, const Texture *, const Sampler * = 0);
        void set_texture(Tag, const Texture *, const Sampler * = 0);
        Tag get_texture_tag(const std::string &) const;
        DEPRECATED void set_texture(unsigned, const Texture *, const Sampler * = 0);
-       DEPRECATED const Texturing *get_texturing() const { return 0; }
        DEPRECATED int get_texture_index(const std::string &) const;
        void set_back_faces(bool);
        bool get_back_faces() const { return back_faces; }
        DEPRECATED int get_texture_index(const std::string &) const;
        void set_back_faces(bool);
        bool get_back_faces() const { return back_faces; }
index 38dbd3a3bdfc9104295fb87983839b9d19cdff29..21f2b2f3037ed2a1a1eef0f194041727e55fcaf7 100644 (file)
@@ -25,14 +25,6 @@ void UnlitMaterial::fill_program_info(string &module_name, map<string, int> &spe
        spec_values["use_vertex_color"] = vertex_color;
 }
 
        spec_values["use_vertex_color"] = vertex_color;
 }
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void UnlitMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shdata) const
-{
-       attach_texture_to(texture, texturing, tex_shdata, "color_tex");
-}
-#pragma GCC diagnostic pop
-
 const Texture *UnlitMaterial::get_texture(Tag tag) const
 {
        if(tag==texture_tags[0])
 const Texture *UnlitMaterial::get_texture(Tag tag) const
 {
        if(tag==texture_tags[0])
index 442348dad4da4400b1ad6456633b0b8e15f1ffde..dc027f1f6a79ccc7a400aa5311e1081e056729da 100644 (file)
@@ -38,11 +38,6 @@ protected:
        virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
 
 public:
        virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
 
 public:
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-       DEPRECATED virtual void attach_textures_to(Texturing &, ProgramData &) const;
-#pragma GCC diagnostic pop
-
        virtual const Tag *get_texture_tags() const { return texture_tags; }
        virtual const Texture *get_texture(Tag) const;
 
        virtual const Tag *get_texture_tags() const { return texture_tags; }
        virtual const Texture *get_texture(Tag) const;
 
diff --git a/source/render/instancescene.cpp b/source/render/instancescene.cpp
deleted file mode 100644 (file)
index c1f1097..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "object.h"
-#include "objectinstance.h"
-#include "instancescene.h"
-#include "renderer.h"
-
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-namespace Msp {
-namespace GL {
-
-void InstanceScene::add(Renderable &r)
-{
-       renderables[r.get_instance_key()].insert(&r);
-}
-
-void InstanceScene::remove(Renderable &r)
-{
-       InstanceMap::iterator i = renderables.find(r.get_instance_key());
-       if(i!=renderables.end())
-       {
-               i->second.erase(&r);
-               if(i->second.empty())
-                       renderables.erase(i);
-       }
-}
-
-void InstanceScene::setup_frame(Renderer &renderer)
-{
-       for(InstanceMap::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
-               for(RenderableSet::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
-                       (*j)->setup_frame(renderer);
-}
-
-void InstanceScene::finish_frame()
-{
-       for(InstanceMap::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
-               for(RenderableSet::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
-                       (*j)->finish_frame();
-}
-
-void InstanceScene::render(Renderer &renderer, Tag tag) const
-{
-       if(setup_frustum(renderer))
-       {
-               for(InstanceMap::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
-                       for(RenderableSet::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
-                               if(!frustum_cull(**j))
-                                       renderer.render(**j, tag);
-       }
-       else
-       {
-               for(InstanceMap::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
-                       for(RenderableSet::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
-                               renderer.render(**j, tag);
-       }
-}
-
-} // namespace GL
-} // namespace Msp
diff --git a/source/render/instancescene.h b/source/render/instancescene.h
deleted file mode 100644 (file)
index ae9b637..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef MSP_GL_INSTANCESCENE_H_
-#define MSP_GL_INSTANCESCENE_H_
-
-#include <map>
-#include <set>
-#include <msp/core/attributes.h>
-#include <msp/core/inttypes.h>
-#include "scene.h"
-
-namespace Msp {
-namespace GL {
-
-/**
-A Scene optimized for rendering instanced Renderables, such as ObjectInstances.
-All Renderables with the same instance key are rendered consecutively; within
-the same key rendering order is unspecified.
-*/
-class DEPRECATED InstanceScene: public Scene
-{
-private:
-       typedef std::set<Renderable *> RenderableSet;
-       typedef std::map<IntPtr, RenderableSet> InstanceMap;
-
-       InstanceMap renderables;
-
-public:
-       virtual void add(Renderable &);
-       virtual void remove(Renderable &);
-
-       virtual void setup_frame(Renderer &);
-       virtual void finish_frame();
-
-       virtual void render(Renderer &, Tag tag = Tag()) const;
-};
-
-} // namespace GL
-} // namespace Msp
-
-#endif
index caad3a0725caa8e1de4d18d7e27c985c351daac3..38d2e6f282cd3b5378a15c561e1ac91c302dcd0a 100644 (file)
@@ -11,7 +11,6 @@
 #include "renderer.h"
 #include "resourcemanager.h"
 #include "technique.h"
 #include "renderer.h"
 #include "resourcemanager.h"
 #include "technique.h"
-#include "texturing.h"
 
 using namespace std;
 
 
 using namespace std;
 
index c5358b06c63927bfd210092a171850bc52b6a9ce..b1501a7bc82f06afc9277ec53f8a4df624af7e32 100644 (file)
@@ -32,7 +32,6 @@ public:
        ObjectInstance(const Object &);
 
        const Object &get_object() const { return object; }
        ObjectInstance(const Object &);
 
        const Object &get_object() const { return object; }
-       DEPRECATED virtual IntPtr get_instance_key() const { return reinterpret_cast<IntPtr>(&object); }
 
        virtual const Geometry::BoundingSphere<float, 3> *get_bounding_sphere() const { return object.get_bounding_sphere(); }
 
 
        virtual const Geometry::BoundingSphere<float, 3> *get_bounding_sphere() const { return object.get_bounding_sphere(); }
 
index 30386392586066ffedcf847bd4d9b533e96d4004..4175dd81294821f7d8d7c82d76c286ca99ad8cc0 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <string>
 #include <msp/core/attributes.h>
 
 #include <string>
 #include <msp/core/attributes.h>
-#include <msp/core/inttypes.h>
 #include <msp/geometry/boundingsphere.h>
 #include "tag.h"
 
 #include <msp/geometry/boundingsphere.h>
 #include "tag.h"
 
@@ -34,10 +33,6 @@ protected:
 public:
        virtual ~Renderable() { }
 
 public:
        virtual ~Renderable() { }
 
-       /** Returns a key used for grouping Renderables in an InstanceScene.  The
-       returned value is treated as opaque. */
-       DEPRECATED virtual IntPtr get_instance_key() const { return 0; }
-
        /** Returns the model matrix of the Renderable.  Null is returned if no such
        matrix exists.  The matrix should be in world space for some effects to work
        correctly. */
        /** Returns the model matrix of the Renderable.  Null is returned if no such
        matrix exists.  The matrix should be in world space for some effects to work
        correctly. */
index 1d43a939432f9a593381992824aedec7fca87f84..d86b78046eb24454f954155f687d0c2ec9c710c0 100644 (file)
@@ -12,7 +12,6 @@
 #include "renderer.h"
 #include "sampler.h"
 #include "texture.h"
 #include "renderer.h"
 #include "sampler.h"
 #include "texture.h"
-#include "texturing.h"
 #include "texunit.h"
 #include "vertexarray.h"
 #include "vertexsetup.h"
 #include "texunit.h"
 #include "vertexarray.h"
 #include "vertexsetup.h"
@@ -23,22 +22,7 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
 namespace Msp {
 namespace GL {
 
-Renderer::Renderer():
-       default_camera(0)
-{
-       init();
-}
-
-Renderer::Renderer(const Camera *c):
-       default_camera(c)
-{
-       init();
-
-       if(c)
-               set_camera(*c);
-}
-
-void Renderer::init()
+Renderer::Renderer()
 {
        state_stack.reserve(16);
        state_stack.push_back(State());
 {
        state_stack.reserve(16);
        state_stack.push_back(State());
@@ -72,16 +56,11 @@ void Renderer::transform(const Matrix &matrix)
 }
 
 void Renderer::set_texture(Tag tag, const Texture *tex, const Sampler *samp)
 }
 
 void Renderer::set_texture(Tag tag, const Texture *tex, const Sampler *samp)
-{
-       set_texture(tag, -1, tex, samp);
-}
-
-void Renderer::set_texture(Tag tag, int unit, const Texture *tex, const Sampler *samp)
 {
        if(texture_stack.size()>state->texture_count)
        {
                BoundTexture &bt = texture_stack[state->texture_count];
 {
        if(texture_stack.size()>state->texture_count)
        {
                BoundTexture &bt = texture_stack[state->texture_count];
-               if((!tag.id || bt.tag==tag) && (unit<0 || bt.unit==unit) && bt.texture==tex && bt.sampler==samp)
+               if(bt.tag==tag && bt.texture==tex && bt.sampler==samp)
                {
                        ++state->texture_count;
                        return;
                {
                        ++state->texture_count;
                        return;
@@ -91,7 +70,7 @@ void Renderer::set_texture(Tag tag, int unit, const Texture *tex, const Sampler
        }
 
        for(vector<BoundTexture>::iterator i=texture_stack.end(); i!=texture_stack.begin(); )
        }
 
        for(vector<BoundTexture>::iterator i=texture_stack.end(); i!=texture_stack.begin(); )
-               if((--i)->tag==tag && i->unit==unit)
+               if((--i)->tag==tag)
                {
                        i->replaced = texture_stack.size();
                        break;
                {
                        i->replaced = texture_stack.size();
                        break;
@@ -100,17 +79,11 @@ void Renderer::set_texture(Tag tag, int unit, const Texture *tex, const Sampler
        texture_stack.push_back(BoundTexture());
        BoundTexture &bound_tex = texture_stack.back();
        bound_tex.tag = tag;
        texture_stack.push_back(BoundTexture());
        BoundTexture &bound_tex = texture_stack.back();
        bound_tex.tag = tag;
-       bound_tex.unit = unit;
        bound_tex.texture = tex;
        bound_tex.sampler = samp;
        state->texture_count = texture_stack.size();
 }
 
        bound_tex.texture = tex;
        bound_tex.sampler = samp;
        state->texture_count = texture_stack.size();
 }
 
-void Renderer::set_texture(const Texture *t, const Sampler *s)
-{
-       set_texture(Tag(), 0, t, s);
-}
-
 void Renderer::flush_textures()
 {
        for(unsigned i=0; i<texture_stack.size(); ++i)
 void Renderer::flush_textures()
 {
        for(unsigned i=0; i<texture_stack.size(); ++i)
@@ -128,25 +101,6 @@ void Renderer::flush_textures()
        texture_stack.erase(texture_stack.begin()+state->texture_count, texture_stack.end());
 }
 
        texture_stack.erase(texture_stack.begin()+state->texture_count, texture_stack.end());
 }
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void Renderer::set_texturing(const Texturing *t)
-{
-       if(t)
-       {
-               unsigned n_units = TexUnit::get_n_units();
-               for(unsigned i=0; i<n_units; ++i)
-                       if(const Texture *tex = t->get_attached_texture(i))
-                               set_texture(Tag(), i, tex, t->get_attached_sampler(i));
-       }
-}
-#pragma GCC diagnostic pop
-
-unsigned Renderer::allocate_effect_texunit()
-{
-       return --state->lowest_effect_texunit;
-}
-
 void Renderer::set_material(const Material *m)
 {
        if(m)
 void Renderer::set_material(const Material *m)
 {
        if(m)
@@ -239,8 +193,6 @@ void Renderer::end()
                throw invalid_operation("Renderer::end");
 
        *state = State();
                throw invalid_operation("Renderer::end");
 
        *state = State();
-       if(default_camera)
-               set_camera(*default_camera);
        shdata_stack.clear();
        excluded.clear();
 
        shdata_stack.clear();
        excluded.clear();
 
@@ -300,7 +252,7 @@ void Renderer::apply_state()
 
        for(vector<BoundTexture>::const_iterator i=texture_stack.begin(); i!=texture_stack.end(); ++i)
        {
 
        for(vector<BoundTexture>::const_iterator i=texture_stack.begin(); i!=texture_stack.end(); ++i)
        {
-               int unit = (i->tag.id ? state->shprog->get_uniform_binding(i->tag) : i->unit);
+               int unit = state->shprog->get_uniform_binding(i->tag);
                if(unit>=0)
                {
                        if(i->texture)
                if(unit>=0)
                {
                        if(i->texture)
index 50254cdf1de09824cb50f9bd37a9f85436a41606..b5cbe5bcab7a32b1182f9f2aa90ca6f88c93cb68 100644 (file)
@@ -21,7 +21,6 @@ class Program;
 class Renderable;
 class Sampler;
 class Texture;
 class Renderable;
 class Sampler;
 class Texture;
-class Texturing;
 class VertexSetup;
 class WindingTest;
 
 class VertexSetup;
 class WindingTest;
 
@@ -106,7 +105,6 @@ private:
                SHADER_DATA = 16
        };
 
                SHADER_DATA = 16
        };
 
-       const Camera *default_camera;
        unsigned char changed;
        std::vector<State> state_stack;
        State *state;
        unsigned char changed;
        std::vector<State> state_stack;
        State *state;
@@ -117,10 +115,6 @@ private:
 
 public:
        Renderer();
 
 public:
        Renderer();
-       DEPRECATED Renderer(const Camera *);
-private:
-       void init();
-public:
        ~Renderer();
 
        /** Sets the camera to render from.  The model matrix is reset to identity. */
        ~Renderer();
 
        /** Sets the camera to render from.  The model matrix is reset to identity. */
@@ -139,15 +133,8 @@ public:
 
        void set_texture(Tag, const Texture *, const Sampler * = 0);
 private:
 
        void set_texture(Tag, const Texture *, const Sampler * = 0);
 private:
-       void set_texture(Tag, int, const Texture *, const Sampler *);
        void flush_textures();
 public:
        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
        DEPRECATED void set_material(const Material *);
 
        DEPRECATED void set_lighting(const Lighting *);
        DEPRECATED void set_material(const Material *);
 
        DEPRECATED void set_lighting(const Lighting *);
diff --git a/source/render/texturing.cpp b/source/render/texturing.cpp
deleted file mode 100644 (file)
index 341cdb7..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-#include <msp/core/hash.h>
-#include "texture.h"
-#include "texturing.h"
-#include "texunit.h"
-
-using namespace std;
-
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-namespace Msp {
-namespace GL {
-
-Texturing::~Texturing()
-{
-       if(current()==this)
-               unbind();
-}
-
-int Texturing::find_free_unit(const string &name_hint) const
-{
-       unsigned max_unit = TexUnit::get_n_units();
-       // Leave some space for effect textures
-       max_unit -= min(max_unit/4, 8U);
-       unsigned initial_unit = (name_hint.empty() ? 0 : hash32(name_hint)%max_unit);
-       unsigned unit = initial_unit;
-       while(get_attached_texture(unit) || get_attached_sampler(unit))
-       {
-               unit = (unit+1)%max_unit;
-               if(unit==initial_unit)
-                       return -1;
-       }
-
-       return unit;
-}
-
-void Texturing::attach(unsigned attch, const Texture &tex, const Sampler *samp)
-{
-       set_attachment(attch, &tex, samp);
-}
-
-void Texturing::attach(unsigned attch, const Sampler &samp)
-{
-       set_attachment(attch, 0, &samp);
-}
-
-void Texturing::detach(unsigned attch)
-{
-       set_attachment(attch, 0, 0);
-}
-
-void Texturing::set_attachment(unsigned unit, const Texture *tex, const Sampler *samp)
-{
-       if(unit>=TexUnit::get_n_units())
-               throw out_of_range("Texturing::set_attachment");
-
-       if(tex || samp)
-       {
-               vector<Attachment>::iterator i;
-               for(i=attachments.begin(); (i!=attachments.end() && i->unit<=unit); ++i)
-                       if(i->unit==unit)
-                       {
-                               i->texture = tex;
-                               i->sampler = samp;
-                               if(current()==this)
-                                       bind_attachment(*i);
-                               return;
-                       }
-
-               attachments.insert(i, Attachment(unit, tex, samp));
-               if(current()==this)
-                       tex->bind_to(unit);
-       }
-       else
-       {
-               for(vector<Attachment>::iterator i=attachments.begin(); (i!=attachments.end() && i->unit<=unit); ++i)
-                       if(i->unit==unit)
-                       {
-                               attachments.erase(i);
-                               if(current()==this)
-                                       unbind_attachment(unit);
-                               return;
-                       }
-       }
-}
-
-const Texture *Texturing::get_attached_texture(unsigned unit) const
-{
-       for(vector<Attachment>::const_iterator i=attachments.begin(); (i!=attachments.end() && i->unit<=unit); ++i)
-               if(i->unit==unit)
-                       return i->texture;
-       return 0;
-}
-
-const Sampler *Texturing::get_attached_sampler(unsigned unit) const
-{
-       for(vector<Attachment>::const_iterator i=attachments.begin(); (i!=attachments.end() && i->unit<=unit); ++i)
-               if(i->unit==unit)
-                       return i->sampler;
-       return 0;
-}
-
-void Texturing::bind() const
-{
-       const Texturing *old = current();
-       if(set_current(this))
-       {
-               if(old)
-               {
-                       vector<Attachment>::const_iterator i = attachments.begin();
-                       vector<Attachment>::const_iterator j = old->attachments.begin();
-                       while(i!=attachments.end() || j!=old->attachments.end())
-                       {
-                               if(i!=attachments.end() && (j==old->attachments.end() || i->unit<=j->unit))
-                               {
-                                       bind_attachment(*i);
-                                       if(j!=old->attachments.end() && j->unit==i->unit)
-                                               ++j;
-                                       ++i;
-                               }
-                               else
-                               {
-                                       unbind_attachment(j->unit);
-                                       ++j;
-                               }
-                       }
-               }
-               else
-               {
-                       for(vector<Attachment>::const_iterator i=attachments.begin(); i!=attachments.end(); ++i)
-                               bind_attachment(*i);
-               }
-       }
-}
-
-void Texturing::bind_attachment(const Attachment &attch) const
-{
-       if(attch.sampler)
-               attch.sampler->bind_to(attch.unit);
-       else
-               Sampler::unbind_from(attch.unit);
-       if(attch.texture)
-               attch.texture->bind_to(attch.unit);
-       else
-               Texture::unbind_from(attch.unit);
-}
-
-void Texturing::unbind()
-{
-       const Texturing *old = current();
-       if(set_current(0))
-       {
-               for(vector<Attachment>::const_iterator i=old->attachments.begin(); i!=old->attachments.end(); ++i)
-                       unbind_attachment(i->unit);
-       }
-}
-
-void Texturing::unbind_attachment(unsigned unit)
-{
-       Texture::unbind_from(unit);
-       Sampler::unbind_from(unit);
-}
-
-
-Texturing::Attachment::Attachment(unsigned u, const Texture *t, const Sampler *s):
-       unit(u),
-       texture(t),
-       sampler(s)
-{ }
-
-} // namespace GL
-} // namespace Msp;
diff --git a/source/render/texturing.h b/source/render/texturing.h
deleted file mode 100644 (file)
index 44189c9..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef MSP_GL_TEXTURING_H_
-#define MSP_GL_TEXTURING_H_
-
-#include <vector>
-#include "bindable.h"
-
-namespace Msp {
-namespace GL {
-
-class Texture;
-
-class DEPRECATED Texturing: public Bindable<Texturing>
-{
-private:
-       struct Attachment
-       {
-               unsigned unit;
-               const Texture *texture;
-               const Sampler *sampler;
-
-               Attachment(unsigned, const Texture *, const Sampler *);
-       };
-
-       std::vector<Attachment> attachments;
-
-public:
-       ~Texturing();
-
-       int find_free_unit(const std::string & = std::string()) const;
-       void attach(unsigned, const Texture &, const Sampler * = 0);
-       void attach(unsigned, const Sampler &);
-       void detach(unsigned);
-private:
-       void set_attachment(unsigned, const Texture *, const Sampler *);
-public:
-       const Texture *get_attached_texture(unsigned) const;
-       const Sampler *get_attached_sampler(unsigned) const;
-
-       void bind() const;
-
-       static void unbind();
-
-private:
-       void bind_attachment(const Attachment &) const;
-       static void unbind_attachment(unsigned);
-};
-
-} // namespace GL
-} // namespace Msp;
-
-#endif