Binary object storage, misc changes

This commit is contained in:
2015-02-13 15:47:56 +01:00
parent 701ccce857
commit 260808b1fc
7 changed files with 106 additions and 3 deletions

View File

@@ -32,6 +32,21 @@ public:
glDeleteFramebuffers(1, &_fbID);
}
Framebuffer(Framebuffer const& copy) = delete;
Framebuffer& operator=(Framebuffer const& copy) = delete;
Framebuffer(Framebuffer && move) : _fbID(move._fbID) {
move._fbID = 0;
}
Framebuffer& operator=(Framebuffer && move) {
glDeleteFramebuffers(1, &_fbID);
_fbID = move._fbID;
move._fbID = 0;
return *this;
}
void bind() const {
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _fbID);
}
@@ -139,6 +154,21 @@ public:
glDeleteTextures(1, &_texID);
}
Texture2D(Texture2D const& copy) = delete;
Texture2D& operator=(Texture2D const& copy) = delete;
Texture2D(Texture2D && move) : _texID(move._texID) {
move._texID = 0;
}
Texture2D& operator=(Texture2D && move) {
glDeleteTextures(1, &_texID);
_texID = move._texID;
move._texID = 0;
return *this;
}
void bind() {
glBindTexture(GL_TEXTURE_2D, _texID);
}