[nostalgia/core/userland] Make Texture copy width and height on move

This commit is contained in:
Gary Talent 2021-03-20 15:58:29 -05:00
parent c2554cebdb
commit 8d19f99fac

View File

@ -26,6 +26,23 @@ struct TextureBase {
GLsizei width = 0;
GLsizei height = 0;
constexpr TextureBase() = default;
constexpr TextureBase(TextureBase &&tb) noexcept {
width = tb.width;
height = tb.height;
tb.width = 0;
tb.height = 0;
}
constexpr TextureBase &operator=(TextureBase &&tb) noexcept {
width = tb.width;
height = tb.height;
tb.width = 0;
tb.height = 0;
return *this;
}
};
@ -51,6 +68,7 @@ struct GLobject: public Base {
GLobject &operator=(GLobject &&o) {
this->~GLobject();
Base::operator=(ox::move(o));
id = o.id;
o.id = 0;
return *this;