some effc++ fixes

This commit is contained in:
2015-01-23 15:43:06 +01:00
parent 701ccce857
commit 05bf47c678
5 changed files with 34 additions and 19 deletions

View File

@@ -40,6 +40,9 @@ public:
move._vbo = nullptr;
}
VBOAlloc(VBOAlloc const& copy) = delete;
VBOAlloc& operator=(VBOAlloc const& copy) = delete;
VBOAlloc& operator=(VBOAlloc&& move) {
_vbo = move._vbo;
_ofs = move._ofs;
@@ -103,10 +106,22 @@ private:
}
VBO(VBO const& copy) = delete;
VBO(VBO&& move) : _bufID(move._bufID), _allocs(move._allocs) {
VBO& operator=(VBO const& copy) = delete;
VBO(VBO&& move) : _bufID(move._bufID), _allocs(std::move(move._allocs)) {
move._bufID = 0;
}
VBO& operator=(VBO&& move) {
for (auto ent : _allocs) {
assert(!ent.used);
}
if (_bufID)
glDeleteBuffers(1, &_bufID);
_bufID = move._bufID;
move._bufID = 0;
_allocs = std::move(move._allocs);
}
~VBO() {
for (auto ent : _allocs) {