From bdacc1cf89edcc8d8a00364aa20c9472744cd9ca Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 6 Jan 2017 12:27:54 +0200 Subject: [PATCH] Implement an assignment operator for RenderPass Clang compains about this too when trying to assign the pass map in Technique. --- source/renderpass.cpp | 11 +++++++++++ source/renderpass.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) 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 *); -- 2.45.2