From: Mikko Rasa Date: Fri, 6 Jan 2017 10:27:54 +0000 (+0200) Subject: Implement an assignment operator for RenderPass X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=bdacc1cf89edcc8d8a00364aa20c9472744cd9ca;p=libs%2Fgl.git Implement an assignment operator for RenderPass Clang compains about this too when trying to assign the pass map in Technique. --- diff --git a/source/renderpass.cpp b/source/renderpass.cpp index 45ed6af7..4063df5f 100644 --- a/source/renderpass.cpp +++ b/source/renderpass.cpp @@ -32,6 +32,17 @@ RenderPass::RenderPass(const RenderPass &other): 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; diff --git a/source/renderpass.h b/source/renderpass.h index eec60793..11a9c45b 100644 --- a/source/renderpass.h +++ b/source/renderpass.h @@ -62,10 +62,10 @@ private: std::map tex_names; bool back_faces; - RenderPass &operator=(const RenderPass &); public: RenderPass(); RenderPass(const RenderPass &); + RenderPass &operator=(const RenderPass &); ~RenderPass(); void set_shader_program(const Program *, const ProgramData *);