]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/program_backend.cpp
Add correct copy and move semantics to most classes
[libs/gl.git] / source / backends / opengl / program_backend.cpp
index 132ad1c05e823e5fd0da09887a9d54af82044638..685f15421d6d726f34f6b73840a5f7ac96eb3e3f 100644 (file)
@@ -46,6 +46,17 @@ OpenGLProgram::OpenGLProgram()
        id = glCreateProgram();
 }
 
+OpenGLProgram::OpenGLProgram(OpenGLProgram &&other):
+       id(other.id),
+       linked(other.linked),
+       uniform_calls(move(other.uniform_calls)),
+       debug_name(move(other.debug_name))
+{
+       move(other.stage_ids, other.stage_ids+MAX_STAGES, stage_ids);
+       other.id = 0;
+       fill(other.stage_ids, other.stage_ids+MAX_STAGES, 0);
+}
+
 OpenGLProgram::~OpenGLProgram()
 {
        for(unsigned i=0; i<MAX_STAGES; ++i)