Textures bugfix: copy & reset size on move
This commit is contained in:
parent
c714d6b73a
commit
74ba55257f
1 changed files with 4 additions and 0 deletions
|
|
@ -164,8 +164,10 @@ namespace psemek::gfx
|
|||
template <std::size_t D, GLenum Target>
|
||||
basic_texture<D, Target>::basic_texture(basic_texture && other)
|
||||
: id_{other.id_}
|
||||
, size_{other.size_}
|
||||
{
|
||||
other.id_ = 0;
|
||||
other.size_ = other.size_.zero();
|
||||
}
|
||||
|
||||
template <std::size_t D, GLenum Target>
|
||||
|
|
@ -175,6 +177,7 @@ namespace psemek::gfx
|
|||
|
||||
reset();
|
||||
std::swap(id_, other.id_);
|
||||
std::swap(size_, other.size_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -196,6 +199,7 @@ namespace psemek::gfx
|
|||
if (id_ != 0)
|
||||
gl::DeleteTextures(1, &id_);
|
||||
id_ = 0;
|
||||
size_ = size_.zero();
|
||||
}
|
||||
|
||||
template <std::size_t D, GLenum Target>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue