]> git.tdb.fi Git - libs/gl.git/commitdiff
Implement an assignment operator for RenderPass
authorMikko Rasa <tdb@tdb.fi>
Fri, 6 Jan 2017 10:27:54 +0000 (12:27 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 6 Jan 2017 10:27:54 +0000 (12:27 +0200)
Clang compains about this too when trying to assign the pass map in
Technique.

source/renderpass.cpp
source/renderpass.h

index 45ed6af7b579e2071209590864535d474b1ae7f6..4063df5fcf27ea5c56069cd8621473f181e9a3ce 100644 (file)
@@ -32,6 +32,17 @@ RenderPass::RenderPass(const RenderPass &other):
        back_faces(other.back_faces)
 { }
 
        back_faces(other.back_faces)
 { }
 
+RenderPass &RenderPass::operator=(const RenderPass &other)
+{
+       shprog = other.shprog;
+       shdata = other.shdata ? new ProgramData(*other.shdata) : 0;
+       material = other.material;
+       texturing = other.texturing ? new Texturing(*other.texturing) : 0;
+       tex_names = other.tex_names;
+       back_faces = other.back_faces;
+       return *this;
+}
+
 RenderPass::~RenderPass()
 {
        delete texturing;
 RenderPass::~RenderPass()
 {
        delete texturing;
index eec60793ea3ca23b9052ae27dd75cdcfbfd97c52..11a9c45b7e8ef36182dc415933534d60f5518951 100644 (file)
@@ -62,10 +62,10 @@ private:
        std::map<std::string, unsigned> tex_names;
        bool back_faces;
 
        std::map<std::string, unsigned> tex_names;
        bool back_faces;
 
-       RenderPass &operator=(const RenderPass &);
 public:
        RenderPass();
        RenderPass(const RenderPass &);
 public:
        RenderPass();
        RenderPass(const RenderPass &);
+       RenderPass &operator=(const RenderPass &);
        ~RenderPass();
 
        void set_shader_program(const Program *, const ProgramData *);
        ~RenderPass();
 
        void set_shader_program(const Program *, const ProgramData *);