[nostalgia/core/userland] Make Texture copy width and height on move
This commit is contained in:
parent
c2554cebdb
commit
8d19f99fac
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user