]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/vertexsetup_backend.cpp
Add correct copy and move semantics to most classes
[libs/gl.git] / source / backends / opengl / vertexsetup_backend.cpp
index 90189db7227eba94575f99a27fc98ab39e234843..acd14f48b70c42fd539f85c277c09e06ac3a94e7 100644 (file)
@@ -27,9 +27,16 @@ OpenGLVertexSetup::OpenGLVertexSetup()
                glGenVertexArrays(1, &id);
 }
 
+OpenGLVertexSetup::OpenGLVertexSetup(OpenGLVertexSetup &&other):
+       id(other.id)
+{
+       other.id = 0;
+}
+
 OpenGLVertexSetup::~OpenGLVertexSetup()
 {
-       glDeleteVertexArrays(1, &id);
+       if(id)
+               glDeleteVertexArrays(1, &id);
 }
 
 void OpenGLVertexSetup::require_format(const VertexFormat &fmt, bool instanced)